--- PamelaLevel2/src/PamLevel2.cpp 2014/10/17 06:54:11 1.97 +++ PamelaLevel2/src/PamLevel2.cpp 2014/10/17 16:21:50 1.104 @@ -566,6 +566,7 @@ run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1LL; irunt = -1LL; totrunentry = 0LL; @@ -576,6 +577,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; @@ -591,6 +593,10 @@ run_tree = NULL; run_tree_clone = NULL; + + proc_tree = NULL; + proc_tree_clone = NULL; + sel_tree = NULL; sel_tree_clone = NULL; @@ -638,6 +644,7 @@ ND = true; AC = true; ORB = true; + PROC = true; GP = false; EXT = false; @@ -680,6 +687,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(); @@ -960,6 +971,10 @@ if (sel_tree) sel_tree->Delete();; sel_tree = NULL; + + if (proc_tree) + proc_tree->Delete(); + proc_tree = NULL; // // Close file // @@ -983,6 +998,7 @@ ac_obj = 0; orb2_obj = 0; gp_obj = 0; + proc_obj = 0; trk_ext_obj = 0; trk_ext_nuc_obj = 0; @@ -1014,6 +1030,7 @@ // run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1; irunt = -1; totrunentry = 0LL; @@ -1188,6 +1205,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; } ; @@ -3303,6 +3326,7 @@ TChain *G = 0; TChain *L = 0; + TChain *P = 0; if (TRK2 || TRK1 || TRKh) T = new TChain("Tracker"); @@ -3322,6 +3346,8 @@ B = new TChain("OrbitalInfo"); if (GP) G = new TChain("h20"); + if (PROC) + P = new TChain("ProcessingInfo"); L = new TChain("SelectionList"); // loop over files and create chains @@ -3349,6 +3375,8 @@ B->Add(name); if (GP) G->Add(name); + if (P) + P->Add(name); if (SELLI == 1) L->Add(name); }; @@ -3474,12 +3502,19 @@ 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; + } // -------------------------------------------- // return the pamela chain with all the friends // -------------------------------------------- pam_tree = Trout; - return Trout; } @@ -4571,6 +4606,7 @@ // cout << "Checking file: "<GetName()<IsZombie()) { cout << "File: " << f->GetName() << " Non valid root file" << endl; + fDiscarded = true; return; } @@ -4777,6 +4813,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; @@ -4829,6 +4867,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; @@ -4842,6 +4881,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; @@ -4855,6 +4895,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; @@ -4869,6 +4910,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; @@ -4882,6 +4924,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; @@ -4895,6 +4938,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; @@ -4908,6 +4952,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; @@ -4931,6 +4976,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; @@ -4953,6 +4999,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; @@ -4965,10 +5012,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; } @@ -5007,51 +5056,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; }; @@ -5151,8 +5212,45 @@ // 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 || true ){ + cout << "|| "<runID = 0; + cout << "|||d "<date = dt->AsString(); + delete dt; + cout << "|||f "<commandLine = Form("PamelaLevel2 was called"); + cout << "|||g "<outputFilename = ""; + cout << "|||h "<localDir = gSystem->WorkingDirectory(); + cout << "|||j "<uname = gSystem->GetFromPipe("uname -a"); + cout << "|||s "<DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB()); + cout << "||| "<Fill(); + } + cout << "----------------------------------------------------" << endl; + } // ------------------------------------ // add branch with dead and live times // ------------------------------------ @@ -5343,6 +5441,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; } @@ -5362,9 +5465,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 && false ){//EMEMEMEM + proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite); + } cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; }