1 #ifndef ALIEBYEPIDRATIOHELPER_H
2 #define ALIEBYEPIDRATIOHELPER_H
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 //
13 //=========================================================================//
19 #include "TProfile2D.h"
26 class AliESDtrackCuts;
27 class AliInputEventHandler;
28 class AliESDInputHandler;
29 class AliAODInputHandler;
32 class AliAODMCParticle;
35 class AliEbyEPidRatioHelper : public TNamed {
39 AliEbyEPidRatioHelper();
40 virtual ~AliEbyEPidRatioHelper();
42 void SetCentralityBinMax(Int_t d) {fCentralityBinMax = d;}
43 void SetVertexZMax(Float_t f) {fVertexZMax = f;}
44 void SetRapidityMax(Float_t f) {fRapidityMax = f;}
45 void SetMinTrackLengthMC(Float_t f) {fMinTrackLengthMC = f;}
46 void SetNSigmaMaxCdd(Float_t f) {fNSigmaMaxCdd = f;}
47 void SetNSigmaMaxCzz(Float_t f) {fNSigmaMaxCzz = f;}
48 void SetPIDStrategy(Int_t i) {fPIDStrategy = i;}
49 void SetNSigmaMaxITS(Float_t f) {fNSigmaMaxITS = f;}
50 void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;}
51 void SetNSigmaMaxTPClow(Float_t f) {fNSigmaMaxTPClow = f;}
52 void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;}
53 void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;}
54 void SetMaxPtForTPClow(Float_t f) {fMaxPtForTPClow = f;}
55 void SetNSubSamples(Int_t i) {fSubSamples = i;}
57 TH1F* GetHEventStat0() {return fHEventStat0; }
58 TH1F* GetHEventStat1() {return fHEventStat1; }
59 TH1F* GetHTriggerStat() {return fHTriggerStat; }
60 TH1F* GetHCentralityStat() {return fHCentralityStat; }
61 TH1F* GetHCentralityPercentile() {return fHCentralityPer; }
62 TH1F* GetHCentralityPercentileAll() {return fHCentralityPerAll; }
63 Int_t GetCentralityBin() {return fCentralityBin; }
64 Float_t GetMaxPtForTPClow() {return fMaxPtForTPClow; }
65 Float_t GetRapidityMax() {return fRapidityMax; }
66 Float_t GetPhiMin() {return fPhiMin; }
67 Float_t GetPhiMax() {return fPhiMax; }
68 AliESDtrackCuts* GetESDTrackCuts() {return fESDTrackCuts; }
69 Bool_t GetIsMC() {return fIsMC; }
70 Bool_t GetIsRatio() {return fIsRatio; }
71 Bool_t GetIsPtBin() {return fIsPtBin; }
72 Bool_t GetDetWise() {return fIsDetectorWise ; }
74 Int_t GetAODtrackCutBit() {return fAODtrackCutBit; }
75 AliMCEvent* GetMCEvent() {return fMCEvent; }
76 AliInputEventHandler* GetInputEventHandler() {return fInputEventHandler;}
77 void SetPhiRange(Float_t f1, Float_t f2);
78 Float_t GetCentralityPercentile() {return fCentralityPercentile;}
79 Float_t GetMinPtForTOFRequired() {return fMinPtForTOFRequired;}
80 Int_t GetSubSampleIdx() {return fSubSampleIdx;}
81 Int_t GetNSubSamples() {return fSubSamples;}
82 /** Initialize Helper */
83 Int_t Initialize(AliESDtrackCuts *cuts, Bool_t isMC, Bool_t isRatio, Bool_t isPtBin, Bool_t isDetWise, Int_t trackCutBit, Int_t modeDistCreation);
86 Int_t SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent);
88 /** Check if event is triggred */
89 Bool_t IsEventTriggered();
91 /** Fill event cut statistics */
92 Bool_t IsEventRejected();
94 /** Check if charged MC particle is accepted for basic parameters */
95 Bool_t IsParticleAcceptedBasicCharged(AliVParticle *particle, Int_t idxMC);
97 /** Check if neutral MC particle is accepted for basic parameters */
98 Bool_t IsParticleAcceptedBasicNeutral(AliVParticle *particle, Int_t idxMC);
100 /** Check if MC particle is accepted for Rapidity */
101 Bool_t IsParticleAcceptedRapidity(AliVParticle *particle, Double_t &yP, Int_t gCurPid);
103 /** Check if MC particle is accepted for Phi */
104 Bool_t IsParticleAcceptedPhi(AliVParticle *particle);
106 /** Check if MC particle is findable tracks */
107 Bool_t IsParticleFindable(Int_t label);
109 /** Check if track is accepted for basic parameters */
110 Bool_t IsTrackAcceptedBasicCharged(AliVTrack *track);
112 /** Check if track is accepted for Rapidity */
113 Bool_t IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP, Int_t gCurPid);
115 /** Check if track is accepted for DCA */
116 Bool_t IsTrackAcceptedDCA(AliVTrack *track);
118 /** Check if track is accepted for PID */
119 Bool_t IsTrackAcceptedPID(AliVTrack *track, Double_t *pid, AliPID::EParticleType gCurPid);
121 /** Check if trackis accepted for Phi */
122 Bool_t IsTrackAcceptedPhi(AliVTrack *track);
124 /** Method for the correct logarithmic binning of histograms
125 * and Update MinPtForTOFRequired, using the pT log-scale
127 void BinLogAxis(const THnBase *h, Int_t axisNumber, AliESDtrackCuts* cuts = NULL);
129 // void SetIsRatio(Bool_t b) {fIsRatio = b;}
130 // void SetIsPtBin(Bool_t b) {fIsPtBin = b;}
132 static const Float_t fgkfHistBinWitdthRap; // Histogram std bin width for rapidity/eta
133 static const Float_t fgkfHistBinWitdthPt; // Histogram std bin width for pt
135 static const Float_t fgkfHistRangeCent[]; // Histogram range for centrality
136 static const Int_t fgkfHistNBinsCent; // Histogram N bins for centrality
137 static const Float_t fgkfHistRangeEta[]; // Histogram range for eta
138 static const Int_t fgkfHistNBinsEta; // Histogram N bins for eta
139 static const Float_t fgkfHistRangeRap[]; // Histogram range for rapidity
140 static const Int_t fgkfHistNBinsRap; // Histogram N bins for rapidity
141 static const Float_t fgkfHistRangePhi[]; // Histogram range for phi
142 static const Int_t fgkfHistNBinsPhi; // Histogram N bins for phi
143 static const Float_t fgkfHistRangePt[]; // Histogram range for pt
144 static const Int_t fgkfHistNBinsPt; // Histogram N bins for pt
145 static const Float_t fgkfHistRangeSign[]; // Histogram range for sign
146 static const Int_t fgkfHistNBinsSign; // Histogram N bins for sign
148 static const Char_t* fgkEventNames[]; // Event names
149 static const Char_t* fgkCentralityMaxNames[]; // Centrality names
150 static const Char_t* fgkTriggerNames[]; // Trigger names
151 static const Char_t* fgkCentralityNames[]; // Centrality names
152 static const Char_t* fgkPidName[4];
153 static const Char_t* fgkPidLatex[4][2];
154 static const Char_t* fgkPidTitles[4][2];
158 AliEbyEPidRatioHelper(const AliEbyEPidRatioHelper&); // not implemented
159 AliEbyEPidRatioHelper& operator=(const AliEbyEPidRatioHelper&); // not implemented
161 void InitializeEventStats();
162 void InitializeTriggerStats();
163 void InitializeCentralityStats();
164 Bool_t FillEventStats(Int_t *aEventCuts);
166 Int_t fModeDistCreation; // Dist creation mode : 1 = on | 0 = off
167 AliInputEventHandler *fInputEventHandler; //! Ptr to input event handler (ESD or AOD)
168 AliPIDResponse *fPIDResponse; //! Ptr to PID response Object
169 AliESDEvent *fESD; //! Ptr to ESD event
170 AliESDtrackCuts *fESDTrackCuts; //! Ptr to ESD cuts
171 AliAODEvent *fAOD; //! Ptr to AOD event
172 Int_t fAODtrackCutBit; // Track filter bit for AOD tracks
173 Bool_t fIsMC; // Is MC event
174 AliMCEvent *fMCEvent; //! Ptr to MC event
175 AliStack *fStack; //! Ptr to stack
176 Int_t fCentralityBin; // Centrality bin of current event within max centrality bin
177 Float_t fCentralityPercentile; // Centrality percentile of current event
178 Int_t fCentralityBinMax; // Max centrality bin to be used
179 Float_t fVertexZMax; // VertexZ cut
180 Float_t fRapidityMax; // Rapidity cut
181 Float_t fPhiMin; // Phi min cut
182 Float_t fPhiMax; // Phi max cut
183 Float_t fMinTrackLengthMC; // Min track length for MC tracks
184 Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0.
185 Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0.
187 Int_t fPIDStrategy; // PID Strategy to be used
188 Float_t fNSigmaMaxITS; // N Sigma for ITS PID
189 Float_t fNSigmaMaxTPC; // N Sigma for TPC PID
190 Float_t fNSigmaMaxTPClow; // N Sigma for TPC PID lower part
191 Float_t fNSigmaMaxTOF; // N Sigma for TOF PID
192 Float_t fMinPtForTOFRequired; // Min pt from where TOF is required
193 Float_t fMaxPtForTPClow; // Max pt until TPClow is used
194 TH1F *fHEventStat0; // Event cut statistics
195 TH1F *fHEventStat1; // Event cut statistics - incremental
196 Int_t fHEventStatMax; // Max N cuts to be included in HEventStat
197 TH1F *fHTriggerStat; // Trigger statistics
198 Int_t fNTriggers; // N triggers used
199 TH1F *fHCentralityStat; // Centrality statistics
200 TH1F *fHCentralityPer; // Centrality Percentile
201 TH1F *fHCentralityPerAll; // Centrality Percentile
202 Int_t fNCentralityBins; // N centrality bins used
204 Int_t fSubSamples; // N subsamples
205 TRandom3 *fRandom; // Random generator
206 Int_t fSubSampleIdx; // Subsample idx for current event
208 Bool_t fIsRatio; // Is ratio
209 Bool_t fIsPtBin; // Is Pt Bin
210 Bool_t fIsDetectorWise; // is detector wise
212 ClassDef(AliEbyEPidRatioHelper, 1);