15 void doEStructPythia(
const char* filelist,
16 const char* outputDir,
17 const char* scriptDir,
18 int maxNumEvents = 0 ) {
20 gROOT->LoadMacro(
"load2ptLibs.C");
23 gROOT->LoadMacro(
"loadPythiaLibs.C");
25 gROOT->LoadMacro(
"getPythia.C");
27 char* jobid=gSystem->Getenv(
"JOBID");
28 const char* rframe=
"CMS";
29 const char* cproj =
"p";
30 const char* ctarg =
"p";
34 TPythia6* pythia=getPythia(rframe,cproj,ctarg,rts,pythiaTune,jobid);
37 sprintf(cutFile,
"%s/CutsFile.txt",scriptDir);
39 gROOT->LoadMacro(
"getOutFileName.C");
40 const char* scratchDir =
"PPPythia";
44 const double temp[2]={0,2000};
45 cent->setCentralities(temp,2);
46 int mbNBins=cent->numCentralities()-1;
51 cb->setMode(cutBinMode);
52 int mbNCutBins = cb->getNumBins();
60 qaHists->initHistograms();
61 estructMaker->SetQAHists(qaHists);
68 estructMaker->SetEventReader(reader);
75 for(
int i=0;i<mbNBins;i++){
79 analysis[i]->setOutputFileName(getOutFileName(outputDir,scratchDir,
"data",ic));
80 analysis[i]->setQAHists(qaHists);
81 analysis[i]->setZBuffLimits(ecuts);
83 estructMaker->SetAnalyses(analysis,mbNBins);
88 estructMaker->startTimer();
90 int counter=0, istat=0, i=0;
94 istat=estructMaker->
Make();
98 cout<<
"doing event ="<<i<<endl;
101 if ( maxNumEvents!=0 && i>=maxNumEvents ) {
105 estructMaker->stopTimer();
108 ofstream ofs(getOutFileName(outputDir,scratchDir,
"stats"));
109 estructMaker->logAllStats(ofs);
110 ecuts->printCuts(ofs);
111 tcuts->printCuts(ofs);
112 pcuts->printCuts(ofs);
117 TFile* tf=
new TFile(getOutFileName(outputDir,scratchDir,
"cuts"),
"RECREATE");
118 ecuts->writeCutHists(tf);
119 tcuts->writeCutHists(tf);
123 estructMaker->writeQAHists(getOutFileName(outputDir,scratchDir,
"QA"));