--- PamelaLevel2/src/PamLevel2.cpp 2014/10/17 14:03:46 1.98 +++ PamelaLevel2/src/PamLevel2.cpp 2014/10/17 15:58:09 1.100 @@ -566,6 +566,7 @@ run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1LL; irunt = -1LL; totrunentry = 0LL; @@ -592,6 +593,10 @@ run_tree = NULL; run_tree_clone = NULL; + + proc_tree = NULL; + proc_tree_clone = NULL; + sel_tree = NULL; sel_tree_clone = NULL; @@ -639,6 +644,7 @@ ND = true; AC = true; ORB = true; + PROC = true; GP = false; EXT = false; @@ -681,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(); @@ -984,6 +994,7 @@ ac_obj = 0; orb2_obj = 0; gp_obj = 0; + proc_obj = 0; trk_ext_obj = 0; trk_ext_nuc_obj = 0; @@ -1015,6 +1026,7 @@ // run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1; irunt = -1; totrunentry = 0LL; @@ -1189,6 +1201,12 @@ if (!objname.CompareTo("SoftInfo")) return &soft_obj; // Emiliano + if (!objname.CompareTo("ProcessingInfo")){ + if (!proc_obj) + proc_obj = new ProcInfo(); + return &proc_obj; // Emiliano + } + return NULL; } ; @@ -3304,6 +3322,7 @@ TChain *G = 0; TChain *L = 0; + TChain *P = 0; if (TRK2 || TRK1 || TRKh) T = new TChain("Tracker"); @@ -3323,6 +3342,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 @@ -3350,6 +3371,8 @@ B->Add(name); if (GP) G->Add(name); + if (P) + P->Add(name); if (SELLI == 1) L->Add(name); }; @@ -3475,6 +3498,13 @@ L->Delete(); }; + //ProcessingInfo EM + if ( P && P->GetEntries() ){ + cout << "----------------------------------------------------" << endl; + cout << ">>> Found ProcessingInfo <<<" << endl; + // L->SetBranchAddress("RunEntry",&irun); + P->SetBranchAddress("ProcInfo", &proc_obj);//NEWNEW + } // -------------------------------------------- // return the pamela chain with all the friends // -------------------------------------------- @@ -4572,6 +4602,7 @@ // cout << "Checking file: "<GetName()<IsZombie()) { cout << "File: " << f->GetName() << " Non valid root file" << endl; + fDiscarded = true; return; } @@ -5177,8 +5208,33 @@ // cout << i<< "\t | "<ID<<"\t "<NEVENTS<< "\t "<RUNHEADER_TIME<<" <---> "<RUNTRAILER_TIME<Fill(); } - cout << "----------------------------------------------------" << endl; - + if ( PROC ){ + proc_tree_clone->Branch("ProcessingInfo", "ProcInfo", GetPointerTo("ProcessingInfo")); + cout << "ProcessingInfo: branch ProcessingInfo" << endl; + // ------------------ + // replicate processinginfo tree + // ------------------ + // cout << "----------------------------------------------------"<GetEntries(); i++) { + proc_tree->GetEntry(i); + // cout << i<< "\t | "<ID<<"\t "<NEVENTS<< "\t "<RUNHEADER_TIME<<" <---> "<RUNTRAILER_TIME<Fill(); + } + if ( SELLI != 2 || true ){ + proc_obj->runID = 0; + TTimeStamp *dt = new TTimeStamp(); + proc_obj->date = dt->AsString(); + delete dt; + proc_obj->commandLine = Form("PamelaLevel2 was called"); + proc_obj->outputFilename = ""; + proc_obj->localDir = gSystem->WorkingDirectory(); + proc_obj->uname = gSystem->GetFromPipe("uname -a"); + proc_obj->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB()); + proc_tree_clone->Fill(); + } + cout << "----------------------------------------------------" << endl; + } // ------------------------------------ // add branch with dead and live times // ------------------------------------ @@ -5369,6 +5425,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; } @@ -5391,6 +5452,10 @@ pam_tree_clone[i]->Write(pam_tree_clone[i]->GetName(),TObject::kOverwrite); }; } + + if ( PROC ){ + proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite); + } cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; }