/[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.31 by mocchiut, Mon Apr 19 14:17:22 2010 UTC revision 1.36 by mocchiut, Fri Oct 10 13:35:05 2014 UTC
# Line 158  void CaloLevel0::ProcessingInit(GL_TABLE Line 158  void CaloLevel0::ProcessingInit(GL_TABLE
158    this->InitDo(dbc,hs,sgnl,l0tree,isdeb,isverb);    this->InitDo(dbc,hs,sgnl,l0tree,isdeb,isverb);
159    dbc->Close();    dbc->Close();
160    delete dbc;    delete dbc;
161      dbc = 0;
162  }  }
163    
164    
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'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
169    dbc->Query(myquery.str().c_str());    dbc->Query(myquery.str().c_str());
170    //    //
171    debug = isdeb;    debug = isdeb;
# Line 271  Int_t CaloLevel0::ChkParam(GL_TABLES *gl Line 272  Int_t CaloLevel0::ChkParam(GL_TABLES *gl
272    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
273    stringstream myquery;    stringstream myquery;
274    myquery.str("");    myquery.str("");
275    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
276    dbc->Query(myquery.str().c_str());    dbc->Query(myquery.str().c_str());
277    //    //
278    Int_t sig = this->ChkParamDo(dbc,runheader,mechal);    Int_t sig = this->ChkParamDo(dbc,runheader,mechal);
279    dbc->Close();    dbc->Close();
280    delete dbc;    delete dbc;
281      dbc = 0;
282    return(sig);    return(sig);
283  }  }
284    
# Line 596  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T Line 598  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T
598    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
599    stringstream myquery;    stringstream myquery;
600    myquery.str("");    myquery.str("");
601    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
602    dbc->Query(myquery.str().c_str());    dbc->Query(myquery.str().c_str());
603    //    //
604    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable);    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable);
605    dbc->Close();    dbc->Close();
606    delete dbc;    delete dbc;
607      dbc = 0;
608    //    //
609    return(sig);    return(sig);
610    //      //  
# Line 615  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T Line 618  Int_t CaloLevel0::CalcCrossTalkCorr(GL_T
618    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
619    stringstream myquery;    stringstream myquery;
620    myquery.str("");    myquery.str("");
621    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
622    dbc->Query(myquery.str().c_str());    dbc->Query(myquery.str().c_str());
623    //    //
624    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true);    Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true);
625    dbc->Close();    dbc->Close();
626    delete dbc;    delete dbc;
627      dbc = 0;
628    //    //
629    return(sig);    return(sig);
630    //    //
# Line 1210  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1214  Int_t CaloLevel0::Calibrate(Int_t ei){
1214    val = 0;    val = 0;
1215    del = 1000;    del = 1000;
1216    if ( clevel2->trigty < 2. ){    if ( clevel2->trigty < 2. ){
1217      Bool_t ck = false;      //    Bool_t ck = false;
1218      for (Int_t sec = 0; sec < 4; sec++){      for (Int_t sec = 0; sec < 4; sec++){
1219        val = (Int_t)de->calselftrig[sec][6];        val = (Int_t)de->calselftrig[sec][6];
1220        del = delay(val);        del = delay(val);
1221        if ( del < 1000 ){        if ( del < 1000 ){
1222          clevel2->wartrig = 0.;                clevel2->wartrig = 0.;      
1223          clevel2->trigty = 3.;          clevel2->trigty = 3.;
1224          ck = true;          //      ck = true;
1225          break;          break;
1226        };        };
1227      };      };
# Line 1238  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1242  Int_t CaloLevel0::Calibrate(Int_t ei){
1242    Int_t se = 5;    Int_t se = 5;
1243    Int_t done = 0;    Int_t done = 0;
1244    Int_t pre = -1;    Int_t pre = -1;
1245    Bool_t isCOMP = false;    //  Bool_t isCOMP = false;
1246    Bool_t isFULL = false;    //  Bool_t isFULL = false;
1247    Bool_t isRAW = false;    Bool_t isRAW = false;
1248    Float_t ener;    Float_t ener;
1249    Int_t doneb = 0;    Int_t doneb = 0;
# Line 1288  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1292  Int_t CaloLevel0::Calibrate(Int_t ei){
1292        //        //
1293        // determine what kind of event we are going to analyze        // determine what kind of event we are going to analyze
1294        //        //
1295        isCOMP = false;        //      isCOMP = false;
1296        isFULL = false;        //      isFULL = false;
1297        isRAW = false;        isRAW = false;
1298        if ( de->stwerr[se] & (1 << 16) ) isCOMP = true;        //      if ( de->stwerr[se] & (1 << 16) ) isCOMP = true;
1299        if ( de->stwerr[se] & (1 << 17) ) isFULL = true;        //      if ( de->stwerr[se] & (1 << 17) ) isFULL = true;
1300        if ( de->stwerr[se] & (1 << 3) ) isRAW = true;        if ( de->stwerr[se] & (1 << 3) ) isRAW = true;
1301        if ( !chdone[se] ){        if ( !chdone[se] ){
1302          //          //
# Line 1938  void CaloLevel0::FillTrkVar(CaloLevel2 * Line 1942  void CaloLevel0::FillTrkVar(CaloLevel2 *
1942    ClearTrkVar();    ClearTrkVar();
1943  }  }
1944    
1945    void CaloLevel0::FillTrkVar(TClonesArray *tcl, Int_t nutrk){
1946      //
1947      CaloTrkVar *t_ca = new CaloTrkVar();
1948      //
1949      t_ca->trkseqno = trkseqno;
1950      t_ca->ncore = (Int_t)clevel2->ncore;
1951      t_ca->qcore = clevel2->qcore;
1952      t_ca->noint = (Int_t)clevel2->noint;
1953      t_ca->ncyl = (Int_t)clevel2->ncyl;
1954      t_ca->qcyl = clevel2->qcyl;
1955      t_ca->qtrack = clevel2->qtrack;
1956      t_ca->qtrackx = clevel2->qtrackx;
1957      t_ca->qtracky = clevel2->qtracky;
1958      t_ca->dxtrack = clevel2->dxtrack;
1959      t_ca->dytrack = clevel2->dytrack;
1960      t_ca->qlast = clevel2->qlast;
1961      t_ca->nlast = (Int_t)clevel2->nlast;
1962      t_ca->qpre = clevel2->qpre;
1963      t_ca->npre = (Int_t)clevel2->npre;
1964      t_ca->qpresh = clevel2->qpresh;
1965      t_ca->npresh = (Int_t)clevel2->npresh;
1966      t_ca->qtr = clevel2->qtr;
1967      t_ca->ntr = (Int_t)clevel2->ntr;
1968      t_ca->planetot = (Int_t)clevel2->planetot;
1969      t_ca->qmean = clevel2->qmean;
1970      t_ca->dX0l = clevel2->dX0l;
1971      t_ca->qlow = clevel2->qlow;
1972      t_ca->nlow = (Int_t)clevel2->nlow;
1973      //
1974      memcpy(t_ca->tibar,clevel2->tibar,sizeof(clevel2->tibar));
1975      memcpy(t_ca->tbar,clevel2->tbar,sizeof(clevel2->tbar));
1976      //
1977      //
1978      TClonesArray &t = *tcl;
1979      new(t[nutrk]) CaloTrkVar(*t_ca);
1980      //
1981      delete t_ca;
1982      //
1983      ClearTrkVar();
1984    }
1985    
1986  void CaloLevel0::GetCommonVar(){  void CaloLevel0::GetCommonVar(){
1987    calol2cm();    calol2cm();
1988  }  }
# Line 1988  void CaloLevel0::FillCommonVar(CaloLevel Line 2033  void CaloLevel0::FillCommonVar(CaloLevel
2033    };    };
2034    //    //
2035  }  }
2036    void CaloLevel0::FillCommonVar(CaloLevel1 *c1){
2037      if ( c1 ){
2038        c1->istrip = istrip;
2039        c1->estrip = TArrayI(istrip,svstrip);
2040      };
2041      //
2042    }
2043    
2044  void CaloLevel0::ClearStructs(){  void CaloLevel0::ClearStructs(){
2045    ClearTrkVar();    ClearTrkVar();
# Line 2137  Int_t CaloLevel0::Update(GL_TABLES *glt, Line 2189  Int_t CaloLevel0::Update(GL_TABLES *glt,
2189    if ( !dbc->IsConnected() ) throw -116;    if ( !dbc->IsConnected() ) throw -116;
2190    stringstream myquery;    stringstream myquery;
2191    myquery.str("");    myquery.str("");
2192    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
2193    dbc->Query(myquery.str().c_str());    dbc->Query(myquery.str().c_str());
2194    Int_t sgnl = 0;    Int_t sgnl = 0;
2195    //    //

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.23