/[PAMELA software]/DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp
ViewVC logotype

Diff of /DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33 by mocchiut, Tue Nov 5 14:02:07 2013 UTC revision 1.37 by mocchiut, Tue Oct 14 14:07:10 2014 UTC
# Line 165  void CaloLevel0::ProcessingInit(GL_TABLE Line 165  void CaloLevel0::ProcessingInit(GL_TABLE
165  void CaloLevel0::InitDo(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){  void CaloLevel0::InitDo(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){
166    stringstream myquery;    stringstream myquery;
167    myquery.str("");    myquery.str("");
168    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
169    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
170      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
171    //    //
172    debug = isdeb;    debug = isdeb;
173    verbose = isverb;    verbose = isverb;
# Line 272  Int_t CaloLevel0::ChkParam(GL_TABLES *gl Line 273  Int_t CaloLevel0::ChkParam(GL_TABLES *gl
273    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
274    stringstream myquery;    stringstream myquery;
275    myquery.str("");    myquery.str("");
276    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
277    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
278      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
279    //    //
280    Int_t sig = this->ChkParamDo(dbc,runheader,mechal);    Int_t sig = this->ChkParamDo(dbc,runheader,mechal);
281    dbc->Close();    dbc->Close();
# Line 598  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T Line 600  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T
600    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
601    stringstream myquery;    stringstream myquery;
602    myquery.str("");    myquery.str("");
603    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
604    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
605      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
606    //    //
607    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable);    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable);
608    dbc->Close();    dbc->Close();
# Line 618  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T Line 621  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T
621    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
622    stringstream myquery;    stringstream myquery;
623    myquery.str("");    myquery.str("");
624    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
625    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
626      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
627    //    //
628    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true);    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true);
629    dbc->Close();    dbc->Close();
# Line 1214  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1218  Int_t CaloLevel0::Calibrate(Int_t ei){
1218    val = 0;    val = 0;
1219    del = 1000;    del = 1000;
1220    if ( clevel2->trigty < 2. ){    if ( clevel2->trigty < 2. ){
1221      Bool_t ck = false;      //    Bool_t ck = false;
1222      for (Int_t sec = 0; sec < 4; sec++){      for (Int_t sec = 0; sec < 4; sec++){
1223        val = (Int_t)de->calselftrig[sec][6];        val = (Int_t)de->calselftrig[sec][6];
1224        del = delay(val);        del = delay(val);
1225        if ( del < 1000 ){        if ( del < 1000 ){
1226          clevel2->wartrig = 0.;                clevel2->wartrig = 0.;      
1227          clevel2->trigty = 3.;          clevel2->trigty = 3.;
1228          ck = true;          //      ck = true;
1229          break;          break;
1230        };        };
1231      };      };
# Line 1242  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1246  Int_t CaloLevel0::Calibrate(Int_t ei){
1246    Int_t se = 5;    Int_t se = 5;
1247    Int_t done = 0;    Int_t done = 0;
1248    Int_t pre = -1;    Int_t pre = -1;
1249    Bool_t isCOMP = false;    //  Bool_t isCOMP = false;
1250    Bool_t isFULL = false;    //  Bool_t isFULL = false;
1251    Bool_t isRAW = false;    Bool_t isRAW = false;
1252    Float_t ener;    Float_t ener;
1253    Int_t doneb = 0;    Int_t doneb = 0;
# Line 1292  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1296  Int_t CaloLevel0::Calibrate(Int_t ei){
1296        //        //
1297        // determine what kind of event we are going to analyze        // determine what kind of event we are going to analyze
1298        //        //
1299        isCOMP = false;        //      isCOMP = false;
1300        isFULL = false;        //      isFULL = false;
1301        isRAW = false;        isRAW = false;
1302        if ( de->stwerr[se] & (1 << 16) ) isCOMP = true;        //      if ( de->stwerr[se] & (1 << 16) ) isCOMP = true;
1303        if ( de->stwerr[se] & (1 << 17) ) isFULL = true;        //      if ( de->stwerr[se] & (1 << 17) ) isFULL = true;
1304        if ( de->stwerr[se] & (1 << 3) ) isRAW = true;        if ( de->stwerr[se] & (1 << 3) ) isRAW = true;
1305        if ( !chdone[se] ){        if ( !chdone[se] ){
1306          //          //
# Line 1942  void CaloLevel0::FillTrkVar(CaloLevel2 * Line 1946  void CaloLevel0::FillTrkVar(CaloLevel2 *
1946    ClearTrkVar();    ClearTrkVar();
1947  }  }
1948    
1949    void CaloLevel0::FillTrkVar(TClonesArray *tcl, Int_t nutrk){
1950      //
1951      CaloTrkVar *t_ca = new CaloTrkVar();
1952      //
1953      t_ca->trkseqno = trkseqno;
1954      t_ca->ncore = (Int_t)clevel2->ncore;
1955      t_ca->qcore = clevel2->qcore;
1956      t_ca->noint = (Int_t)clevel2->noint;
1957      t_ca->ncyl = (Int_t)clevel2->ncyl;
1958      t_ca->qcyl = clevel2->qcyl;
1959      t_ca->qtrack = clevel2->qtrack;
1960      t_ca->qtrackx = clevel2->qtrackx;
1961      t_ca->qtracky = clevel2->qtracky;
1962      t_ca->dxtrack = clevel2->dxtrack;
1963      t_ca->dytrack = clevel2->dytrack;
1964      t_ca->qlast = clevel2->qlast;
1965      t_ca->nlast = (Int_t)clevel2->nlast;
1966      t_ca->qpre = clevel2->qpre;
1967      t_ca->npre = (Int_t)clevel2->npre;
1968      t_ca->qpresh = clevel2->qpresh;
1969      t_ca->npresh = (Int_t)clevel2->npresh;
1970      t_ca->qtr = clevel2->qtr;
1971      t_ca->ntr = (Int_t)clevel2->ntr;
1972      t_ca->planetot = (Int_t)clevel2->planetot;
1973      t_ca->qmean = clevel2->qmean;
1974      t_ca->dX0l = clevel2->dX0l;
1975      t_ca->qlow = clevel2->qlow;
1976      t_ca->nlow = (Int_t)clevel2->nlow;
1977      //
1978      memcpy(t_ca->tibar,clevel2->tibar,sizeof(clevel2->tibar));
1979      memcpy(t_ca->tbar,clevel2->tbar,sizeof(clevel2->tbar));
1980      //
1981      //
1982      TClonesArray &t = *tcl;
1983      new(t[nutrk]) CaloTrkVar(*t_ca);
1984      //
1985      delete t_ca;
1986      //
1987      ClearTrkVar();
1988    }
1989    
1990  void CaloLevel0::GetCommonVar(){  void CaloLevel0::GetCommonVar(){
1991    calol2cm();    calol2cm();
1992  }  }
# Line 2148  Int_t CaloLevel0::Update(GL_TABLES *glt, Line 2193  Int_t CaloLevel0::Update(GL_TABLES *glt,
2193    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
2194    stringstream myquery;    stringstream myquery;
2195    myquery.str("");    myquery.str("");
2196    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
2197    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
2198      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
2199    Int_t sgnl = 0;    Int_t sgnl = 0;
2200    //    //
2201    GL_CALO_CALIB *glcalo = new GL_CALO_CALIB();    GL_CALO_CALIB *glcalo = new GL_CALO_CALIB();

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.23