]>
Commit | Line | Data |
---|---|---|
0a28d543 | 1 | #ifndef ALIEBYEPIDRATIOHELPER_H |
2 | #define ALIEBYEPIDRATIOHELPER_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | //=========================================================================// | |
7 | // AliEbyE Analysis for Particle Ratio Fluctuation // | |
8 | // Deepika Rathee | Satyajit Jena // | |
9 | // drathee@cern.ch | sjena@cern.ch // | |
10 | // Date: Wed Jul 9 18:38:30 CEST 2014 // | |
11 | // New approch to find particle ratio to reduce memory // | |
12 | // (Test Only) // | |
df4f740f | 13 | // Copied from NetParticle Classes |
14 | // Origin: Authors: Jochen Thaeder <jochen@thaeder.de> | |
15 | // Michael Weber <m.weber@cern.ch> | |
0a28d543 | 16 | //=========================================================================// |
17 | ||
18 | #include "THnBase.h" | |
19 | #include "THn.h" | |
20 | #include "TH1F.h" | |
21 | #include "TF1.h" | |
22 | #include "TProfile2D.h" | |
23 | #include "TRandom3.h" | |
24 | ||
25 | class AliESDtrack; | |
26 | class AliMCEvent; | |
27 | class AliStack; | |
28 | class AliPIDResponse; | |
29 | class AliESDtrackCuts; | |
30 | class AliInputEventHandler; | |
31 | class AliESDInputHandler; | |
32 | class AliAODInputHandler; | |
33 | class AliAODEvent; | |
34 | class AliAODTrack; | |
35 | class AliAODMCParticle; | |
36 | class AliMCParticle; | |
37 | ||
38 | class AliEbyEPidRatioHelper : public TNamed { | |
39 | ||
40 | public: | |
41 | ||
42 | AliEbyEPidRatioHelper(); | |
43 | virtual ~AliEbyEPidRatioHelper(); | |
44 | ||
45 | void SetCentralityBinMax(Int_t d) {fCentralityBinMax = d;} | |
46 | void SetVertexZMax(Float_t f) {fVertexZMax = f;} | |
47 | void SetRapidityMax(Float_t f) {fRapidityMax = f;} | |
48 | void SetMinTrackLengthMC(Float_t f) {fMinTrackLengthMC = f;} | |
49 | void SetNSigmaMaxCdd(Float_t f) {fNSigmaMaxCdd = f;} | |
50 | void SetNSigmaMaxCzz(Float_t f) {fNSigmaMaxCzz = f;} | |
51 | void SetPIDStrategy(Int_t i) {fPIDStrategy = i;} | |
52 | void SetNSigmaMaxITS(Float_t f) {fNSigmaMaxITS = f;} | |
53 | void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;} | |
54 | void SetNSigmaMaxTPClow(Float_t f) {fNSigmaMaxTPClow = f;} | |
55 | void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;} | |
56 | void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;} | |
57 | void SetMaxPtForTPClow(Float_t f) {fMaxPtForTPClow = f;} | |
c3bf3f97 | 58 | void SetNSubSamples(Int_t i) {fSubSamples = i;} |
15bb9247 | 59 | |
1648d22e | 60 | TH1F* GetHEventStat0() {return fHEventStat0; } |
61 | TH1F* GetHEventStat1() {return fHEventStat1; } | |
62 | TH1F* GetHTriggerStat() {return fHTriggerStat; } | |
63 | TH1F* GetHCentralityStat() {return fHCentralityStat; } | |
15bb9247 | 64 | TH1F* GetHCentralityPercentile() {return fHCentralityPer; } |
65 | TH1F* GetHCentralityPercentileAll() {return fHCentralityPerAll; } | |
1648d22e | 66 | Int_t GetCentralityBin() {return fCentralityBin; } |
67 | Float_t GetMaxPtForTPClow() {return fMaxPtForTPClow; } | |
68 | Float_t GetRapidityMax() {return fRapidityMax; } | |
69 | Float_t GetPhiMin() {return fPhiMin; } | |
70 | Float_t GetPhiMax() {return fPhiMax; } | |
71 | AliESDtrackCuts* GetESDTrackCuts() {return fESDTrackCuts; } | |
72 | Bool_t GetIsMC() {return fIsMC; } | |
73 | Bool_t GetIsRatio() {return fIsRatio; } | |
74 | Bool_t GetIsPtBin() {return fIsPtBin; } | |
56a3fc5b | 75 | Bool_t GetDetWise() {return fIsDetectorWise ; } |
76 | ||
5f071dcf | 77 | |
78 | Bool_t GetUsePID(Int_t i) { if (i == 0) return kFALSE; else return kTRUE;} | |
79 | ||
80 | AliPID::EParticleType GetParticleSpecies(Int_t i) { | |
81 | if (i == 0) return AliPID::kUnknown; | |
82 | else if (i == 1) return AliPID::kPion; | |
83 | else if (i == 2) return AliPID::kKaon; | |
84 | else if (i == 3) return AliPID::kProton; | |
85 | else return AliPID::kUnknown; | |
86 | } | |
87 | ||
88 | Int_t GetPdg(Int_t i) { | |
89 | if (i == 0) return 0; | |
90 | else if (i == 1) return 211; | |
91 | else if (i == 2) return 321; | |
92 | else if (i == 3) return 2212; | |
93 | else return 0; | |
94 | } | |
95 | ||
96 | ||
97 | ||
1648d22e | 98 | Int_t GetAODtrackCutBit() {return fAODtrackCutBit; } |
99 | AliMCEvent* GetMCEvent() {return fMCEvent; } | |
100 | AliInputEventHandler* GetInputEventHandler() {return fInputEventHandler;} | |
101 | void SetPhiRange(Float_t f1, Float_t f2); | |
0a28d543 | 102 | Float_t GetCentralityPercentile() {return fCentralityPercentile;} |
0a28d543 | 103 | Float_t GetMinPtForTOFRequired() {return fMinPtForTOFRequired;} |
c3bf3f97 | 104 | Int_t GetSubSampleIdx() {return fSubSampleIdx;} |
105 | Int_t GetNSubSamples() {return fSubSamples;} | |
0a28d543 | 106 | /** Initialize Helper */ |
56a3fc5b | 107 | Int_t Initialize(AliESDtrackCuts *cuts, Bool_t isMC, Bool_t isRatio, Bool_t isPtBin, Bool_t isDetWise, Int_t trackCutBit, Int_t modeDistCreation); |
0a28d543 | 108 | |
109 | /** Setup Event */ | |
110 | Int_t SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent); | |
111 | ||
112 | /** Check if event is triggred */ | |
113 | Bool_t IsEventTriggered(); | |
114 | ||
115 | /** Fill event cut statistics */ | |
116 | Bool_t IsEventRejected(); | |
117 | ||
118 | /** Check if charged MC particle is accepted for basic parameters */ | |
119 | Bool_t IsParticleAcceptedBasicCharged(AliVParticle *particle, Int_t idxMC); | |
120 | ||
121 | /** Check if neutral MC particle is accepted for basic parameters */ | |
122 | Bool_t IsParticleAcceptedBasicNeutral(AliVParticle *particle, Int_t idxMC); | |
123 | ||
124 | /** Check if MC particle is accepted for Rapidity */ | |
125 | Bool_t IsParticleAcceptedRapidity(AliVParticle *particle, Double_t &yP, Int_t gCurPid); | |
126 | ||
127 | /** Check if MC particle is accepted for Phi */ | |
128 | Bool_t IsParticleAcceptedPhi(AliVParticle *particle); | |
129 | ||
130 | /** Check if MC particle is findable tracks */ | |
131 | Bool_t IsParticleFindable(Int_t label); | |
132 | ||
133 | /** Check if track is accepted for basic parameters */ | |
134 | Bool_t IsTrackAcceptedBasicCharged(AliVTrack *track); | |
135 | ||
136 | /** Check if track is accepted for Rapidity */ | |
137 | Bool_t IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP, Int_t gCurPid); | |
138 | ||
139 | /** Check if track is accepted for DCA */ | |
140 | Bool_t IsTrackAcceptedDCA(AliVTrack *track); | |
141 | ||
142 | /** Check if track is accepted for PID */ | |
143 | Bool_t IsTrackAcceptedPID(AliVTrack *track, Double_t *pid, AliPID::EParticleType gCurPid); | |
144 | ||
145 | /** Check if trackis accepted for Phi */ | |
146 | Bool_t IsTrackAcceptedPhi(AliVTrack *track); | |
f7ea34d2 | 147 | |
0a28d543 | 148 | /** Method for the correct logarithmic binning of histograms |
149 | * and Update MinPtForTOFRequired, using the pT log-scale | |
150 | */ | |
151 | void BinLogAxis(const THnBase *h, Int_t axisNumber, AliESDtrackCuts* cuts = NULL); | |
152 | ||
15bb9247 | 153 | // void SetIsRatio(Bool_t b) {fIsRatio = b;} |
154 | // void SetIsPtBin(Bool_t b) {fIsPtBin = b;} | |
155 | ||
0a28d543 | 156 | static const Float_t fgkfHistBinWitdthRap; // Histogram std bin width for rapidity/eta |
157 | static const Float_t fgkfHistBinWitdthPt; // Histogram std bin width for pt | |
158 | ||
159 | static const Float_t fgkfHistRangeCent[]; // Histogram range for centrality | |
160 | static const Int_t fgkfHistNBinsCent; // Histogram N bins for centrality | |
161 | static const Float_t fgkfHistRangeEta[]; // Histogram range for eta | |
162 | static const Int_t fgkfHistNBinsEta; // Histogram N bins for eta | |
163 | static const Float_t fgkfHistRangeRap[]; // Histogram range for rapidity | |
164 | static const Int_t fgkfHistNBinsRap; // Histogram N bins for rapidity | |
165 | static const Float_t fgkfHistRangePhi[]; // Histogram range for phi | |
166 | static const Int_t fgkfHistNBinsPhi; // Histogram N bins for phi | |
167 | static const Float_t fgkfHistRangePt[]; // Histogram range for pt | |
168 | static const Int_t fgkfHistNBinsPt; // Histogram N bins for pt | |
169 | static const Float_t fgkfHistRangeSign[]; // Histogram range for sign | |
170 | static const Int_t fgkfHistNBinsSign; // Histogram N bins for sign | |
171 | ||
172 | static const Char_t* fgkEventNames[]; // Event names | |
173 | static const Char_t* fgkCentralityMaxNames[]; // Centrality names | |
174 | static const Char_t* fgkTriggerNames[]; // Trigger names | |
175 | static const Char_t* fgkCentralityNames[]; // Centrality names | |
0e335498 | 176 | static const Char_t* fgkPidName[4]; // |
177 | static const Char_t* fgkPidLatex[4][2];// | |
178 | static const Char_t* fgkPidShLatex[4];// | |
179 | static const Char_t* fgkPidTitles[4][2];// | |
0a28d543 | 180 | |
0e335498 | 181 | |
182 | static const Char_t *fgkNetHistName[4]; // | |
183 | static const Char_t *fgkNetHistLatex[4]; // | |
184 | static const Int_t fgkfNetHistBin[4][4]; // | |
185 | ||
186 | ||
187 | ||
188 | ||
0a28d543 | 189 | private: |
190 | ||
191 | AliEbyEPidRatioHelper(const AliEbyEPidRatioHelper&); // not implemented | |
192 | AliEbyEPidRatioHelper& operator=(const AliEbyEPidRatioHelper&); // not implemented | |
193 | ||
194 | void InitializeEventStats(); | |
195 | void InitializeTriggerStats(); | |
196 | void InitializeCentralityStats(); | |
197 | Bool_t FillEventStats(Int_t *aEventCuts); | |
198 | ||
199 | Int_t fModeDistCreation; // Dist creation mode : 1 = on | 0 = off | |
200 | AliInputEventHandler *fInputEventHandler; //! Ptr to input event handler (ESD or AOD) | |
201 | AliPIDResponse *fPIDResponse; //! Ptr to PID response Object | |
202 | AliESDEvent *fESD; //! Ptr to ESD event | |
203 | AliESDtrackCuts *fESDTrackCuts; //! Ptr to ESD cuts | |
204 | AliAODEvent *fAOD; //! Ptr to AOD event | |
205 | Int_t fAODtrackCutBit; // Track filter bit for AOD tracks | |
206 | Bool_t fIsMC; // Is MC event | |
207 | AliMCEvent *fMCEvent; //! Ptr to MC event | |
208 | AliStack *fStack; //! Ptr to stack | |
209 | Int_t fCentralityBin; // Centrality bin of current event within max centrality bin | |
210 | Float_t fCentralityPercentile; // Centrality percentile of current event | |
211 | Int_t fCentralityBinMax; // Max centrality bin to be used | |
212 | Float_t fVertexZMax; // VertexZ cut | |
213 | Float_t fRapidityMax; // Rapidity cut | |
214 | Float_t fPhiMin; // Phi min cut | |
215 | Float_t fPhiMax; // Phi max cut | |
216 | Float_t fMinTrackLengthMC; // Min track length for MC tracks | |
217 | Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0. | |
218 | Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0. | |
219 | ||
220 | Int_t fPIDStrategy; // PID Strategy to be used | |
221 | Float_t fNSigmaMaxITS; // N Sigma for ITS PID | |
222 | Float_t fNSigmaMaxTPC; // N Sigma for TPC PID | |
223 | Float_t fNSigmaMaxTPClow; // N Sigma for TPC PID lower part | |
224 | Float_t fNSigmaMaxTOF; // N Sigma for TOF PID | |
225 | Float_t fMinPtForTOFRequired; // Min pt from where TOF is required | |
226 | Float_t fMaxPtForTPClow; // Max pt until TPClow is used | |
227 | TH1F *fHEventStat0; // Event cut statistics | |
228 | TH1F *fHEventStat1; // Event cut statistics - incremental | |
229 | Int_t fHEventStatMax; // Max N cuts to be included in HEventStat | |
230 | TH1F *fHTriggerStat; // Trigger statistics | |
231 | Int_t fNTriggers; // N triggers used | |
232 | TH1F *fHCentralityStat; // Centrality statistics | |
15bb9247 | 233 | TH1F *fHCentralityPer; // Centrality Percentile |
234 | TH1F *fHCentralityPerAll; // Centrality Percentile | |
0a28d543 | 235 | Int_t fNCentralityBins; // N centrality bins used |
c3bf3f97 | 236 | |
237 | Int_t fSubSamples; // N subsamples | |
0a28d543 | 238 | TRandom3 *fRandom; // Random generator |
c3bf3f97 | 239 | Int_t fSubSampleIdx; // Subsample idx for current event |
240 | ||
1648d22e | 241 | Bool_t fIsRatio; // Is ratio |
242 | Bool_t fIsPtBin; // Is Pt Bin | |
56a3fc5b | 243 | Bool_t fIsDetectorWise; // is detector wise |
0a28d543 | 244 | |
245 | ClassDef(AliEbyEPidRatioHelper, 1); | |
246 | }; | |
247 | ||
248 | #endif |