/[PAMELA software]/DarthVader/NDLevel2/src/NDCore.cpp
ViewVC logotype

Diff of /DarthVader/NDLevel2/src/NDCore.cpp

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

revision 1.5 by mocchiut, Tue Sep 5 14:49:42 2006 UTC revision 1.9 by mocchiut, Thu Jan 11 14:33:42 2007 UTC
# Line 116  int NDCore(UInt_t run, TFile *file, TSQL Line 116  int NDCore(UInt_t run, TFile *file, TSQL
116    Int_t code = 0;    Int_t code = 0;
117    Int_t sgnl;    Int_t sgnl;
118    //    //
119      Long64_t maxsize = 10000000000LL;  
120      TTree::SetMaxTreeSize(maxsize);
121      //
122      //
123    // ND level2 classes    // ND level2 classes
124    //    //
125    NDLevel2 *nd = new NDLevel2();    NDLevel2 *nd = new NDLevel2();
# Line 238  int NDCore(UInt_t run, TFile *file, TSQL Line 242  int NDCore(UInt_t run, TFile *file, TSQL
242      }      }
243    } else {    } else {
244      //      //
245        NDtrclone->SetAutoSave(900000000000000LL);
246        //
247      // tree exists, we are reprocessing data. Are we reprocessing a single run or all the file?      // tree exists, we are reprocessing data. Are we reprocessing a single run or all the file?
248      //      //
249      reproc = true;      reproc = true;
# Line 284  int NDCore(UInt_t run, TFile *file, TSQL Line 290  int NDCore(UInt_t run, TFile *file, TSQL
290    //    //
291    file->cd();    file->cd();
292    NDtr = new TTree("NeutronD-new","PAMELA Level2 NeutronD data");    NDtr = new TTree("NeutronD-new","PAMELA Level2 NeutronD data");
293      NDtr->SetAutoSave(900000000000000LL);
294    NDtr->Branch("NDLevel2","NDLevel2",&nd);    NDtr->Branch("NDLevel2","NDLevel2",&nd);
295    //    //
296    if ( reproc && !reprocall ){    if ( reproc && !reprocall ){
# Line 292  int NDCore(UInt_t run, TFile *file, TSQL Line 299  int NDCore(UInt_t run, TFile *file, TSQL
299      //      //
300      tempfile = new TFile(tempname.str().c_str(),"READ");      tempfile = new TFile(tempname.str().c_str(),"READ");
301      NDtrclone = (TTree*)tempfile->Get("NeutronD-old");      NDtrclone = (TTree*)tempfile->Get("NeutronD-old");
302        NDtrclone->SetAutoSave(900000000000000LL);
303      NDtrclone->SetBranchAddress("NDLevel2",&ndclone);      NDtrclone->SetBranchAddress("NDLevel2",&ndclone);
304      //            //      
305      if ( nobefrun > 0 ){      if ( nobefrun > 0 ){
# Line 360  int NDCore(UInt_t run, TFile *file, TSQL Line 368  int NDCore(UInt_t run, TFile *file, TSQL
368      //      //
369      // prepare the timesync for the db      // prepare the timesync for the db
370      //      //
371        if ( !dbc->IsConnected() ) throw -604;
372      dbtime = new GL_TIMESYNC(runinfo->ID_ROOT_L0,"ID",dbc);      dbtime = new GL_TIMESYNC(runinfo->ID_ROOT_L0,"ID",dbc);
373      //      //
374      // Search in the DB the path and name of the LEVEL0 file to be processed.      // Search in the DB the path and name of the LEVEL0 file to be processed.
375      //      //
376        if ( !dbc->IsConnected() ) throw -604;
377      glroot->Query_GL_ROOT(runinfo->ID_ROOT_L0,dbc);      glroot->Query_GL_ROOT(runinfo->ID_ROOT_L0,dbc);
378      //      //
379      ftmpname.str("");      ftmpname.str("");
# Line 461  int NDCore(UInt_t run, TFile *file, TSQL Line 471  int NDCore(UInt_t run, TFile *file, TSQL
471        //        //
472        l0ND->GetEntry(re);        l0ND->GetEntry(re);
473        tmpSize = l0ne->Records->GetEntries();        tmpSize = l0ne->Records->GetEntries();
474        if (!tmpSize) continue;        if ( tmpSize && l0ne->unpackError == 0 ){
475        if (l0ne->unpackError == 1) continue;          for (Int_t j = 0; j < tmpSize; j++){
476        for (Int_t j = 0; j < tmpSize; j++){            l0nr = (pamela::neutron::NeutronRecord*)l0ne->Records->At(j);
477          l0nr = (pamela::neutron::NeutronRecord*)l0ne->Records->At(j);            yTrig            = yTrig             + (float)l0nr->trigPhysics;
478          yTrig            = yTrig             + (float)l0nr->trigPhysics;            yUpperBackground  = yUpperBackground  + (float)l0nr->upperBack;
479          yUpperBackground  = yUpperBackground  + (float)l0nr->upperBack;            yBottomBackground = yBottomBackground + (float)l0nr->bottomBack;
480          yBottomBackground = yBottomBackground + (float)l0nr->bottomBack;          }
481        }          nd->upperBack = yUpperBackground;
482        nd->upperBack = yUpperBackground;          nd->bottomBack = yBottomBackground;
483        nd->bottomBack = yBottomBackground;          nd->trigPhysics = yTrig;            
484        nd->trigPhysics = yTrig;              };
485              //
486          nd->unpackError = l0ne->unpackError;
487          //
488        NDtr->Fill();        // Fill tree NDLevel2 in the root file        NDtr->Fill();        // Fill tree NDLevel2 in the root file
489          //
490        yUpperBackground =0;        yUpperBackground =0;
491        yBottomBackground =0;        yBottomBackground =0;
492        yTrig=0;              yTrig=0;      

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.23