StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StCentralityAnalyzer.h
1 
10 #ifndef StCentralityAnalyzer_h
11 #define StCentralityAnalyzer_h
12 
13 // STAR classes
14 #include "StMaker.h"
15 
16 // PicoDst headers
17 #include "StPicoEvent/StPicoDstReader.h"
18 #include "StPicoEvent/StPicoEvent.h"
19 #include "StPicoEvent/StPicoTrack.h"
20 #include "StPicoEvent/StPicoBTofPidTraits.h"
21 #include "StPicoEvent/StPicoDst.h"
22 
23 // ROOT headers
24 #include "TFile.h"
25 #include "TH1.h"
26 #include "TH2.h"
27 #include "TProfile.h"
28 #include "TRandom3.h"
29 
30 // C++ headers
31 #include <vector>
32 
33 //________________
34 class StCentralityAnalyzer : public StMaker {
35  public:
36  // Constructor
37  StCentralityAnalyzer(StPicoDstReader *reader, const Char_t* oFileName);
38  // Destructor
39  virtual ~StCentralityAnalyzer();
40 
41  // Standard StMaker inherited methods
42  virtual Int_t Init();
43  virtual Int_t Make();
44  virtual Int_t Finish();
45  void Clear(Option_t *option="");
46 
47  // Set cuts, limits and triggers
48  void addTriggerId(const unsigned int& id);
49  void setDebugStatus(bool status) { mDebug = status; }
50  void setUsePileUp(bool pileup) { mUsePileUp = pileup; }
51  void setUseLumCorr(bool lumcorr) { mUseLumCorr = lumcorr; }
52  void setUseVzCorr(bool vzcorr) { mUseVzCorr = vzcorr; }
53  void setRunIdParameters(unsigned int& bins, double& lo, double hi) { mRunIdBins=bins; mRunIdRange[0]=lo; mRunIdRange[1]=hi; }
54  void setVtxZCut(const float& lo, const float& hi) { mVtxZ[0]=lo; mVtxZ[1]=hi; }
55  void setVtxRCut(const float& lo, const float& hi) { mVtxR[0]=lo; mVtxR[1]=hi; }
56  void setVtxPositionShift(const float& x, const float& y) { mVtxXShift=x; mVtxYShift=y; }
57  void setVtxVpdVzCut(const float& lo, const float& hi) { mVpdVzDiff[0]=lo; mVpdVzDiff[1]=hi; }
58 
59  void setPileUpParameters(double a0,double a1,double a2,double a3,double a4,
60  double b0,double b1,double b2,double b3,double b4,
61  double c0,double c1,double c2,double c3,double c4)
62  { m_a0=a0; m_a1=a1; m_a2=a2; m_a3=a3; m_a4=a4;
63  m_b0=b0; m_b1=b1; m_b2=b2; m_b3=b3; m_b4=b4;
64  m_c0=c0; m_c1=c1; m_c2=c2; m_c3=c3; m_c4=c4;}
65 
66  void setLumCorrParameters(double lumcorr_a, double lumcorr_b, double lumcorr_bprime)
67  { m_LumCorr_a = lumcorr_a; m_LumCorr_b = lumcorr_b; m_LumCorr_bprime = lumcorr_bprime; }
68 
69  void setVzCorrParameters(double vzCorPar0, double vzCorPar1, double vzCorPar2, double vzCorPar3, double vzCorPar4, double vzCorPar5, double vzCorPar6)
70  {
71  m_vzCorr0 = vzCorPar0;
72  m_vzCorr1 = vzCorPar1;
73  m_vzCorr2 = vzCorPar2;
74  m_vzCorr3 = vzCorPar3;
75  m_vzCorr4 = vzCorPar4;
76  m_vzCorr5 = vzCorPar5;
77  m_vzCorr6 = vzCorPar6;
78  }
79 
80  //set shape correction index, 0: Ru, 1: Zr
81  void setShapeIndex(Int_t index) {mShapeIndex = index;}
82 
83  Double_t getShapeWeight(Double_t Vz, Double_t RefMult);
84 
85  private:
86  // Histogram creation
87  void createHistograms();
88  void createEventHistograms();
89  void createPrimaryTrackHistograms();
90  void createGlobalTrackHistograms();
91 
92  // Methods to check whether
93  Bool_t isGoodEvent(StPicoEvent* event);
94  Bool_t isGoodVertex(Float_t x, Float_t y, Float_t z, Float_t vpdVz);
95  Bool_t isGoodTrigger(std::vector<unsigned int> ids);
96  Bool_t isNotPileUp(UShort_t refMult, UShort_t btofMatched);
97  Bool_t isGoodTrack(StPicoTrack* track);
98  Bool_t isInBadRunList(unsigned int runId);
99 
100  // Method for luminosity correction
101  Double_t calculateLumCorr(Double_t ZDCx);
102 
103  //Function to correct refmult Vz dependence
104  Double_t getRefMultCorrVz(Double_t RefMult, Double_t Vz);
105 
106  const Char_t *mOutFileName;
107  TFile *mOutFile;
108  StPicoDstReader *mReader;
109  StPicoDst* mDst;
110  std::vector<unsigned int> mTriggerIdCollection;
111 
112  UInt_t mEventsPassed;
113 
114  Bool_t mDebug;
115  Bool_t mUsePileUp;
116  Bool_t mUseLumCorr;
117  Bool_t mUseVzCorr;
118 
119  // Pileup Parameters
120  Double_t m_a0, m_a1, m_a2, m_a3, m_a4;
121  Double_t m_b0, m_b1, m_b2, m_b3, m_b4;
122  Double_t m_c0, m_c1, m_c2, m_c3, m_c4;
123 
124  // Luminosity Correction Parameters
125  Double_t m_LumCorr_a;
126  Double_t m_LumCorr_b;
127  Double_t m_LumCorr_bprime;
128 
129  //a backup tree to confirm vz correciton
130  TTree *mTree;
131  Double_t mTree_Vz;
132  Double_t mTree_ZDCx;
133  Double_t mTree_refMult;
134  Double_t mTree_refMultCor;
135  Double_t mTree_nBTOFMatched;
136 
137 
138  // Vz Correction Parameters
139  Double_t m_vzCorr0, m_vzCorr1, m_vzCorr2, m_vzCorr3, m_vzCorr4, m_vzCorr5, m_vzCorr6;
140  //Shape correction index, 0: Ru, 1: Zr
141  Int_t mShapeIndex;
142 
143  // Bad run list for Ru+Ru at 200 GeV
144  static const std::vector<unsigned int> bad_run_list_ruru_200gev;
145  // Bad run list for Zr+Zr at 200 GeV
146  static const std::vector<unsigned int> bad_run_list_zrzr_200gev;
147 
148  // Event cuts
149  Float_t mVtxZ[2];
150  Float_t mVtxR[2];
151  Float_t mVtxXShift, mVtxYShift;
152  Float_t mVpdVzDiff[2];
153  Float_t mRefMult[2];
154  UInt_t mRunIdBins;
155  Double_t mRunIdRange[2];
156 
157  // Track cuts
158  Float_t mMom[2];
159  Float_t mEta[2];
160  Float_t mNHits[2];
161  Float_t mNHitsRatio[2];
162 
164  // Histograms //
166  TH1F* hRefMult;
167  TH1F* hRefMultVtxZ[73];
168  TH1F* hGRefMult;
169  TH1F* hPrimVertNum;
170  TH1F* hPrimVertZ;
171  TH1F* hZdcAdcEast;
172  TH1F* hZdcAdcWest;
173  TH1F* hZdcAdcSum;
174  TH1F* hZdcCoincidenceRate;
175  TH1F* hEpdAdcEast;
176  TH1F* hEpdAdcWest;
177  TH1F* hEpdAdcSum;
178  TH2F* hPrimVertXvsY;
179  TH1F* hPrimVertVpdVzDiff;
180  TH2F* hRefMultVsTofTrayMult;
181  TH2F* hRefMultVsTofMatched;
182  TH2F* hGRefMultVsTofTrayMult;
183  TH2F* hGRefMultVsTofMatched;
184  TH2F* hRefMultVsTofMatch;
185  TH2F* hRefMultVsBemcMatch;
186  TH2F* hRefMultVsZdcCoincidenceRate;
187  TProfile* hRefMultVsRunNumber;
188  TProfile* hGRefMultVsRunNumber;
189  TProfile* hTofTrayMultVsRunNumber;
190  TProfile* hTofMatchedVsRunNumber;
191  TProfile* hZdcAdcSumVsRunNumber;
192  TProfile* hZdcCoincidenceRateVsRunNumber;
193  TProfile* hPrimTrackPtVsRunNumber;
194  TProfile* hPrimTrackNHitsVsRunNumber;
195  TProfile* hPrimTrackDedxVsRunNumber;
196  TProfile* hGlobTrackPtVsRunNumber;
197  TProfile* hGlobTrackNHitsVsRunNumber;
198  TProfile* hGlobTrackDedxVsRunNumber;
199  TProfile* hAvgRefMultVsZdcCoincidenceRate;
200  TProfile* hAvgRefMultVsZdcCoincidenceRateForTrig[4];
201 
202  ClassDef(StCentralityAnalyzer,0)
203 };
204 
205 #endif // StCentralityAnalyzer_h
Allows to read picoDst file(s)
void Clear(Option_t *option="")
User defined functions.
Holds information about track parameters.
Definition: StPicoTrack.h:35
Process and build distributions for centrality determination.
Main class that keeps TClonesArrays with main classes.
Definition: StPicoDst.h:40
Stores global information about the event.
Definition: StPicoEvent.h:24