void make_physmon_ntuple() { mon->CreatePhysMonNtuple("hist/*","physmon.root"); } void make_pbmon_ntuple() { mon->CreatePbMonNtuple("hist/*","pbmon.root"); } //_____________________________________________________________________________ void make_physmon_thousand(int ThousandsOfRuns) { // 2004-07-11 P.Murat char dir[200], ntuple[200]; sprintf(dir,"hist/%i",ThousandsOfRuns); sprintf(ntuple,"ntuples/physmon_%i.root",ThousandsOfRuns); mon->CreatePhysMonNtuple(dir,ntuple); } //_____________________________________________________________________________ void make_pbmon_thousand(int ThousandsOfRuns) { char dir[200], ntuple[200]; sprintf(dir,"hist/%i",ThousandsOfRuns); sprintf(ntuple,"ntuples/pbmon_%i.root",ThousandsOfRuns); mon->CreatePbMonNtuple(dir,ntuple); } //_____________________________________________________________________________ void merge_ntuples() { // merge ntuples FILE* pipe; char s[1000],fn[200]; TChain* chain; chain = new TChain("physmon"); pipe = gSystem->OpenPipe("ls ntuples/* | grep physmon_","r"); while (fscanf(pipe,"%s",s) != EOF) { printf(" -- merging %s\n",s); chain->AddFile(s,TChain::kBigNumber); } gSystem->ClosePipe(pipe); chain->Merge("physmon.root"); //----------------------------------------------------------------------------- // update "per-pb" ntuple //----------------------------------------------------------------------------- pipe = gSystem->OpenPipe("ls ntuples/* | grep pbmon_","r"); chain = new TChain("pbmon"); while (fscanf(pipe,"%s",s) != EOF) { printf(" -- merging %s\n",s); chain->AddFile(s,TChain::kBigNumber); } gSystem->ClosePipe(pipe); chain->Merge("pbmon.root"); } //_____________________________________________________________________________ void remake_ntuples() { // 2004-07-11 P.Murat int thousand_of_runs [] = { 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, -1 }; for (int i=0; thousand_of_runs[i] > 0; i++) { make_physmon_thousand(thousand_of_runs[i]); make_pbmon_thousand (thousand_of_runs[i]); } merge_ntuples(); }