2 void doEStruct(
const char* filelist,
5 int maxNumEvents = 1000 ) {
11 sprintf(cutFile,
"%s/CutsFile.txt",scriptDir);
12 const char* jobName =
"AuAu200_2011_StEStructEventTest";
14 gROOT->LoadMacro(
"load2ptLibs.C");
16 gROOT->LoadMacro(
"getOutFileName.C");
17 gROOT->LoadMacro(
"support.C");
19 bool useGlobalTracks =
false;
21 char *analysisType =
"StEStructCorrelation";
32 reader->setUseGlobalTracks(useGlobalTracks);
33 estructMaker->SetEventReader(reader);
39 const double mbBins[] = {2, 15, 35, 68, 117, 187, 281, 401, 551, 739, 852, 1002};
41 cent->setCentralities(mbBins,mbNBins);
44 estructMaker->SetQAHists(qaHists);
47 TChain *ch = mk->
chain();
48 int nEvents = ch->GetEntries();
49 cout <<
"Total number of events in chain = " << nEvents << endl;
51 ch->SetBranchStatus(
"*",0);
52 ch->SetBranchStatus(
"MuEvent.*",1);
53 ch->SetBranchStatus(
"PrimaryTracks.*",1);
54 ch->SetBranchStatus(
"GlobalTracks.*",1);
55 if (ch->GetBranch(
"PrimaryVertices")) {
56 ch->SetBranchStatus(
"PrimaryVertices.*",1);
58 ecuts->setDoFillHists(
true);
59 tcuts->setDoFillHists(
true);
66 int startTime = TS.GetSec();
67 char *outFile = getOutFileName(outputDir,jobName,
"EStruct");
68 cout <<
" getOutFileName(outputDir,jobName,\"EStruct\") = " << outFile << endl;
69 TFile *fESOut =
new TFile(outFile,
"RECREATE");
75 done = reader->done();
76 if ((iev%1000) == 0) {
78 cout <<
"Found " << igood <<
" events after scanning " << iev <<
". Has been " << TS.GetSec()-startTime <<
" seconds since start of scan loop." << endl;
84 TString evName(
"EStructEvent"); evName += iev;
85 ev->Write(evName.Data());
87 if ((maxNumEvents!=0) && (iev>=maxNumEvents)) {
94 char *statsFile = getOutFileName(outputDir,jobName,
"stats");
95 cout <<
"getOutFileName(outputDir,jobName,\"stats\") = " << statsFile << endl;;
96 ofstream ofs(statsFile);
97 estructMaker->logAllStats(ofs);
98 ecuts->printCuts(ofs);
99 ecuts->printCutStats(ofs);
100 tcuts->printCuts(ofs);
101 tcuts->printCutStats(ofs);
106 char *cutsFile = getOutFileName(outputDir,jobName,
"cuts");
107 cout <<
"getOutFileName(outputDir,jobName,\"cuts\") = " << cutsFile << endl;
108 TFile *tfc =
new TFile(cutsFile,
"RECREATE");
109 ecuts->writeCutHists(tfc);
110 tcuts->writeCutHists(tfc);
114 char *qaFile = getOutFileName(outputDir,jobName,
"QA");
115 cout <<
"getOutFileName(outputDir,jobName,\"QA\") = " << qaFile << endl;
116 estructMaker->writeQAHists(qaFile);
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.