--- PamelaLevel2/src/PamLevel2.cpp 2014/10/15 08:51:51 1.95 +++ PamelaLevel2/src/PamLevel2.cpp 2015/11/02 09:59:54 1.112 @@ -315,17 +315,34 @@ // candeleteobj = 0; +// cout << t<<"--"<ExtTrack::Clear(); + trk_ext_track->ExtTrack::Clear(option); if (trk_track) trk_track->TrkTrack::Clear(); if (calo_track) @@ -426,7 +483,8 @@ // cout << "PamTrack::Delete() "<ExtTrack::Clear(); +// trk_ext_track->ExtTrack::Clear("C");//Clear is called for all the array elements + trk_ext_track->ExtTrack::Clear("C+C");//Clear is called for all the array elements passing option 'C' delete trk_ext_track; } if (trk_track) { @@ -561,6 +619,7 @@ run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1LL; irunt = -1LL; totrunentry = 0LL; @@ -571,6 +630,7 @@ gltsync = 0; // Emiliano fUpdateRunInfo = true; // Emiliano fUseDBinRunInfo = true; // Emiliano + fDiscarded = false; //EM 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 il0entry = 0LL; // hasL0EE = true; @@ -586,6 +646,10 @@ run_tree = NULL; run_tree_clone = NULL; + + proc_tree = NULL; + proc_tree_clone = NULL; + sel_tree = NULL; sel_tree_clone = NULL; @@ -617,6 +681,8 @@ if (strcmp(pamdbpsw, "")) psw = pamdbpsw; + customString = ""; + // sorted_tracks = 0;//new TRefArray(); CAL0 = false; @@ -633,11 +699,12 @@ ND = true; AC = true; ORB = true; + PROC = true; GP = false; EXT = false; NUC = false; - trkAlg = "";//default tracking algorythm + trkAlg = "STD";//default tracking algorythm RUN = true; @@ -675,6 +742,8 @@ delete run_obj; if (soft_obj) delete soft_obj; //Emiliano + if (proc_obj) + delete proc_obj; //Emiliano // cout << "void PamLevel2::Clear()"<Clear(); if (gp_obj) gp_obj->Clear(); + if (proc_obj) + proc_obj->Clear(); // if(sorted_tracks)sorted_tracks->Clear(); // sorted_tracks.Clear(); @@ -955,6 +1026,10 @@ if (sel_tree) sel_tree->Delete();; sel_tree = NULL; + + if (proc_tree) + proc_tree->Delete(); + proc_tree = NULL; // // Close file // @@ -978,6 +1053,7 @@ ac_obj = 0; orb2_obj = 0; gp_obj = 0; + proc_obj = 0; trk_ext_obj = 0; trk_ext_nuc_obj = 0; @@ -1009,6 +1085,7 @@ // run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1; irunt = -1; totrunentry = 0LL; @@ -1183,6 +1260,12 @@ if (!objname.CompareTo("SoftInfo")) return &soft_obj; // Emiliano + if (!objname.CompareTo("ProcInfo")){ + if (!proc_obj) + proc_obj = new ProcInfo(); + return &proc_obj; // Emiliano + } + return NULL; } ; @@ -1200,9 +1283,11 @@ return 0; if (calo2_obj->CaloLevel2::ntrk() == 0) { - cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno - << " but no Calorimeter tracks are stored" << endl; - return NULL; + if( seqno >=0 ){ + cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno; + cout << " but no Calorimeter tracks are stored" << endl; + } + return NULL; }; CaloTrkVar *c = 0; @@ -1215,7 +1300,7 @@ if (!c || seqno != c->trkseqno) { c = 0; - if (seqno != -1) + if (seqno != -1 && seqno>=0) cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo " << seqno << " does not match Calorimeter stored tracks" << endl; }; @@ -1334,65 +1419,65 @@ // // //-------------------------------------- -/** - * Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information. - */ -PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t) { - - cout << "PamLevel2::GetPamTrackAlong(TrkTrack* t) **obsolete** " << endl; - cout << "(if you use it, remember to delete the PamTrack object)" << endl; - - CaloTrkVar *c = 0; - ToFTrkVar *o = 0; - OrbitalInfoTrkVar *r = 0; +// /** +// * Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information. +// */ +// PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t) { + +// cout << "PamLevel2::GetPamTrackAlong(TrkTrack* t) **obsolete** " << endl; +// cout << "(if you use it, remember to delete the PamTrack object)" << endl; + +// CaloTrkVar *c = 0; +// ToFTrkVar *o = 0; +// OrbitalInfoTrkVar *r = 0; + +// if (CAL2) +// c = GetCaloStoredTrack(t->GetSeqNo()); +// if (TOF) +// o = GetToFStoredTrack(t->GetSeqNo()); +// if (ORB) +// r = GetOrbitalInfoStoredTrack(t->GetSeqNo()); - if (CAL2) - c = GetCaloStoredTrack(t->GetSeqNo()); - if (TOF) - o = GetToFStoredTrack(t->GetSeqNo()); - if (ORB) - r = GetOrbitalInfoStoredTrack(t->GetSeqNo()); +// // if(t && c && o)track = new PamTrack(t,c,o); +// PamTrack *track = new PamTrack(t, c, o, r); - // if(t && c && o)track = new PamTrack(t,c,o); - PamTrack *track = new PamTrack(t, c, o, r); +// return track; - return track; - -} -; +// } +// ; //-------------------------------------- // // //-------------------------------------- -/** - * Retrieves the it-th stored track. - * It override TrkLevel2::GetTrack(int it). - * @param itrk Track number, ranging from 0 to GetNTracks(). - */ +// /** +// * Retrieves the it-th stored track. +// * It override TrkLevel2::GetTrack(int it). +// * @param itrk Track number, ranging from 0 to GetNTracks(). +// */ + +// PamTrack* PamLevel2::GetStoredTrack(Int_t itrk) { + +// cout << "PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** " << endl; +// cout +// << "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; -PamTrack* PamLevel2::GetStoredTrack(Int_t itrk) { +// if (itrk >= 0 && itrk < trk2_obj->TrkLevel2::ntrk()) { - cout << "PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** " << endl; - cout - << "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; +// TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(itrk); +// track = GetPamTrackAlong(t); - if (itrk >= 0 && itrk < trk2_obj->TrkLevel2::ntrk()) { - - TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(itrk); - track = GetPamTrackAlong(t); - - } - else { - cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo " << itrk << " does not exist (GetNTracks() = " - << trk2_obj->TrkLevel2::GetNTracks() << ")" << endl; - }; +// } +// else { +// cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo " << itrk << " does not exist (GetNTracks() = " +// << trk2_obj->TrkLevel2::GetNTracks() << ")" << endl; +// }; - return track; +// return track; -} +// } //-------------------------------------- // @@ -1446,14 +1531,20 @@ Int_t ObjectNumber = TProcessID::GetObjectCount(); // create TCloneArrays to store tracks and its images - if (!tsorted) - tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); - tsorted->Delete(); - TClonesArray &ttsorted = *tsorted; +// if (!tsorted) +// tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); +// tsorted->Clear("C+C");//Delete(); +// if (!timage) +// timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); +// timage->Clear("C+C");//Delete(); + + if(tsorted)delete tsorted; + if(timage) delete timage; + tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); + timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); - if (!timage) - timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); - timage->Delete(); + + TClonesArray &ttsorted = *tsorted; TClonesArray &ttimage = *timage; @@ -1895,6 +1986,9 @@ // cout<<"o "<GetNTracks()); - tsorted->Delete(); - // track images from standard alg - if (!timage) - timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); - timage->Delete(); - // tracks from extended algorythm - if(EXT && !text) - text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); - if(text)text->Delete(); +// if (!tsorted) +// tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); +// tsorted->Clear("C+C");//Delete(); +// // track images from standard alg +// if (!timage) +// timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); +// timage->Clear("C+C");//Delete(); +// // tracks from extended algorythm +// if(EXT && !text) +// text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); +// if(text)text->Clear("C+C");//Delete(); + + if(tsorted)delete tsorted; + if(timage) delete timage; + if(text) delete text; + tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); + timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); + text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); //----------------------------------------------------------- // create/reset TCloneArrays to store tracks and their images //----------------------------------------------------------- if(NUC){ + + + if(tsorted_nuc)delete tsorted_nuc; + if(timage_nuc) delete timage_nuc; + if(text_nuc) delete text_nuc; + tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); + timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); + text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); + // main tracks from standard alg - if (!tsorted_nuc) - tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); - tsorted_nuc->Delete(); - // track images from standard alg - if (!timage_nuc) - timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); - timage_nuc->Delete(); - // tracks from extended algorythm - if(EXT && !text_nuc) - text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); - if(text_nuc)text_nuc->Delete(); +// if (!tsorted_nuc) +// tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); +// tsorted_nuc->Clear("C+C");//Delete(); +// // track images from standard alg +// if (!timage_nuc) +// timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); +// timage_nuc->Clear("C+C");//Delete(); +// // tracks from extended algorythm +// if(EXT && !text_nuc) +// text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); +// if(text_nuc)text_nuc->Clear("C+C");//Delete(); + } //-------------------------------------------------- // retrieve sorting method @@ -2066,34 +2181,30 @@ if(doit == 0){ - trk2 = trk2_obj; - calo2 = calo2_obj; - tof2 = tof2_obj; - orb2 = orb2_obj; - - trkext = trk_ext_obj; - caloext = calo_ext_obj; - tofext = tof_ext_obj; - orbext = orb_ext_obj; - - - + trk2 = (TRK2 ? trk2_obj: NULL);; + calo2 = (CAL2 ? calo2_obj: NULL);; + tof2 = (TOF ?tof2_obj: NULL);; + orb2 = (ORB ? orb2_obj: NULL);; + trkext = (TRK2 ? trk_ext_obj: NULL);; + caloext = (CAL2 ? calo_ext_obj: NULL);; + tofext = (TOF ?tof_ext_obj: NULL);; + orbext = (ORB ? orb_ext_obj: NULL);; }else if (doit == 1){ if(!NUC)break; - trk2 = trk2_nuc_obj; - calo2 = calo2_nuc_obj; - tof2 = tof2_nuc_obj; - orb2 = orb2_nuc_obj; + trk2 = (TRK2 ?trk2_nuc_obj: NULL);; + calo2 = (CAL2 ? calo2_nuc_obj: NULL);; + tof2 = (TOF ?tof2_nuc_obj: NULL);; + orb2 = (ORB ? orb2_nuc_obj: NULL);; - trkext = trk_ext_nuc_obj; - caloext = calo_ext_nuc_obj; - tofext = tof_ext_nuc_obj; - orbext = orb_ext_nuc_obj; + trkext = (TRK2 ?trk_ext_nuc_obj: NULL);; + caloext = (CAL2 ? calo_ext_nuc_obj: NULL);; + tofext = (TOF ?tof_ext_nuc_obj: NULL);; + orbext = (ORB ? orb_ext_nuc_obj: NULL);; @@ -2126,10 +2237,12 @@ OrbitalInfoTrkVar *rs = 0; // get tracker tracks - TrkTrack *tp = trk2->GetTrack(i); //tracker - CaloTrkVar *cp = calo2->GetCaloStoredTrack(tp->GetSeqNo()); - ToFTrkVar *op = tof2->GetToFStoredTrack(tp->GetSeqNo()); - OrbitalInfoTrkVar *rp = orb2->GetOrbitalInfoStoredTrack(tp->GetSeqNo()); + TrkTrack *tp = (TRK2 ? trk2->GetTrack(i): NULL); //tracker + CaloTrkVar *cp = (CAL2 ? calo2->GetCaloStoredTrack(tp->GetSeqNo()) : NULL); + ToFTrkVar *op = (TOF ? tof2->GetToFStoredTrack(tp->GetSeqNo()) : NULL); + OrbitalInfoTrkVar *rp = (ORB ? orb2->GetOrbitalInfoStoredTrack(tp->GetSeqNo()) : NULL); + +// cout << "ORB="<GetEntries(); it++){ - new (ttext[it]) PamTrack((ExtTrack*)(*trkext)[it], (CaloTrkVar*)(*caloext)[it], (ToFTrkVar*)(*tofext)[it], (OrbitalInfoTrkVar*)(*orbext)[it]); +// if( +// it < caloext->GetEntries() && +// it < tofext->GetEntries() && +// it < orbext->GetEntries() && +// true){ + + ExtTrack *t = (trkext ?(ExtTrack*)(*trkext)[it]:NULL ); + CaloTrkVar *c =(caloext ?(CaloTrkVar*)(*caloext)[it]:NULL ); + ToFTrkVar *o = (tofext ?(ToFTrkVar*)(*tofext)[it]:NULL ); + OrbitalInfoTrkVar *r =(orbext ?(OrbitalInfoTrkVar*)(*orbext)[it]:NULL ); +// cout <<"ext:"<< t<<"--"< ORRORE E RACCAPRICCIO!!!"<GetEntries()) +// if (!tsorted->GetEntries()) +// return track; + if (tsorted->GetEntries()==0) return track; - if (it >= 0 && it < trk2_obj->TrkLevel2::GetNTracks()) { - track = (PamTrack*)((*tsorted)[it]); + if ( + tsorted && + it >= 0 && + it < trk2_obj->TrkLevel2::GetNTracks() && + it < tsorted->GetEntries() && + true) { + track = (PamTrack*)((*tsorted)[it]); } else { - cout << "PamLevel2::GetTrack(int) : tracker track SeqNo " << it << " does not exist (GetNTracks() = " + cout << "PamLevel2::GetTrackOld(int) : tracker track SeqNo " << it << " does not exist (GetNTracks() = " << trk2_obj->TrkLevel2::GetNTracks() << ")" << endl; }; @@ -2636,10 +2781,10 @@ * @param it Track number, ranging from 0 to GetNTracks(). * @param alg Algorythm, see SetTrakingAlgorythm(char *alg) for explanation. */ -PamTrack *PamLevel2::GetTrack(int it, char* alg) { +PamTrack *PamLevel2::GetTrack(int it, const char* alg) { TString s(alg); - if(!s.CompareTo("") ||!s.CompareTo("STD") )return GetTrack(it); //old algorythm + if(!s.CompareTo("") ||!s.CompareTo("STD") )return GetTrackOld(it); //old algorythm SortTracksNew(); @@ -2687,6 +2832,7 @@ }; + cout << "PamTrack *PamLevel2::GetTrack("<GetEntries() "<GetEntries()<<" trk2_nuc_obj->GetNTracks() "<GetNTracks()<TrkLevel2::GetNTracks(); + cout << "Int_t PamLevel2::GetNTracks("<GetTrkTrack()->HasImage()) { return (PamTrack*)((*timage_nuc)[it]); //ok return the track + }else{ + return NULL; } } @@ -2805,11 +2955,15 @@ PamTrack *temp = (PamTrack*) t[it]; if (temp->GetTrkTrack()->HasImage()) { return (PamTrack*)((*timage)[it]); //ok return the track + }else{ + return NULL; } } } } + +// cout << "PamTrack *PamLevel2::GetTrackImage("<Add(name); if (GP) G->Add(name); + if (P) + P->Add(name); if (SELLI == 1) L->Add(name); }; @@ -3440,12 +3599,25 @@ L->Delete(); }; + //ProcessingInfo EM + if ( P && P->GetEntries() ){ + cout << "----------------------------------------------------" << endl; + cout << ">>> Found ProcessingInfo <<<" << endl; + // L->SetBranchAddress("RunEntry",&irun); + P->SetBranchAddress("ProcInfo", &proc_obj);//NEWNEW + proc_tree = P; + } else { + // proc_tree = new TChain("ProcessingInfo","Log of data processing"); + // proc_tree->Branch("ProcInfo", "ProcInfo", &proc_obj); + cout << "----------------------------------------------------" << endl; + cout << ">>> ProcessingInfo not found, PROC set to false and continue (not 10RED files?)<<<" << endl; + PROC = false; + } // -------------------------------------------- // return the pamela chain with all the friends // -------------------------------------------- pam_tree = Trout; - return Trout; } @@ -3767,36 +3939,36 @@ * "NUCEXT" --> as "EXT", but for nuclei * "NUCEXTF" --> as "EXTF", but for nuclei */ -void PamLevel2::SetTrakingAlgorythm(char *alg){ +// void PamLevel2::SetTrackingAlgorythm(const char *alg){ - TString s(alg); - if(s.Contains("NUC", TString::kIgnoreCase) && !NUC) - cout << "Warning! NUC algorythm requested, but branches are missing"< take the output of the standard tracking algorythm"; - cout< take the output of the standard tracking algorythm for nuclei cluster selection"; - cout< in case the standard tracking algorythm has not found any track,"; - cout< force the extended tracking algorythm"; - cout< as \"EXT\", but for nuclei "; - cout< as \"EXTF\", but for nuclei"; - - cout<> "< take the output of the standard tracking algorythm"; +// cout< take the output of the standard tracking algorythm for nuclei cluster selection"; +// cout< in case the standard tracking algorythm has not found any track,"; +// cout< force the extended tracking algorythm"; +// cout< as \"EXT\", but for nuclei "; +// cout< as \"EXTF\", but for nuclei"; + +// cout<> "<GetEntry(irun); if (!GetOrbitalInfo()) - cout << "** WARNING ** missing OrbitalInfo ---> run info might be not correctly updated " << endl; + cout << "PamLevel2::UpdateRunInfo(Long64_t "<GetName()<IsZombie()) { cout << "File: " << f->GetName() << " Non valid root file" << endl; + fDiscarded = true; return; } @@ -4743,6 +4916,7 @@ TFile *f = new TFile(name.Data()); if (!f || f->IsZombie()) { cout << "File: " << f->GetName() << " discarded ---- Non valid root file" << endl; + fDiscarded = true; return false; } // cout << "Get list of keys: "<GetName() << " discarded ---- SelectionList tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4795,6 +4970,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- Trigger tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4808,6 +4984,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- ToF tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4821,6 +4998,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- S4 tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4835,6 +5013,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- NeutronD tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4848,6 +5027,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- Anticounter tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4861,6 +5041,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- OrbitalInfo tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4874,6 +5055,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- Tracker tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4897,6 +5079,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- Calorimeter tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4919,6 +5102,7 @@ if (nev && nevt != nev) { cout << "File: " << f->GetName() << " discarded ---- h20 tree has " << nevt << " events instead of " << nev << endl; + fDiscarded = true; return false; } nev = nevt; @@ -4931,10 +5115,12 @@ SELLI = (Int_t) SELLI__ok; if (SELLI == 0 && SELLI__ok) { cout << "File: " << f->GetName() << " discarded ---- found SelectionList (it is not a full-event file)" << endl; + fDiscarded = true; return false; } if (SELLI == 1 && !SELLI__ok) { cout << "File: " << f->GetName() << " discarded ---- SelectionList missing" << endl; + fDiscarded = true; return false; } @@ -4973,51 +5159,63 @@ if (CAL1 && !CAL1__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel1 branch" << endl; + fDiscarded = true; return false; }; if (CAL2 && !CAL2__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel2 branch" << endl; + fDiscarded = true; return false; }; if (TRK2 && !TRK2__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel2 branch" << endl; + fDiscarded = true; return false; }; if (TRK1 && !TRK1__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel1 branch" << endl; + fDiscarded = true; return false; }; if (TRKh && !TRKh__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing TrkHough branch" << endl; + fDiscarded = true; return false; }; if (ORB && !ORB__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing ORB tree" << endl; + fDiscarded = true; return false; }; if (AC && !AC__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing AC tree" << endl; + fDiscarded = true; return false; }; if (S4 && !S4__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing S4 tree" << endl; + fDiscarded = true; return false; }; if (TOF && !TOF__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing ToF tree" << endl; + fDiscarded = true; return false; }; if (ND && !ND__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing ND tree" << endl; + fDiscarded = true; return false; }; if (TRG && !TRG__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing Trigger tree" << endl; + fDiscarded = true; return false; }; if (GP && !GP__ok) { cout << "File: " << f->GetName() << " discarded ---- Missing h20 tree" << endl; + fDiscarded = true; return false; }; @@ -5117,8 +5315,39 @@ // cout << i<< "\t | "<ID<<"\t "<NEVENTS<< "\t "<RUNHEADER_TIME<<" <---> "<RUNTRAILER_TIME<Fill(); } - cout << "----------------------------------------------------" << endl; - + // + // replicate processinginfo tree + // + if ( PROC ){ // EMEMEM + proc_tree_clone = new TTree("ProcessingInfo","Log of data processing"); + proc_tree_clone->Branch("ProcInfo", "ProcInfo", GetPointerTo("ProcInfo")); + cout << "ProcessingInfo: branch ProcessingInfo" << endl; + // ------------------ + // replicate processinginfo tree + // ------------------ + // cout << "----------------------------------------------------"<GetEntries(); i++) { + proc_tree->GetEntry(i); + // cout << i<< "\t | "<Fill(); + } + if ( SELLI != 2 ){ + proc_obj->runID = 0; + TTimeStamp *dt = new TTimeStamp(); + proc_obj->date = dt->AsString(); + delete dt; + 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()); + proc_obj->outputFilename = ofile->GetName(); + proc_obj->localDir = gSystem->WorkingDirectory(); + proc_obj->uname = gSystem->GetFromPipe("uname -a"); + if (!dbc || (dbc && !dbc->IsConnected())) SetDBConnection(); + proc_obj->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB()); + dbc->Close(); + proc_tree_clone->Fill(); + } + cout << "----------------------------------------------------" << endl; + } // ------------------------------------ // add branch with dead and live times // ------------------------------------ @@ -5309,6 +5538,11 @@ if (!name.CompareTo(na)) return sel_tree_clone; } + if (proc_tree_clone && PROC) { + TString na = proc_tree_clone->GetName(); + if (!name.CompareTo(na)) + return proc_tree_clone; + } return NULL; } @@ -5328,9 +5562,13 @@ for (Int_t i = 0; i < NCLONES; i++) { if (pam_tree_clone[i]) { cout << pam_tree_clone[i]->GetName() << endl; - pam_tree_clone[i]->Write(); + pam_tree_clone[i]->Write(pam_tree_clone[i]->GetName(),TObject::kOverwrite); }; } + + if ( PROC ){//EMEMEMEM + proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite); + } cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; }