StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doEStruct200.C
1 void doEStruct200(const char* fileListFile, const char* outputDir, const char* cutFile, const char* jobName, int cutBinMode=0, int maxNumEvents=0, int analysisMode=0){
2 
3  gROOT->LoadMacro("load2ptLibs.C");
4  load2ptLibs();
5  gROOT->LoadMacro("getOutFileName.C"); // for laying out file names
6 
7  // define centrality
8  StEStructCentrality* cent=StEStructCentrality::Instance();
9 
10  //int numCent = 2;
11  //const double temp[2]={0,2000}; //=1 centrality
12 
13  //int numCent = 12;
14  //const double temp[12]={2,15,35,68,117,187,281,401,551,739,852,2000}; // new 11 bins, not too different
15 
16  int numCent = 23;
17  const double temp[23]={2,15,35,68,117,152,187,234,281,341,401,451,501,551,614,676,739,796,852,902,952,1002,2000}; //small slices
18  // {2,15,35,68,117, 187, 281, 401, 551, 739, 852, 2000}
19 
20  cent->setCentralities(temp,numCent);
21  cent->Print();
22  int numberOfAnalyses=numCent-1;
23 
24  // choose the mode for the binning
25  StEStructCutBin* cb=StEStructCutBin::Instance();
26  cb->setMode(cutBinMode);
27  int mbNCutBins = cb->getNumBins();
28 
29  // create the low-level reader (here for MuDst)
30  // reader = reader interface + pointer to Data Maker + cut classes
31  StMuDstMaker* mk = new StMuDstMaker(0,0,"",fileListFile,".",5000);
32 
33  // create the generic EStructAnalysisMaker
34  StEStructAnalysisMaker *estructMaker = new StEStructAnalysisMaker("EStruct2pt");
35 
36  // Set up the reader with event/track cuts
37  StEStructEventCuts* ecuts = new StEStructEventCuts(cutFile);
38  StEStructTrackCuts* tcuts = new StEStructTrackCuts(cutFile);
39  StEStructMuDstReader* reader = new StEStructMuDstReader(mk,ecuts,tcuts);
40  estructMaker->SetEventReader(reader);
41 
42  // create the QAHist object (must come after centrality and cutbin objects)
43  int EventType = 0; // real data
44  StEStructQAHists* qaHists = new StEStructQAHists(EventType);
45  qaHists->initHistograms();
46  estructMaker->SetQAHists(qaHists);
47 
48  StEStruct2ptCorrelations** analysis = new StEStruct2ptCorrelations*[numberOfAnalyses];
49  StEStructPairCuts* pcuts = new StEStructPairCuts(cutFile);
50 
51  for(int i=0;i<numberOfAnalyses;i++){
52  int ic=i;
53  if(numberOfAnalyses==1)ic=-1;
54  analysis[i]=new StEStruct2ptCorrelations(pcuts,analysisMode);
55  analysis[i]->setOutputFileName(getOutFileName(outputDir,jobName,"data",ic));
56  analysis[i]->setQAHists(qaHists); // only 1 QA Object in this case
57  analysis[i]->setZBuffLimits(ecuts); // common to all
58  analysis[i]->setAnalysisIndex(i);
59  }
60  estructMaker->SetAnalyses(analysis,numberOfAnalyses);
61 
62  // --- now do the work ---
63  estructMaker->Init();
64  estructMaker->startTimer();
65  int counter=0, istat=0, i=0;
66 
67  while (istat!=2) {
68  istat=estructMaker->Make(); // now includes filling qa histograms
69  i++; counter++;
70  if (counter==200) {
71  cout<<"doing event ="<<i<<endl;
72  counter=0;
73  //estructMaker->writeDiagnostics(0);
74  }
75  if ( maxNumEvents!=0 && i>=maxNumEvents ) {
76  istat=2;
77  }
78  }
79  estructMaker->stopTimer();
80 
81  //--- now write out stats and cuts ---
82  ofstream ofs(getOutFileName(outputDir,jobName,"stats"));
83  estructMaker->logAllStats(ofs);
84  ecuts->printCuts(ofs);
85  tcuts->printCuts(ofs);
86  pcuts->printCuts(ofs);
87  ofs<<endl;
88  ofs.close();
89 
90  // --> root cut file
91  TFile* tf=new TFile(getOutFileName(outputDir,jobName,"cuts"),"RECREATE");
92  ecuts->writeCutHists(tf);
93  tcuts->writeCutHists(tf);
94  tf->Close();
95 
96  // --> root qa histogram file
97  estructMaker->writeQAHists(getOutFileName(outputDir,jobName,"QA"));
98 
99  // --- write out the data
100  estructMaker->Finish();
101 }
102 
103 /**********************************************************************
104  *
105  * $Log: doEStruct200.C,v $
106  * Revision 1.1 2007/07/25 17:08:57 msd
107  * My analysis macros for 2001 200 GeV and 2004 62 GeV Au-Au data sets.
108  *
109  * Revision 1.8 2006/04/04 22:15:56 porter
110  * a large number of changes were done to simplify the doEStruct macros
111  * in the sense that these are now more similar and should be easier
112  * for Duncan's GUI to build. Here are some examples.
113  *
114  * Revision 1.7 2005/03/03 01:33:36 porter
115  * modified macros
116  *
117  * Revision 1.6 2004/08/23 19:12:46 msd
118  * Added note about usage for pre-compiled cut database
119  *
120  * Revision 1.5 2004/06/26 16:28:42 porter
121  * fixed typo in getDirNames.C
122  *
123  * Revision 1.4 2004/06/25 03:14:55 porter
124  * modified basic macro to take only 1 cutfile and moved some common
125  * features into a new macro=support.C..... this cleaned up the
126  * doEStruct macro somewhat
127  *
128  * Revision 1.3 2004/04/15 18:46:31 msd
129  * Updated centrality variable types
130  *
131  * Revision 1.2 2003/11/21 06:26:40 porter
132  * macros for running pythia
133  *
134  * Revision 1.1 2003/10/15 18:20:57 porter
135  * initial check in of Estruct Analysis maker codes.
136  *
137  *
138  *********************************************************************/