1 void doEStructGevsim(
int numEvents,
const char* outputDir,
const char* cutFile,
const char* jobName=0,
int cutBinMode=0,
int analysisMode = 0){
4 gROOT->LoadMacro(
"load2ptLibs.C");
6 gROOT->LoadMacro(
"getOutFileName.C");
7 gROOT->LoadMacro(
"support.C");
9 const char* evtCutFile=cutFile;
10 const char* trackCutFile=evtCutFile;
11 const char* pairCutFile =evtCutFile;
17 gSystem->Load(
"libEG.so");
18 gSystem->Load(
"libPhysics.so");
19 gSystem->Load(
"StEStructPoolGevsim.so");
20 gSystem->Load(
"StEStructPoolEventGenerators.so");
27 pip->SetEllipticSimple(0.05);
28 pim->SetEllipticSimple(0.05);
30 gener->AddParticleType(pip);
31 gener->AddParticleType(pim);
37 TF1 *temp =
new TF1(
"gevsimTempRndm",
"gaus(0)", 0,2);
38 temp->SetParameters(1, 1, 0.015);
40 TF1 *psi =
new TF1(
"gevsimPsiRndm",
"1", 0,360);
42 gener->SetVerbose(kFALSE);
55 char** datadirs=getDirNames(
"data",nset);
56 char** cutdirs=getDirNames(
"cuts",nset);
60 cb->setMode(cutBinMode);
69 char** outputFile =
new char*[nset];
79 bool* skipMake=
new bool[nset];
81 for(
int i=1;i<nset;i++)skipMake[i]=
true;
86 for(
int i=0;i<nset;i++){
88 outputFile[i]=getOutFileName(outputDir,jobName,datadirs[i]);
90 analysis[i]->setCutFile(pairCutFile);
91 analysis[i]->setOutputFileName(outputFile[i]);
104 estructMaker->SetReaderAnalysisPair(readers[i],analysis[i]);
108 doTheWork(estructMaker,numEvents);
111 char* statsFileName=getOutFileName(outputDir,jobName,
"stats");
112 ofstream ofs(statsFileName);
115 estructMaker->logAnalysisTime(ofs);
116 estructMaker->logInputEvents(ofs);
117 estructMaker->logOutputEvents(ofs);
118 estructMaker->logOutputRate(ofs);
119 estructMaker->logAnalysisStats(ofs);
121 for(
int i=0;i<nset;i++){
122 ofs<<
" *************** ";
123 ofs<<
" Cut Stats for Analysis Number = "<<i;
124 ofs<<
" *************** "<<endl;
125 ecuts[i]->printCuts(ofs);
126 tcuts[i]->printCuts(ofs);
130 pcuts=&analysis[i]->getPairCuts();
131 pcuts->printCuts(ofs);
135 char* rootCutFile=getOutFileName(outputDir,jobName,cutdirs[i]);
136 TFile* tf=
new TFile(rootCutFile,
"RECREATE");
137 ecuts[i]->writeCutHists(tf);
138 tcuts[i]->writeCutHists(tf);
139 if(pcuts)pcuts->writeCutHists(tf);