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