11 void writeEStructExample(
const char* filelist,
12 const char* outputDir,
13 const char* scriptDir,
14 int maxNumEvents = 0 ) {
17 gROOT->LoadMacro(
"load2ptLibs.C");
21 sprintf(cutFile,
"%s/CutsFile.txt",scriptDir);
23 gROOT->LoadMacro(
"getOutFileName.C");
24 const char* scratchDir =
"CuCu200data";
28 const double mbBins[]={2,30,100,180,240,320,400,999999};
29 int mbNBins=1+1+1+1+1+1+1+1;
30 cent->setCentralities(mbBins,mbNBins);
31 int numberOfAnalyses=mbNBins-1;
49 estructMaker->SetEventReader(reader);
54 qaHists->initHistograms();
55 estructMaker->SetQAHists(qaHists);
62 for(
int i=0;i<numberOfAnalyses;i++){
64 if(numberOfAnalyses==1)ic=-1;
66 TString writerName(
"EStructWriterMaker"); writerName+=i;
70 analysis[i]->setOutputFileName(getOutFileName(outputDir,scratchDir,
"event",ic));
75 analysis[i]->setAnalysisIndex(i);
77 estructMaker->SetAnalyses(analysis,numberOfAnalyses);
82 estructMaker->startTimer();
84 int counter=0, istat=0, i=0;
88 istat=estructMaker->
Make();
92 cout<<
"doing event ="<<i<<endl;
94 estructMaker->writeDiagnostics(0);
96 if ( maxNumEvents!=0 && i>=maxNumEvents ) {
100 estructMaker->stopTimer();
103 ofstream ofs(getOutFileName(outputDir,scratchDir,
"stats"));
104 estructMaker->logAllStats(ofs);
105 ecuts->printCuts(ofs);
106 tcuts->printCuts(ofs);
111 TFile* tf=
new TFile(getOutFileName(outputDir,scratchDir,
"cuts"),
"RECREATE");
112 ecuts->writeCutHists(tf);
113 tcuts->writeCutHists(tf);