17 void doEStruct2ptPythia(
const char* filelist,
18 const char* outputDir,
19 const char* scriptDir,
20 int maxNumEvents = 0 ) {
22 gROOT->LoadMacro(
"load2ptLibs.C");
25 gROOT->LoadMacro(
"loadPythiaLibs.C");
27 gROOT->LoadMacro(
"getPythia.C");
29 char* jobid=gSystem->Getenv(
"JOBID");
30 const char* rframe=
"CMS";
31 const char* cproj =
"p";
32 const char* ctarg =
"p";
36 TPythia6* pythia=getPythia(rframe,cproj,ctarg,rts,pythiaTune,jobid);
39 sprintf(cutFile,
"%s/CutsFile.txt",scriptDir);
41 gROOT->LoadMacro(
"getOutFileName.C");
42 const char* scratchDir =
"PPPythia";
46 const double mbBins[]={2,3,4,6,8,11,14,99};
47 int mbNBins=1+1+1+1+1+1+1+1;
48 int mbNBins=cent->numCentralities()-1;
53 cb->setMode(cutBinMode);
54 int mbNCutBins = cb->getNumBins();
62 qaHists->initHistograms();
63 estructMaker->SetQAHists(qaHists);
70 estructMaker->SetEventReader(reader);
77 for(
int i=0;i<mbNBins;i++){
81 analysis[i]->setOutputFileName(getOutFileName(outputDir,scratchDir,
"data",ic));
82 analysis[i]->setQAHists(qaHists);
83 analysis[i]->setZBuffLimits(ecuts);
85 estructMaker->SetAnalyses(analysis,mbNBins);
90 estructMaker->startTimer();
92 int counter=0, istat=0, i=0;
96 istat=estructMaker->
Make();
100 cout<<
"doing event ="<<i<<endl;
103 if ( maxNumEvents!=0 && i>=maxNumEvents ) {
107 estructMaker->stopTimer();
110 ofstream ofs(getOutFileName(outputDir,scratchDir,
"stats"));
111 estructMaker->logAllStats(ofs);
112 ecuts->printCuts(ofs);
113 tcuts->printCuts(ofs);
114 pcuts->printCuts(ofs);
119 TFile* tf=
new TFile(getOutFileName(outputDir,scratchDir,
"cuts"),
"RECREATE");
120 ecuts->writeCutHists(tf);
121 tcuts->writeCutHists(tf);
125 estructMaker->writeQAHists(getOutFileName(outputDir,scratchDir,
"QA"));