StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructFluctAnal.h
1 #ifndef __STESTRUCTFLUCTANAL__H
2 #define __STESTRUCTFLUCTANAL__H
3 
4 
5 #include "StTrackTopologyMap.h"
6 #include "multStruct.h"
7 #include "StEStructFluctuations.h"
8 #include "StEStructPool/AnalysisMaker/StEStructAnalysis.h"
9 #include "StEStructPool/EventMaker/StEStructCentrality.h"
10 #include "StEStructPool/Correlations/StEStructPairCuts.h"
11 
12 #include "TFile.h"
13 class TH1F;
14 class TH1D;
15 class TH2F;
16 class StEStructEvent;
17 class StEStructTrack;
18 class StTimer;
19 class StEStructQAHists;
20 
22 
23  protected:
24 
25  public:
26  StEStructFluctAnal( int mode=0, int etaSumMode=1, int phiSumMode=1 );
27  virtual ~StEStructFluctAnal();
28 
29  StEStructPairCuts* getPairCuts();
30  void initStructures( StEStructCuts* tcut );
31  void setEtaLimits( StEStructCuts* tcut );
32  void setPtLimits( StEStructCuts* tcut );
33  void setQAHists( StEStructQAHists* qaHists );
34  void setPairCuts( StEStructPairCuts* cuts );
35 
36  //---> support of interface
37  virtual void setOutputFileName(const char* outFileName);
38  bool doEvent(StEStructEvent* p);
39  void finish();
40 
41  // analysis specific functions
42  void initHistograms();
43  void deleteHistograms();
44  void createCentralityObjects();
45  void deleteCentralityObjects();
46  void fillMultStruct();
47  void AddEvent();
48  int getEtaStart( int iEta, int dEta );
49  int getPhiStart( int iPhi, int dPhi );
50  int getNumEtaBins( int dEta );
51  int getNumPhiBins( int dPhi );
52  void writeHistograms();
53  void writeQAHists(TFile* qatf);
54  float etaOffset( float vz );
55 
56 
57  // Member declarations.
58  bool mAmDone;
59  int manalysisMode;
60  char *moutFileName;
61  int mEtaSumMode, mPhiSumMode;
62 
63  StEStructEvent *mCurrentEvent;
65 
66  StEStructPairCuts* mPairCuts;
69 
70  float mEtaMin, mEtaMax;
71  float mPtMin, mPtMax;
72 
73  double *mptnplus;
74  double *mptnminus;
75  double *mptpplus;
76  double *mptpminus;
77 
78  int mnTotBins;
79  int mnTotEvents, *mnCentEvents;
80  int mnCents, mnPts, mnPtCents;
81  StEStructFluct **mFluct, **mPtFluct;
82 
83  int nBins[NPHIBINS][NETABINS];
84  int offset[NPHIBINS][NETABINS];
85  double fUnique[NPHIBINS][NETABINS];
86 
87  // Histogram declarations.
88  // These will be summed over all events for all jobs.
89  // We run followup jobs to calculate \delta\sigma^2 and plot
90  // reference histograms.
91  TH1F *hMultiplicity;
92  TH1F *hMultiplicityBinned;
93  TH1F *hPt;
94  TH1F *hPtBinned;
95  TH2F *hnBins;
96  TH2F *hoffset;
97  TH2F *hfUnique;
98 
99  // Here is the object I use to hold the binned tracks.
100  multStruct *ms;
101 
102  ClassDef(StEStructFluctAnal,1)
103 };
104 
105 inline void StEStructFluctAnal::setOutputFileName(const char* outFileName) {
106  if(!outFileName) return;
107  moutFileName=new char[strlen(outFileName)+1];
108  strcpy(moutFileName,outFileName);
109 }
110 inline void StEStructFluctAnal::setQAHists(StEStructQAHists* qahists){
111  mQAHists = qahists;
112 }
113 
114 inline void StEStructFluctAnal::setPairCuts(StEStructPairCuts* pcuts){
115  mPairCuts=pcuts;
116 }
117 inline void StEStructFluctAnal::finish() {
118  if (mAmDone) {
119  cout << "StEStructFluctAnal::finish() has already been called." << endl;
120  return;
121  }
122  TFile * tf=new TFile(moutFileName,"RECREATE");
123  tf->cd();
124  writeHistograms();
125  tf->Close();
126  mAmDone = true;
127 };
128 inline StEStructPairCuts* StEStructFluctAnal::getPairCuts() {
129  return mPairCuts;
130 }
131 
132 #endif
bool mlocalQAHists
for QA histogramming
StEStructQAHists * mQAHists
for pairs kine + all paircuts
float mEtaMin
toggle needed for who writes out
char * moutFileName
simple enumeration of analyses ...
StEStructCentrality * mCentralities
pointer to EStruct2pt data