--- PamelaLevel2/src/PamLevel2.cpp 2014/10/17 14:03:46 1.98 +++ PamelaLevel2/src/PamLevel2.cpp 2014/10/17 16:25:38 1.107 @@ -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(); @@ -961,6 +971,10 @@ if (sel_tree) sel_tree->Delete();; sel_tree = NULL; + + if (proc_tree) + proc_tree->Delete(); + proc_tree = NULL; // // Close file // @@ -984,6 +998,7 @@ ac_obj = 0; orb2_obj = 0; gp_obj = 0; + proc_obj = 0; trk_ext_obj = 0; trk_ext_nuc_obj = 0; @@ -1015,6 +1030,7 @@ // run_obj = 0;//new GL_RUN(); soft_obj = 0;// Emiliano + proc_obj = 0;// Emiliano irun = -1; irunt = -1; totrunentry = 0LL; @@ -1189,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; } ; @@ -3304,6 +3326,7 @@ TChain *G = 0; TChain *L = 0; + TChain *P = 0; if (TRK2 || TRK1 || TRKh) T = new TChain("Tracker"); @@ -3323,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 @@ -3350,6 +3375,8 @@ B->Add(name); if (GP) G->Add(name); + if (P) + P->Add(name); if (SELLI == 1) L->Add(name); }; @@ -3475,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; } @@ -4572,6 +4606,7 @@ // cout << "Checking file: "<GetName()<IsZombie()) { cout << "File: " << f->GetName() << " Non valid root file" << endl; + fDiscarded = true; return; } @@ -5177,8 +5212,38 @@ // 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"); + 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_obj->DB = ""; + proc_tree_clone->Fill(); + } + cout << "----------------------------------------------------" << endl; + } // ------------------------------------ // add branch with dead and live times // ------------------------------------ @@ -5369,6 +5434,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 +5461,10 @@ pam_tree_clone[i]->Write(pam_tree_clone[i]->GetName(),TObject::kOverwrite); }; } + + if ( PROC ){//EMEMEMEM + proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite); + } cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; }