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