/[PAMELA software]/PamelaLevel2/src/PamLevel2.cpp
ViewVC logotype

Diff of /PamelaLevel2/src/PamLevel2.cpp

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

revision 1.97 by pam-fi, Fri Oct 17 06:54:11 2014 UTC revision 1.110 by pam-fi, Tue Mar 24 09:15:01 2015 UTC
# Line 371  PamTrack::PamTrack(ExtTrack* t, CaloTrkV Line 371  PamTrack::PamTrack(ExtTrack* t, CaloTrkV
371    
372  }  }
373  ;  ;
374    
375  PamTrack::PamTrack(const PamTrack& track) {  PamTrack::PamTrack(const PamTrack& track) {
376    
377    TrkTrack *t = track.trk_track;    TrkTrack *t = track.trk_track;
# Line 400  PamTrack::PamTrack(const PamTrack& track Line 401  PamTrack::PamTrack(const PamTrack& track
401    iscore = 0;    iscore = 0;
402    
403  }  }
404    
405    void PamTrack::Copy( PamTrack& track) const {
406    
407        track.trk_track = trk_track;
408        track.trk_ext_track = trk_ext_track;
409        track.calo_track = calo_track;
410        track.tof_track = tof_track;
411        track.orb_track = orb_track;
412        
413        track.candeleteobj = candeleteobj;
414        track.pscore = pscore;
415        track.iscore = iscore;
416        
417    }
418    
419    
420    
421  void PamTrack::Clear(Option_t *option) {  void PamTrack::Clear(Option_t *option) {
422    
423  //    cout << "PamTrack::Clear( "<<option<<" ) "<<candeleteobj<<endl;  //    cout << "PamTrack::Clear( "<<option<<" ) "<<candeleteobj<<endl;
# Line 431  void PamTrack::Delete() { Line 449  void PamTrack::Delete() {
449    //    cout << "PamTrack::Delete() "<<candeleteobj<<endl;    //    cout << "PamTrack::Delete() "<<candeleteobj<<endl;
450    if (candeleteobj) {    if (candeleteobj) {
451      if (trk_ext_track) {      if (trk_ext_track) {
452        trk_ext_track->ExtTrack::Clear("C");  //      trk_ext_track->ExtTrack::Clear("C");//Clear is called for all the array elements
453            trk_ext_track->ExtTrack::Clear("C+C");//Clear is called for all the array elements passing option 'C'
454        delete trk_ext_track;        delete trk_ext_track;
455      }      }
456      if (trk_track) {      if (trk_track) {
# Line 566  void PamLevel2::Initialize() { Line 585  void PamLevel2::Initialize() {
585    
586    run_obj = 0;//new GL_RUN();    run_obj = 0;//new GL_RUN();
587    soft_obj = 0;// Emiliano    soft_obj = 0;// Emiliano
588      proc_obj = 0;// Emiliano
589    irun = -1LL;    irun = -1LL;
590    irunt = -1LL;    irunt = -1LL;
591    totrunentry = 0LL;    totrunentry = 0LL;
# Line 576  void PamLevel2::Initialize() { Line 596  void PamLevel2::Initialize() {
596    gltsync = 0; // Emiliano    gltsync = 0; // Emiliano
597    fUpdateRunInfo = true; // Emiliano    fUpdateRunInfo = true; // Emiliano
598    fUseDBinRunInfo = true; // Emiliano    fUseDBinRunInfo = true; // Emiliano
599      fDiscarded = false; //EM
600    isSync = false; // by default assume that the level2 file(s) is(are) not sinchronized between L0/DB and L2, that is we miss some packets in L2 due to nested/DV-skipped events    isSync = false; // by default assume that the level2 file(s) is(are) not sinchronized between L0/DB and L2, that is we miss some packets in L2 due to nested/DV-skipped events
601    il0entry = 0LL;    il0entry = 0LL;
602    //  hasL0EE = true;    //  hasL0EE = true;
# Line 591  void PamLevel2::Initialize() { Line 612  void PamLevel2::Initialize() {
612    
613    run_tree = NULL;    run_tree = NULL;
614    run_tree_clone = NULL;    run_tree_clone = NULL;
615    
616      proc_tree = NULL;
617      proc_tree_clone = NULL;
618    
619    sel_tree = NULL;    sel_tree = NULL;
620    sel_tree_clone = NULL;    sel_tree_clone = NULL;
621    
# Line 622  void PamLevel2::Initialize() { Line 647  void PamLevel2::Initialize() {
647    if (strcmp(pamdbpsw, ""))    if (strcmp(pamdbpsw, ""))
648      psw = pamdbpsw;      psw = pamdbpsw;
649    
650      customString = "";
651    
652    //    sorted_tracks = 0;//new TRefArray();    //    sorted_tracks = 0;//new TRefArray();
653    
654    CAL0 = false;    CAL0 = false;
# Line 638  void PamLevel2::Initialize() { Line 665  void PamLevel2::Initialize() {
665    ND = true;    ND = true;
666    AC = true;    AC = true;
667    ORB = true;    ORB = true;
668      PROC = true;
669    GP = false;    GP = false;
670    
671    EXT = false;    EXT = false;
# Line 680  void PamLevel2::Delete() { Line 708  void PamLevel2::Delete() {
708      delete run_obj;      delete run_obj;
709    if (soft_obj)    if (soft_obj)
710      delete soft_obj; //Emiliano      delete soft_obj; //Emiliano
711      if (proc_obj)
712        delete proc_obj; //Emiliano
713    
714    //    cout << "void PamLevel2::Clear()"<<endl;    //    cout << "void PamLevel2::Clear()"<<endl;
715    if (h0_obj)    if (h0_obj)
# Line 880  void PamLevel2::Clear() { Line 910  void PamLevel2::Clear() {
910      orb2_obj->Clear();      orb2_obj->Clear();
911    if (gp_obj)    if (gp_obj)
912      gp_obj->Clear();      gp_obj->Clear();
913      if (proc_obj)
914        proc_obj->Clear();
915    
916    //    if(sorted_tracks)sorted_tracks->Clear();    //    if(sorted_tracks)sorted_tracks->Clear();
917    //    sorted_tracks.Clear();    //    sorted_tracks.Clear();
# Line 960  void PamLevel2::Reset() { Line 992  void PamLevel2::Reset() {
992    if (sel_tree)    if (sel_tree)
993      sel_tree->Delete();;      sel_tree->Delete();;
994    sel_tree = NULL;    sel_tree = NULL;
995    
996      if (proc_tree)
997        proc_tree->Delete();
998      proc_tree = NULL;
999    //    //
1000    // Close file    // Close file
1001    //    //
# Line 983  void PamLevel2::Reset() { Line 1019  void PamLevel2::Reset() {
1019    ac_obj = 0;    ac_obj = 0;
1020    orb2_obj = 0;    orb2_obj = 0;
1021    gp_obj = 0;    gp_obj = 0;
1022      proc_obj = 0;
1023    
1024    trk_ext_obj     = 0;    trk_ext_obj     = 0;
1025    trk_ext_nuc_obj = 0;    trk_ext_nuc_obj = 0;
# Line 1014  void PamLevel2::Reset() { Line 1051  void PamLevel2::Reset() {
1051    //    //
1052    run_obj = 0;//new GL_RUN();    run_obj = 0;//new GL_RUN();
1053    soft_obj = 0;// Emiliano    soft_obj = 0;// Emiliano
1054      proc_obj = 0;// Emiliano
1055    irun = -1;    irun = -1;
1056    irunt = -1;    irunt = -1;
1057    totrunentry = 0LL;    totrunentry = 0LL;
# Line 1188  void *PamLevel2::GetPointerTo(const char Line 1226  void *PamLevel2::GetPointerTo(const char
1226    if (!objname.CompareTo("SoftInfo"))    if (!objname.CompareTo("SoftInfo"))
1227      return &soft_obj; // Emiliano      return &soft_obj; // Emiliano
1228    
1229      if (!objname.CompareTo("ProcInfo")){
1230        if (!proc_obj)
1231          proc_obj = new ProcInfo();    
1232        return &proc_obj; // Emiliano
1233      }
1234    
1235    return NULL;    return NULL;
1236  }  }
1237  ;  ;
# Line 1205  CaloTrkVar *PamLevel2::GetCaloStoredTrac Line 1249  CaloTrkVar *PamLevel2::GetCaloStoredTrac
1249      return 0;      return 0;
1250    
1251    if (calo2_obj->CaloLevel2::ntrk() == 0) {    if (calo2_obj->CaloLevel2::ntrk() == 0) {
1252      cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno        if( seqno >=0 ){
1253          << " but no Calorimeter tracks are stored" << endl;            cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno;
1254      return NULL;            cout << " but no Calorimeter tracks are stored" << endl;
1255          }
1256          return NULL;
1257    };    };
1258    
1259    CaloTrkVar *c = 0;    CaloTrkVar *c = 0;
# Line 1220  CaloTrkVar *PamLevel2::GetCaloStoredTrac Line 1266  CaloTrkVar *PamLevel2::GetCaloStoredTrac
1266    
1267    if (!c || seqno != c->trkseqno) {    if (!c || seqno != c->trkseqno) {
1268      c = 0;      c = 0;
1269      if (seqno != -1)      if (seqno != -1 && seqno>=0)
1270        cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno        cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno
1271            << " does not match Calorimeter stored tracks" << endl;            << " does not match Calorimeter stored tracks" << endl;
1272    };    };
# Line 1339  OrbitalInfoTrkVar *PamLevel2::GetOrbital Line 1385  OrbitalInfoTrkVar *PamLevel2::GetOrbital
1385  //  //
1386  //  //
1387  //--------------------------------------  //--------------------------------------
1388  /**  // /**
1389   * Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information.  //  * Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information.
1390   */  //  */
1391  PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t) {  // PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t) {
1392    
1393    cout << "PamLevel2::GetPamTrackAlong(TrkTrack* t) **obsolete** " << endl;  //   cout << "PamLevel2::GetPamTrackAlong(TrkTrack* t) **obsolete** " << endl;
1394    cout << "(if you use it, remember to delete the PamTrack object)" << endl;  //   cout << "(if you use it, remember to delete the PamTrack object)" << endl;
1395    
1396    CaloTrkVar *c = 0;  //   CaloTrkVar *c = 0;
1397    ToFTrkVar *o = 0;  //   ToFTrkVar *o = 0;
1398    OrbitalInfoTrkVar *r = 0;  //   OrbitalInfoTrkVar *r = 0;
1399    
1400    //   if (CAL2)
1401    //     c = GetCaloStoredTrack(t->GetSeqNo());
1402    //   if (TOF)
1403    //     o = GetToFStoredTrack(t->GetSeqNo());
1404    //   if (ORB)
1405    //     r = GetOrbitalInfoStoredTrack(t->GetSeqNo());
1406    
1407    if (CAL2)  //   //    if(t && c && o)track = new PamTrack(t,c,o);
1408      c = GetCaloStoredTrack(t->GetSeqNo());  //   PamTrack *track = new PamTrack(t, c, o, r);
   if (TOF)  
     o = GetToFStoredTrack(t->GetSeqNo());  
   if (ORB)  
     r = GetOrbitalInfoStoredTrack(t->GetSeqNo());  
1409    
1410    //    if(t && c && o)track = new PamTrack(t,c,o);  //   return track;
   PamTrack *track = new PamTrack(t, c, o, r);  
   
   return track;  
1411    
1412  }  // }
1413  ;  // ;
1414  //--------------------------------------  //--------------------------------------
1415  //  //
1416  //  //
1417  //--------------------------------------  //--------------------------------------
1418  /**  // /**
1419   * Retrieves the it-th stored track.  //  * Retrieves the it-th stored track.
1420   * It override TrkLevel2::GetTrack(int it).  //  * It override TrkLevel2::GetTrack(int it).
1421   * @param itrk Track number, ranging from 0 to GetNTracks().  //  * @param itrk Track number, ranging from 0 to GetNTracks().
1422   */  //  */
1423    
1424    // PamTrack* PamLevel2::GetStoredTrack(Int_t itrk) {
1425    
1426    //   cout << "PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** " << endl;
1427    //   cout
1428    //       << "for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack) OrbitalInfo::GetOrbitalInfoTrkVar(Int_t notrack)"
1429    //       << endl;
1430    //   cout << "(if you use it, remember to delete the PamTrack object)" << endl;
1431    //   PamTrack *track = 0;
1432    
1433  PamTrack* PamLevel2::GetStoredTrack(Int_t itrk) {  //   if (itrk >= 0 && itrk < trk2_obj->TrkLevel2::ntrk()) {
1434    
1435    cout << "PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** " << endl;  //     TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(itrk);
1436    cout  //     track = GetPamTrackAlong(t);
       << "for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack) OrbitalInfo::GetOrbitalInfoTrkVar(Int_t notrack)"  
       << endl;  
   cout << "(if you use it, remember to delete the PamTrack object)" << endl;  
   PamTrack *track = 0;  
1437    
1438    if (itrk >= 0 && itrk < trk2_obj->TrkLevel2::ntrk()) {  //   }
1439    //   else {
1440      TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(itrk);  //     cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo " << itrk << " does not exist (GetNTracks() = "
1441      track = GetPamTrackAlong(t);  //         << trk2_obj->TrkLevel2::GetNTracks() << ")" << endl;
1442    //   };
   }  
   else {  
     cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo " << itrk << " does not exist (GetNTracks() = "  
         << trk2_obj->TrkLevel2::GetNTracks() << ")" << endl;  
   };  
1443    
1444    return track;  //   return track;
1445    
1446  }  // }
1447  //--------------------------------------  //--------------------------------------
1448  //  //
1449    
# Line 1451  void PamLevel2::SortTracks() { Line 1497  void PamLevel2::SortTracks() {
1497    Int_t ObjectNumber = TProcessID::GetObjectCount();    Int_t ObjectNumber = TProcessID::GetObjectCount();
1498    
1499    // create TCloneArrays to store tracks and its images    // create TCloneArrays to store tracks and its images
1500    if (!tsorted)  //   if (!tsorted)
1501      tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks());  //     tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks());
1502    tsorted->Clear("C+C");//Delete();  //   tsorted->Clear("C+C");//Delete();
1503    TClonesArray &ttsorted = *tsorted;  //   if (!timage)
1504    //     timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks());
1505    //   timage->Clear("C+C");//Delete();
1506    
1507    if (!timage)    if(tsorted)delete tsorted;
1508      timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks());    if(timage) delete timage;
1509    timage->Clear("C+C");//Delete();    tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks());
1510      timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks());
1511    
1512    
1513      TClonesArray &ttsorted = *tsorted;
1514    TClonesArray &ttimage = *timage;    TClonesArray &ttimage = *timage;
1515    
1516    
# Line 2637  PamTrack *PamLevel2::GetTrackOld(int it) Line 2689  PamTrack *PamLevel2::GetTrackOld(int it)
2689    //  *-*-*-*-*-*-*-*-*-*-*-*-*    //  *-*-*-*-*-*-*-*-*-*-*-*-*
2690    if (!tsorted)    if (!tsorted)
2691      return track;      return track;
2692    if (!tsorted->GetEntries())  //   if (!tsorted->GetEntries())
2693    //     return track;
2694      if (tsorted->GetEntries()==0)
2695      return track;      return track;
2696    
2697    
2698    if (it >= 0 && it < trk2_obj->TrkLevel2::GetNTracks()) {    if (
2699      track = (PamTrack*)((*tsorted)[it]);        tsorted &&
2700          it >= 0 &&
2701          it < trk2_obj->TrkLevel2::GetNTracks() &&
2702          it < tsorted->GetEntries() &&
2703          true) {
2704          track = (PamTrack*)((*tsorted)[it]);
2705    }    }
2706    else {    else {
2707      cout << "PamLevel2::GetTrackOld(int) : tracker track SeqNo " << it << " does not exist (GetNTracks() = "      cout << "PamLevel2::GetTrackOld(int) : tracker track SeqNo " << it << " does not exist (GetNTracks() = "
# Line 2843  PamTrack *PamLevel2::GetTrackImage(int i Line 2902  PamTrack *PamLevel2::GetTrackImage(int i
2902    
2903      }      }
2904    
2905      cout << "PamTrack *PamLevel2::GetTrackImage("<<it<<","<<alg<<") -- wrong track number or unrecognised algorithm"<<endl;  //    cout << "PamTrack *PamLevel2::GetTrackImage("<<it<<","<<alg<<") -- wrong track number or unrecognised algorithm"<<endl;
2906                
2907      return NULL;      return NULL;
2908    
# Line 3303  TChain *PamLevel2::GetPamTree(TList *fl, Line 3362  TChain *PamLevel2::GetPamTree(TList *fl,
3362    TChain *G = 0;    TChain *G = 0;
3363    
3364    TChain *L = 0;    TChain *L = 0;
3365      TChain *P = 0;
3366    
3367    if (TRK2 || TRK1 || TRKh)    if (TRK2 || TRK1 || TRKh)
3368      T = new TChain("Tracker");      T = new TChain("Tracker");
# Line 3322  TChain *PamLevel2::GetPamTree(TList *fl, Line 3382  TChain *PamLevel2::GetPamTree(TList *fl,
3382      B = new TChain("OrbitalInfo");      B = new TChain("OrbitalInfo");
3383    if (GP)    if (GP)
3384      G = new TChain("h20");      G = new TChain("h20");
3385      if (PROC)
3386        P = new TChain("ProcessingInfo");
3387    L = new TChain("SelectionList");    L = new TChain("SelectionList");
3388    
3389    // loop over files and create chains    // loop over files and create chains
# Line 3349  TChain *PamLevel2::GetPamTree(TList *fl, Line 3411  TChain *PamLevel2::GetPamTree(TList *fl,
3411          B->Add(name);          B->Add(name);
3412        if (GP)        if (GP)
3413          G->Add(name);          G->Add(name);
3414          if (P)
3415            P->Add(name);
3416        if (SELLI == 1)        if (SELLI == 1)
3417          L->Add(name);          L->Add(name);
3418       };       };
# Line 3474  TChain *PamLevel2::GetPamTree(TList *fl, Line 3538  TChain *PamLevel2::GetPamTree(TList *fl,
3538        L->Delete();        L->Delete();
3539    };    };
3540    
3541      //ProcessingInfo EM
3542      if ( P && P->GetEntries() ){
3543        cout << "----------------------------------------------------" << endl;
3544        cout << ">>> Found ProcessingInfo <<<" << endl;
3545        //  L->SetBranchAddress("RunEntry",&irun);
3546        P->SetBranchAddress("ProcInfo", &proc_obj);//NEWNEW
3547        proc_tree = P;
3548      } else {
3549        //    proc_tree = new TChain("ProcessingInfo","Log of data processing");
3550        //    proc_tree->Branch("ProcInfo", "ProcInfo", &proc_obj);
3551        cout << "----------------------------------------------------" << endl;
3552        cout << ">>> ProcessingInfo not found, PROC set to false and continue (not 10RED files?)<<<" << endl;
3553        PROC = false;
3554      }
3555    //  --------------------------------------------    //  --------------------------------------------
3556    //  return the pamela chain with all the friends    //  return the pamela chain with all the friends
3557    //  --------------------------------------------    //  --------------------------------------------
3558    
3559    pam_tree = Trout;    pam_tree = Trout;
   
3560    return Trout;    return Trout;
3561  }  }
3562    
# Line 4571  void PamLevel2::GetWhichTrees(TFile* f) Line 4648  void PamLevel2::GetWhichTrees(TFile* f)
4648    //    cout << "Checking file: "<<f->GetName()<<endl;    //    cout << "Checking file: "<<f->GetName()<<endl;
4649    if (!f || f->IsZombie()) {    if (!f || f->IsZombie()) {
4650      cout << "File: " << f->GetName() << " Non valid root file" << endl;      cout << "File: " << f->GetName() << " Non valid root file" << endl;
4651        fDiscarded = true;
4652      return;      return;
4653    }    }
4654    
# Line 4777  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4855  Bool_t PamLevel2::CheckLevel2File(TStrin
4855    TFile *f = new TFile(name.Data());    TFile *f = new TFile(name.Data());
4856    if (!f || f->IsZombie()) {    if (!f || f->IsZombie()) {
4857      cout << "File: " << f->GetName() << " discarded ---- Non valid root file" << endl;      cout << "File: " << f->GetName() << " discarded ---- Non valid root file" << endl;
4858        fDiscarded = true;
4859      return false;      return false;
4860    }    }
4861    //    cout << "Get list of keys: "<<f<<endl;    //    cout << "Get list of keys: "<<f<<endl;
# Line 4815  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4894  Bool_t PamLevel2::CheckLevel2File(TStrin
4894          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4895            cout << "File: " << f->GetName() << " discarded ---- SelectionList tree has " << nevt            cout << "File: " << f->GetName() << " discarded ---- SelectionList tree has " << nevt
4896                << " events instead of " << nev << endl;                << " events instead of " << nev << endl;
4897              fDiscarded = true;
4898            return false;            return false;
4899          }          }
4900          nev = nevt;          nev = nevt;
# Line 4829  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4909  Bool_t PamLevel2::CheckLevel2File(TStrin
4909          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4910            cout << "File: " << f->GetName() << " discarded ---- Trigger tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- Trigger tree has " << nevt << " events instead of "
4911                << nev << endl;                << nev << endl;
4912              fDiscarded = true;
4913            return false;            return false;
4914          }          }
4915          nev = nevt;          nev = nevt;
# Line 4842  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4923  Bool_t PamLevel2::CheckLevel2File(TStrin
4923          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4924            cout << "File: " << f->GetName() << " discarded ---- ToF tree has " << nevt << " events instead of " << nev            cout << "File: " << f->GetName() << " discarded ---- ToF tree has " << nevt << " events instead of " << nev
4925                << endl;                << endl;
4926              fDiscarded = true;
4927            return false;            return false;
4928          }          }
4929          nev = nevt;          nev = nevt;
# Line 4855  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4937  Bool_t PamLevel2::CheckLevel2File(TStrin
4937          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4938            cout << "File: " << f->GetName() << " discarded ---- S4 tree has " << nevt << " events instead of " << nev            cout << "File: " << f->GetName() << " discarded ---- S4 tree has " << nevt << " events instead of " << nev
4939                << endl;                << endl;
4940              fDiscarded = true;
4941            return false;            return false;
4942          }          }
4943          nev = nevt;          nev = nevt;
# Line 4869  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4952  Bool_t PamLevel2::CheckLevel2File(TStrin
4952          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4953            cout << "File: " << f->GetName() << " discarded ---- NeutronD tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- NeutronD tree has " << nevt << " events instead of "
4954                << nev << endl;                << nev << endl;
4955              fDiscarded = true;
4956            return false;            return false;
4957          }          }
4958          nev = nevt;          nev = nevt;
# Line 4882  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4966  Bool_t PamLevel2::CheckLevel2File(TStrin
4966          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4967            cout << "File: " << f->GetName() << " discarded ---- Anticounter tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- Anticounter tree has " << nevt << " events instead of "
4968                << nev << endl;                << nev << endl;
4969              fDiscarded = true;
4970            return false;            return false;
4971          }          }
4972          nev = nevt;          nev = nevt;
# Line 4895  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4980  Bool_t PamLevel2::CheckLevel2File(TStrin
4980          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4981            cout << "File: " << f->GetName() << " discarded ---- OrbitalInfo tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- OrbitalInfo tree has " << nevt << " events instead of "
4982                << nev << endl;                << nev << endl;
4983              fDiscarded = true;
4984            return false;            return false;
4985          }          }
4986          nev = nevt;          nev = nevt;
# Line 4908  Bool_t PamLevel2::CheckLevel2File(TStrin Line 4994  Bool_t PamLevel2::CheckLevel2File(TStrin
4994          if (nev && nevt != nev) {          if (nev && nevt != nev) {
4995            cout << "File: " << f->GetName() << " discarded ---- Tracker tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- Tracker tree has " << nevt << " events instead of "
4996                << nev << endl;                << nev << endl;
4997              fDiscarded = true;
4998            return false;            return false;
4999          }          }
5000          nev = nevt;          nev = nevt;
# Line 4931  Bool_t PamLevel2::CheckLevel2File(TStrin Line 5018  Bool_t PamLevel2::CheckLevel2File(TStrin
5018          if (nev && nevt != nev) {          if (nev && nevt != nev) {
5019            cout << "File: " << f->GetName() << " discarded ---- Calorimeter tree has " << nevt << " events instead of "            cout << "File: " << f->GetName() << " discarded ---- Calorimeter tree has " << nevt << " events instead of "
5020                << nev << endl;                << nev << endl;
5021              fDiscarded = true;
5022            return false;            return false;
5023          }          }
5024          nev = nevt;          nev = nevt;
# Line 4953  Bool_t PamLevel2::CheckLevel2File(TStrin Line 5041  Bool_t PamLevel2::CheckLevel2File(TStrin
5041          if (nev && nevt != nev) {          if (nev && nevt != nev) {
5042            cout << "File: " << f->GetName() << " discarded ---- h20 tree has " << nevt << " events instead of " << nev            cout << "File: " << f->GetName() << " discarded ---- h20 tree has " << nevt << " events instead of " << nev
5043                << endl;                << endl;
5044              fDiscarded = true;
5045            return false;            return false;
5046          }          }
5047          nev = nevt;          nev = nevt;
# Line 4965  Bool_t PamLevel2::CheckLevel2File(TStrin Line 5054  Bool_t PamLevel2::CheckLevel2File(TStrin
5054      SELLI = (Int_t) SELLI__ok;      SELLI = (Int_t) SELLI__ok;
5055    if (SELLI == 0 && SELLI__ok) {    if (SELLI == 0 && SELLI__ok) {
5056      cout << "File: " << f->GetName() << " discarded ---- found SelectionList (it is not a full-event file)" << endl;      cout << "File: " << f->GetName() << " discarded ---- found SelectionList (it is not a full-event file)" << endl;
5057        fDiscarded = true;
5058      return false;      return false;
5059    }    }
5060    if (SELLI == 1 && !SELLI__ok) {    if (SELLI == 1 && !SELLI__ok) {
5061      cout << "File: " << f->GetName() << " discarded ---- SelectionList missing" << endl;      cout << "File: " << f->GetName() << " discarded ---- SelectionList missing" << endl;
5062        fDiscarded = true;
5063      return false;      return false;
5064    }    }
5065    
# Line 5007  Bool_t PamLevel2::CheckLevel2File(TStrin Line 5098  Bool_t PamLevel2::CheckLevel2File(TStrin
5098    
5099    if (CAL1 && !CAL1__ok) {    if (CAL1 && !CAL1__ok) {
5100      cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel1 branch" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel1 branch" << endl;
5101        fDiscarded = true;
5102      return false;      return false;
5103    };    };
5104    if (CAL2 && !CAL2__ok) {    if (CAL2 && !CAL2__ok) {
5105      cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel2 branch" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel2 branch" << endl;
5106        fDiscarded = true;
5107      return false;      return false;
5108    };    };
5109    if (TRK2 && !TRK2__ok) {    if (TRK2 && !TRK2__ok) {
5110      cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel2 branch" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel2 branch" << endl;
5111        fDiscarded = true;
5112      return false;      return false;
5113    };    };
5114    if (TRK1 && !TRK1__ok) {    if (TRK1 && !TRK1__ok) {
5115      cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel1 branch" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel1 branch" << endl;
5116        fDiscarded = true;
5117      return false;      return false;
5118    };    };
5119    if (TRKh && !TRKh__ok) {    if (TRKh && !TRKh__ok) {
5120      cout << "File: " << f->GetName() << " discarded ---- Missing TrkHough branch" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing TrkHough branch" << endl;
5121        fDiscarded = true;
5122      return false;      return false;
5123    };    };
5124    if (ORB && !ORB__ok) {    if (ORB && !ORB__ok) {
5125      cout << "File: " << f->GetName() << " discarded ---- Missing ORB tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing ORB tree" << endl;
5126        fDiscarded = true;
5127      return false;      return false;
5128    };    };
5129    if (AC && !AC__ok) {    if (AC && !AC__ok) {
5130      cout << "File: " << f->GetName() << " discarded ---- Missing AC tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing AC tree" << endl;
5131        fDiscarded = true;
5132      return false;      return false;
5133    };    };
5134    if (S4 && !S4__ok) {    if (S4 && !S4__ok) {
5135      cout << "File: " << f->GetName() << " discarded ---- Missing S4 tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing S4 tree" << endl;
5136        fDiscarded = true;
5137      return false;      return false;
5138    };    };
5139    if (TOF && !TOF__ok) {    if (TOF && !TOF__ok) {
5140      cout << "File: " << f->GetName() << " discarded ---- Missing ToF tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing ToF tree" << endl;
5141        fDiscarded = true;
5142      return false;      return false;
5143    };    };
5144    
5145    if (ND && !ND__ok) {    if (ND && !ND__ok) {
5146      cout << "File: " << f->GetName() << " discarded ---- Missing ND tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing ND tree" << endl;
5147        fDiscarded = true;
5148      return false;      return false;
5149    };    };
5150    if (TRG && !TRG__ok) {    if (TRG && !TRG__ok) {
5151      cout << "File: " << f->GetName() << " discarded ---- Missing Trigger tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing Trigger tree" << endl;
5152        fDiscarded = true;
5153      return false;      return false;
5154    };    };
5155    if (GP && !GP__ok) {    if (GP && !GP__ok) {
5156      cout << "File: " << f->GetName() << " discarded ---- Missing h20 tree" << endl;      cout << "File: " << f->GetName() << " discarded ---- Missing h20 tree" << endl;
5157        fDiscarded = true;
5158      return false;      return false;
5159    };    };
5160    
# Line 5151  void PamLevel2::CreateCloneTrees(TFile * Line 5254  void PamLevel2::CreateCloneTrees(TFile *
5254      //  cout << i<< "\t | "<<GetRunInfo()->ID<<"\t "<<GetRunInfo()->NEVENTS<< "\t "<<GetRunInfo()->RUNHEADER_TIME<<" <---> "<<GetRunInfo()->RUNTRAILER_TIME<<endl;      //  cout << i<< "\t | "<<GetRunInfo()->ID<<"\t "<<GetRunInfo()->NEVENTS<< "\t "<<GetRunInfo()->RUNHEADER_TIME<<" <---> "<<GetRunInfo()->RUNTRAILER_TIME<<endl;
5255      run_tree_clone->Fill();      run_tree_clone->Fill();
5256    }    }
5257    cout << "----------------------------------------------------" << endl;    //
5258      // replicate processinginfo tree
5259      //
5260      if ( PROC ){ // EMEMEM
5261        proc_tree_clone = new TTree("ProcessingInfo","Log of data processing");
5262        proc_tree_clone->Branch("ProcInfo", "ProcInfo", GetPointerTo("ProcInfo"));
5263        cout << "ProcessingInfo: branch ProcessingInfo" << endl;  
5264        // ------------------
5265        // replicate processinginfo tree
5266        // ------------------
5267        //    cout << "----------------------------------------------------"<<endl;
5268        //    cout << "irun\t | RUN\t NEVENTS\t absolute time"<<endl;
5269        for (Int_t i = 0; i < proc_tree->GetEntries(); i++) {
5270          proc_tree->GetEntry(i);
5271          //      cout << i<< "\t | "<<endl;
5272          proc_tree_clone->Fill();
5273        }
5274        if ( SELLI != 2 ){      
5275          proc_obj->runID = 0;
5276          TTimeStamp *dt = new TTimeStamp();
5277          proc_obj->date = dt->AsString();
5278          delete dt;
5279          proc_obj->commandLine = Form("PamelaLevel2 was called: CAL2 %i CAL1 %i CAL0 %i TRK2 %i TRK1 %i TRKh %i TRK0 %i TOF %i TOF0 %i TRG %i \n                                            S4 %i ND %i AC %i ORB %i GP %i EXT %i NUC %i RUN %i ISGP %i SELLI %i \n Custom string   = %s",CAL2,CAL1,CAL0,TRK2,TRK1,TRKh,TRK0,TOF,TOF0,TRG,S4,ND,AC,ORB,GP,EXT,NUC,RUN,ISGP,SELLI,customString.Data());
5280          proc_obj->outputFilename = ofile->GetName();
5281          proc_obj->localDir = gSystem->WorkingDirectory();
5282          proc_obj->uname = gSystem->GetFromPipe("uname -a");
5283          if (!dbc || (dbc && !dbc->IsConnected())) SetDBConnection();
5284          proc_obj->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB());
5285          dbc->Close();
5286          proc_tree_clone->Fill();
5287        }
5288        cout << "----------------------------------------------------" << endl;
5289      }
5290    // ------------------------------------    // ------------------------------------
5291    // add branch with dead and live times    // add branch with dead and live times
5292    // ------------------------------------    // ------------------------------------
# Line 5343  TTree* PamLevel2::GetCloneTree(TString n Line 5477  TTree* PamLevel2::GetCloneTree(TString n
5477      if (!name.CompareTo(na))      if (!name.CompareTo(na))
5478        return sel_tree_clone;        return sel_tree_clone;
5479    }    }
5480      if (proc_tree_clone && PROC) {
5481        TString na = proc_tree_clone->GetName();
5482        if (!name.CompareTo(na))
5483          return proc_tree_clone;
5484      }
5485    return NULL;    return NULL;
5486    
5487  }  }
# Line 5362  void PamLevel2::WriteCloneTrees() { Line 5501  void PamLevel2::WriteCloneTrees() {
5501    for (Int_t i = 0; i < NCLONES; i++) {    for (Int_t i = 0; i < NCLONES; i++) {
5502      if (pam_tree_clone[i]) {      if (pam_tree_clone[i]) {
5503        cout << pam_tree_clone[i]->GetName() << endl;        cout << pam_tree_clone[i]->GetName() << endl;
5504        pam_tree_clone[i]->Write();        pam_tree_clone[i]->Write(pam_tree_clone[i]->GetName(),TObject::kOverwrite);
5505      };      };
5506    }    }
5507      
5508      if ( PROC ){//EMEMEMEM
5509        proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite);
5510      }
5511    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;
5512    
5513  }  }

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.110

  ViewVC Help
Powered by ViewVC 1.1.23