]>
Commit | Line | Data |
---|---|---|
cb68eb1d | 1 | //-*- Mode: C++ -*- |
2 | ||
3 | #ifndef ALIANALYSISNETPARTICLEHELPER_H | |
4 | #define ALIANALYSISNETPARTICLEHELPER_H | |
5 | ||
6 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
7 | * See cxx source for full Copyright notice */ | |
4918c45f | 8 | |
9 | /** | |
a2ddc3d0 | 10 | * Class for NetParticle Distributions |
4918c45f | 11 | * -- Helper class for net particle istributions |
12 | * Authors: Jochen Thaeder <jochen@thaeder.de> | |
13 | * Michael Weber <m.weber@cern.ch> | |
14 | */ | |
cb68eb1d | 15 | |
478c95cf | 16 | #include "THnBase.h" |
17 | #include "THn.h" | |
cb68eb1d | 18 | #include "TH1F.h" |
19 | #include "TF1.h" | |
a2ddc3d0 | 20 | #include "TProfile2D.h" |
21 | #include "TRandom3.h" | |
cb68eb1d | 22 | |
23 | class AliESDtrack; | |
24 | class AliMCEvent; | |
25 | class AliStack; | |
26 | class AliPIDResponse; | |
a2ddc3d0 | 27 | class AliESDtrackCuts; |
478c95cf | 28 | class AliInputEventHandler; |
cb68eb1d | 29 | class AliESDInputHandler; |
9be43c8e | 30 | class AliAODInputHandler; |
31 | class AliAODEvent; | |
32 | class AliAODTrack; | |
33 | class AliAODMCParticle; | |
fbb73c19 | 34 | class AliMCParticle; |
cb68eb1d | 35 | |
36 | class AliAnalysisNetParticleHelper : public TNamed { | |
37 | ||
38 | public: | |
39 | ||
40 | /* | |
41 | * --------------------------------------------------------------------------------- | |
42 | * Constructor / Destructor | |
43 | * --------------------------------------------------------------------------------- | |
44 | */ | |
45 | ||
46 | AliAnalysisNetParticleHelper(); | |
47 | virtual ~AliAnalysisNetParticleHelper(); | |
48 | ||
49 | /* | |
50 | * --------------------------------------------------------------------------------- | |
51 | * Setter | |
52 | * --------------------------------------------------------------------------------- | |
53 | */ | |
54 | ||
55 | void SetCentralityBinMax(Int_t d) {fCentralityBinMax = d;} | |
56 | void SetVertexZMax(Float_t f) {fVertexZMax = f;} | |
57 | void SetRapidityMax(Float_t f) {fRapidityMax = f;} | |
58 | void SetMinTrackLengthMC(Float_t f) {fMinTrackLengthMC = f;} | |
59 | void SetNSigmaMaxCdd(Float_t f) {fNSigmaMaxCdd = f;} | |
60 | void SetNSigmaMaxCzz(Float_t f) {fNSigmaMaxCzz = f;} | |
5de3d4d1 | 61 | |
62 | void SetPhiRange(Float_t f1, Float_t f2); | |
cb68eb1d | 63 | |
3aa68b92 | 64 | void SetParticleSpecies(AliPID::EParticleType pid); |
cb68eb1d | 65 | |
478c95cf | 66 | void SetUsePID(Bool_t b); |
a2ddc3d0 | 67 | void SetPIDStrategy(Int_t i) {fPIDStrategy = i;} |
68 | void SetNSigmaMaxITS(Float_t f) {fNSigmaMaxITS = f;} | |
cb68eb1d | 69 | void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;} |
a2ddc3d0 | 70 | void SetNSigmaMaxTPClow(Float_t f) {fNSigmaMaxTPClow = f;} |
cb68eb1d | 71 | void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;} |
72 | void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;} | |
a2ddc3d0 | 73 | void SetMaxPtForTPClow(Float_t f) {fMaxPtForTPClow = f;} |
74 | ||
75 | void SetNSubSamples(Int_t i) {fNSubSamples = i;} | |
cb68eb1d | 76 | |
77 | /* | |
78 | * --------------------------------------------------------------------------------- | |
79 | * Getter | |
80 | * --------------------------------------------------------------------------------- | |
81 | */ | |
82 | ||
a2ddc3d0 | 83 | AliPID::EParticleType GetParticleSpecies() {return fParticleSpecies;} |
3aa68b92 | 84 | TString GetParticleName(Int_t idxPart); |
85 | TString GetParticleTitle(Int_t idxPart); | |
86 | TString GetParticleTitleLatex(Int_t idxPart); | |
cb68eb1d | 87 | |
a2ddc3d0 | 88 | TH1F* GetHEventStat0() {return fHEventStat0;} |
89 | TH1F* GetHEventStat1() {return fHEventStat1;} | |
90 | TH1F* GetHTriggerStat() {return fHTriggerStat;} | |
91 | TH1F* GetHCentralityStat() {return fHCentralityStat;} | |
92 | ||
93 | Int_t GetCentralityBin() {return fCentralityBin;} | |
94 | Float_t GetCentralityPercentile() {return fCentralityPercentile;} | |
cb68eb1d | 95 | |
a2ddc3d0 | 96 | Bool_t GetUsePID() {return fUsePID;} |
97 | ||
98 | Float_t GetMinPtForTOFRequired() {return fMinPtForTOFRequired;} | |
99 | Float_t GetMaxPtForTPClow() {return fMaxPtForTPClow;} | |
100 | Float_t GetRapidityMax() {return fRapidityMax;} | |
101 | Float_t GetPhiMin() {return fPhiMin;} | |
102 | Float_t GetPhiMax() {return fPhiMax;} | |
103 | ||
104 | AliESDtrackCuts* GetESDTrackCuts() {return fESDTrackCuts;} | |
105 | Bool_t GetIsMC() {return fIsMC;} | |
106 | Int_t GetAODtrackCutBit() {return fAODtrackCutBit;} | |
cb68eb1d | 107 | |
a2ddc3d0 | 108 | AliInputEventHandler* GetInputEventHandler() {return fInputEventHandler;} |
109 | AliMCEvent* GetMCEvent() {return fMCEvent;} | |
478c95cf | 110 | |
a2ddc3d0 | 111 | Int_t GetSubSampleIdx() {return fSubSampleIdx;} |
112 | Int_t GetNSubSamples() {return fNSubSamples;} | |
d76957cf | 113 | |
cb68eb1d | 114 | /* |
115 | * --------------------------------------------------------------------------------- | |
116 | * Public Methods | |
117 | * --------------------------------------------------------------------------------- | |
118 | */ | |
119 | ||
120 | /** Initialize Helper */ | |
a2ddc3d0 | 121 | Int_t Initialize(AliESDtrackCuts *cuts, Bool_t isMC, Int_t trackCutBit, Int_t modeDistCreation); |
cb68eb1d | 122 | |
123 | /** Setup Event */ | |
9be43c8e | 124 | Int_t SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent); |
cb68eb1d | 125 | |
126 | /* | |
127 | * --------------------------------------------------------------------------------- | |
128 | * Event / Trigger Statistics | |
129 | * --------------------------------------------------------------------------------- | |
130 | */ | |
131 | ||
132 | /** Check if event is triggred */ | |
133 | Bool_t IsEventTriggered(); | |
134 | ||
135 | /** Fill event cut statistics */ | |
136 | Bool_t IsEventRejected(); | |
137 | ||
138 | /* | |
139 | * --------------------------------------------------------------------------------- | |
140 | * Accept Particle Methods - private | |
141 | * --------------------------------------------------------------------------------- | |
142 | */ | |
143 | ||
fbb73c19 | 144 | /** Check if charged MC particle is accepted for basic parameters */ |
145 | Bool_t IsParticleAcceptedBasicCharged(AliVParticle *particle, Int_t idxMC); | |
146 | ||
147 | /** Check if neutral MC particle is accepted for basic parameters */ | |
148 | Bool_t IsParticleAcceptedBasicNeutral(AliVParticle *particle, Int_t idxMC); | |
cb68eb1d | 149 | |
150 | /** Check if MC particle is accepted for Rapidity */ | |
fbb73c19 | 151 | Bool_t IsParticleAcceptedRapidity(AliVParticle *particle, Double_t &yP); |
cb68eb1d | 152 | |
4918c45f | 153 | /** Check if MC particle is accepted for Phi */ |
fbb73c19 | 154 | Bool_t IsParticleAcceptedPhi(AliVParticle *particle); |
4918c45f | 155 | |
cb68eb1d | 156 | /** Check if MC particle is findable tracks */ |
157 | Bool_t IsParticleFindable(Int_t label); | |
158 | ||
159 | /* | |
160 | * --------------------------------------------------------------------------------- | |
161 | * Accept Track Methods - public | |
162 | * --------------------------------------------------------------------------------- | |
163 | */ | |
164 | ||
165 | /** Check if track is accepted for basic parameters */ | |
478c95cf | 166 | Bool_t IsTrackAcceptedBasicCharged(AliVTrack *track); |
cb68eb1d | 167 | |
168 | /** Check if track is accepted for Rapidity */ | |
9be43c8e | 169 | Bool_t IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP); |
cb68eb1d | 170 | |
171 | /** Check if track is accepted for DCA */ | |
478c95cf | 172 | Bool_t IsTrackAcceptedDCA(AliVTrack *track); |
cb68eb1d | 173 | |
174 | /** Check if track is accepted for PID */ | |
9be43c8e | 175 | Bool_t IsTrackAcceptedPID(AliVTrack *track, Double_t *pid); |
cb68eb1d | 176 | |
4918c45f | 177 | /** Check if trackis accepted for Phi */ |
178 | Bool_t IsTrackAcceptedPhi(AliVTrack *track); | |
179 | ||
cb68eb1d | 180 | /* |
181 | * --------------------------------------------------------------------------------- | |
182 | * Helper Methods | |
183 | * --------------------------------------------------------------------------------- | |
184 | */ | |
cb68eb1d | 185 | |
4918c45f | 186 | /** Method for the correct logarithmic binning of histograms |
187 | * and Update MinPtForTOFRequired, using the pT log-scale | |
188 | */ | |
a2ddc3d0 | 189 | void BinLogAxis(const THnBase *h, Int_t axisNumber, AliESDtrackCuts* cuts = NULL); |
cb68eb1d | 190 | |
4918c45f | 191 | /* |
192 | * --------------------------------------------------------------------------------- | |
193 | * Static Const Members - public | |
194 | * --------------------------------------------------------------------------------- | |
195 | */ | |
196 | ||
197 | static const Float_t fgkfHistBinWitdthRap; // Histogram std bin width for rapidity/eta | |
198 | static const Float_t fgkfHistBinWitdthPt; // Histogram std bin width for pt | |
199 | ||
200 | static const Float_t fgkfHistRangeCent[]; // Histogram range for centrality | |
201 | static const Int_t fgkfHistNBinsCent; // Histogram N bins for centrality | |
202 | static const Float_t fgkfHistRangeEta[]; // Histogram range for eta | |
203 | static const Int_t fgkfHistNBinsEta; // Histogram N bins for eta | |
204 | static const Float_t fgkfHistRangeRap[]; // Histogram range for rapidity | |
205 | static const Int_t fgkfHistNBinsRap; // Histogram N bins for rapidity | |
206 | static const Float_t fgkfHistRangePhi[]; // Histogram range for phi | |
207 | static const Int_t fgkfHistNBinsPhi; // Histogram N bins for phi | |
208 | static const Float_t fgkfHistRangePt[]; // Histogram range for pt | |
209 | static const Int_t fgkfHistNBinsPt; // Histogram N bins for pt | |
210 | static const Float_t fgkfHistRangeSign[]; // Histogram range for sign | |
211 | static const Int_t fgkfHistNBinsSign; // Histogram N bins for sign | |
212 | ||
213 | static const Char_t* fgkEventNames[]; // Event names | |
214 | static const Char_t* fgkCentralityMaxNames[]; // Centrality names | |
215 | static const Char_t* fgkTriggerNames[]; // Trigger names | |
216 | static const Char_t* fgkCentralityNames[]; // Centrality names | |
217 | ||
218 | ||
cb68eb1d | 219 | /////////////////////////////////////////////////////////////////////////////////// |
220 | ||
221 | private: | |
222 | ||
223 | AliAnalysisNetParticleHelper(const AliAnalysisNetParticleHelper&); // not implemented | |
224 | AliAnalysisNetParticleHelper& operator=(const AliAnalysisNetParticleHelper&); // not implemented | |
225 | ||
226 | /* | |
227 | * --------------------------------------------------------------------------------- | |
228 | * Initialize - Private | |
229 | * --------------------------------------------------------------------------------- | |
230 | */ | |
231 | ||
232 | /** Initialize event cut statistics */ | |
233 | void InitializeEventStats(); | |
234 | ||
235 | /** Initialize trigger statistics */ | |
236 | void InitializeTriggerStats(); | |
237 | ||
238 | /** Initialize centrality statistics */ | |
239 | void InitializeCentralityStats(); | |
240 | ||
cb68eb1d | 241 | /* |
242 | * --------------------------------------------------------------------------------- | |
243 | * Event / Trigger Statistics - private | |
244 | * --------------------------------------------------------------------------------- | |
245 | */ | |
246 | ||
247 | /** Fill event cut statistics */ | |
248 | Bool_t FillEventStats(Int_t *aEventCuts); | |
249 | ||
250 | /* | |
251 | * --------------------------------------------------------------------------------- | |
252 | * Members - private | |
253 | * --------------------------------------------------------------------------------- | |
254 | */ | |
478c95cf | 255 | Int_t fModeDistCreation; // Dist creation mode : 1 = on | 0 = off |
5de3d4d1 | 256 | // ======================================================================= |
478c95cf | 257 | AliInputEventHandler *fInputEventHandler; //! Ptr to input event handler (ESD or AOD) |
cb68eb1d | 258 | AliPIDResponse *fPIDResponse; //! Ptr to PID response Object |
259 | AliESDEvent *fESD; //! Ptr to ESD event | |
a2ddc3d0 | 260 | AliESDtrackCuts *fESDTrackCuts; //! Ptr to ESD cuts |
9be43c8e | 261 | AliAODEvent *fAOD; //! Ptr to AOD event |
a2ddc3d0 | 262 | Int_t fAODtrackCutBit; // Track filter bit for AOD tracks |
263 | Bool_t fIsMC; // Is MC event | |
cb68eb1d | 264 | AliMCEvent *fMCEvent; //! Ptr to MC event |
265 | AliStack *fStack; //! Ptr to stack | |
cb68eb1d | 266 | // ======================================================================= |
cb68eb1d | 267 | Int_t fCentralityBin; // Centrality bin of current event within max centrality bin |
268 | Float_t fCentralityPercentile; // Centrality percentile of current event | |
269 | // ---------------------------------------------------------------------- | |
270 | Int_t fCentralityBinMax; // Max centrality bin to be used | |
271 | Float_t fVertexZMax; // VertexZ cut | |
272 | Float_t fRapidityMax; // Rapidity cut | |
4918c45f | 273 | Float_t fPhiMin; // Phi min cut |
274 | Float_t fPhiMax; // Phi max cut | |
cb68eb1d | 275 | Float_t fMinTrackLengthMC; // Min track length for MC tracks |
276 | Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0. | |
277 | Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0. | |
278 | // ----------------------------------------------------------------------- | |
279 | AliPID::EParticleType fParticleSpecies; // Particle species on basis of AliPID | |
3aa68b92 | 280 | TString fPartName[2]; // Particle name (short) - particle/antiparticle |
281 | TString fPartTitle[2]; // Particle name (long) - particle/antiparticle | |
5de3d4d1 | 282 | TString fPartTitleLatex[2]; // Particle title (LATEX) - particle/antiparticle |
cb68eb1d | 283 | // ----------------------------------------------------------------------- |
478c95cf | 284 | Bool_t fUsePID; // Use PID, default is on |
a2ddc3d0 | 285 | Int_t fPIDStrategy; // PID Strategy to be used |
286 | Float_t fNSigmaMaxITS; // N Sigma for ITS PID | |
cb68eb1d | 287 | Float_t fNSigmaMaxTPC; // N Sigma for TPC PID |
a2ddc3d0 | 288 | Float_t fNSigmaMaxTPClow; // N Sigma for TPC PID lower part |
cb68eb1d | 289 | Float_t fNSigmaMaxTOF; // N Sigma for TOF PID |
290 | Float_t fMinPtForTOFRequired; // Min pt from where TOF is required | |
a2ddc3d0 | 291 | Float_t fMaxPtForTPClow; // Max pt until TPClow is used |
cb68eb1d | 292 | // ======================================================================= |
cb68eb1d | 293 | TH1F *fHEventStat0; // Event cut statistics |
294 | TH1F *fHEventStat1; // Event cut statistics - incremental | |
295 | Int_t fHEventStatMax; // Max N cuts to be included in HEventStat | |
296 | // ----------------------------------------------------------------------- | |
297 | TH1F *fHTriggerStat; // Trigger statistics | |
298 | Int_t fNTriggers; // N triggers used | |
299 | // ----------------------------------------------------------------------- | |
300 | TH1F *fHCentralityStat; // Centrality statistics | |
301 | Int_t fNCentralityBins; // N centrality bins used | |
cb68eb1d | 302 | // ======================================================================= |
a2ddc3d0 | 303 | Int_t fNSubSamples; // N subsamples |
304 | Int_t fSubSampleIdx; // Subsample idx for current event | |
305 | TRandom3 *fRandom; // Random generator | |
cb68eb1d | 306 | |
307 | ClassDef(AliAnalysisNetParticleHelper, 1); | |
308 | }; | |
309 | ||
310 | #endif |