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