3 #ifndef ALIANALYSISNETPARTICLEHELPER_H
4 #define ALIANALYSISNETPARTICLEHELPER_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 // Helper Class for for NetParticle Distributions
10 // Authors: Jochen Thaeder <jochen@thaeder.de>
12 #include "THnSparse.h"
13 #include "TParticle.h"
21 class AliESDInputHandler;
22 class AliAODInputHandler;
25 class AliAODMCParticle;
27 class AliAnalysisNetParticleHelper : public TNamed {
32 * ---------------------------------------------------------------------------------
33 * Constructor / Destructor
34 * ---------------------------------------------------------------------------------
37 AliAnalysisNetParticleHelper();
38 virtual ~AliAnalysisNetParticleHelper();
41 * ---------------------------------------------------------------------------------
43 * ---------------------------------------------------------------------------------
46 void SetCentralityBinMax(Int_t d) {fCentralityBinMax = d;}
47 void SetVertexZMax(Float_t f) {fVertexZMax = f;}
48 void SetRapidityMax(Float_t f) {fRapidityMax = f;}
49 void SetMinTrackLengthMC(Float_t f) {fMinTrackLengthMC = f;}
50 void SetNSigmaMaxCdd(Float_t f) {fNSigmaMaxCdd = f;}
51 void SetNSigmaMaxCzz(Float_t f) {fNSigmaMaxCzz = f;}
53 void SetParticleSpecies(AliPID::EParticleType pid);
54 void SetControlParticleSpecies(Int_t pdgCode, Bool_t isNeutral, TString name) {
55 fControlParticleCode = pdgCode;
56 fControlParticleIsNeutral = isNeutral;
57 fControlParticleName = name;
60 void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;}
61 void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;}
62 void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;}
65 * ---------------------------------------------------------------------------------
67 * ---------------------------------------------------------------------------------
70 AliPID::EParticleType GetParticleSpecies(){return fParticleSpecies;}
71 TString GetParticleName(Int_t idxPart);
72 TString GetParticleTitle(Int_t idxPart);
73 TString GetParticleTitleLatex(Int_t idxPart);
74 TString GetControlParticleName(Int_t idxPart);
75 TString GetControlParticleTitle(Int_t idxPart);
77 TH1F* GetHEventStat0() {return fHEventStat0;}
78 TH1F* GetHEventStat1() {return fHEventStat1;}
79 TH1F* GetHTriggerStat() {return fHTriggerStat;}
80 TH1F* GetHCentralityStat() {return fHCentralityStat;}
82 Int_t GetCentralityBin() {return fCentralityBin;}
83 Float_t GetCentralityPercentile() {return fCentralityPercentile;}
85 Int_t GetControlParticleCode() {return fControlParticleCode;}
86 Bool_t IsControlParticleNeutral() {return fControlParticleIsNeutral;}
87 TString& GetControlParticleName() {return fControlParticleName;}
90 * ---------------------------------------------------------------------------------
92 * ---------------------------------------------------------------------------------
95 /** Initialize Helper */
96 Int_t Initialize(Bool_t isMC);
99 Int_t SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent);
102 * ---------------------------------------------------------------------------------
103 * Event / Trigger Statistics
104 * ---------------------------------------------------------------------------------
107 /** Check if event is triggred */
108 Bool_t IsEventTriggered();
110 /** Fill event cut statistics */
111 Bool_t IsEventRejected();
114 * ---------------------------------------------------------------------------------
115 * Accept Particle Methods - private
116 * ---------------------------------------------------------------------------------
119 /** Check if charged MC particle is accepted for basic parameters */
120 /** NOT possible for AODs (AliAODMCParticle NOT from TParticle)*/
121 Bool_t IsParticleAcceptedBasicCharged(TParticle *particle, Int_t idxMC);
122 Bool_t IsParticleAcceptedBasicCharged(AliAODMCParticle *particle);
124 /** Check if neutral MC particle is accepted for basic parameters */
125 /** NOT possible for AODs (AliAODMCParticle NOT from TParticle)*/
126 Bool_t IsParticleAcceptedBasicNeutral(TParticle *particle, Int_t idxMC);
127 Bool_t IsParticleAcceptedBasicNeutral(AliAODMCParticle *particle);
129 /** Check if MC particle is accepted for Rapidity */
130 Bool_t IsParticleAcceptedRapidity(TParticle *particle, Double_t &yP);
132 /** Check if MC particle is findable tracks */
133 Bool_t IsParticleFindable(Int_t label);
136 * ---------------------------------------------------------------------------------
137 * Accept Track Methods - public
138 * ---------------------------------------------------------------------------------
141 /** Check if track is accepted for basic parameters */
142 /** NOT possible with AliVTrack (GetInnerParam returns NULL) */
143 Bool_t IsTrackAcceptedBasicCharged(AliESDtrack *track);
144 Bool_t IsTrackAcceptedBasicCharged(AliAODTrack *track);
146 /** Check if track is accepted for Rapidity */
147 Bool_t IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP);
149 /** Check if track is accepted for DCA */
150 Bool_t IsTrackAcceptedDCA(AliESDtrack *track);
152 /** Check if track is accepted for PID */
153 Bool_t IsTrackAcceptedPID(AliVTrack *track, Double_t *pid);
156 * ---------------------------------------------------------------------------------
158 * ---------------------------------------------------------------------------------
161 /** Update eta corrected TPC pid */
162 void UpdateEtaCorrectedTPCPid();
164 /** Get efficiency correctionf of particle dependent on (eta, phi, pt, centrality) */
165 Double_t GetTrackbyTrackCorrectionFactor(Double_t *aTrack, Int_t flag);
167 /** Method for the correct logarithmic binning of histograms */
168 void BinLogAxis(const THnSparseF *h, Int_t axisNumber);
170 ///////////////////////////////////////////////////////////////////////////////////
174 AliAnalysisNetParticleHelper(const AliAnalysisNetParticleHelper&); // not implemented
175 AliAnalysisNetParticleHelper& operator=(const AliAnalysisNetParticleHelper&); // not implemented
178 * ---------------------------------------------------------------------------------
179 * Initialize - Private
180 * ---------------------------------------------------------------------------------
183 /** Initialize event cut statistics */
184 void InitializeEventStats();
186 /** Initialize trigger statistics */
187 void InitializeTriggerStats();
189 /** Initialize centrality statistics */
190 void InitializeCentralityStats();
192 /** Initialize eta correction maps for TPC pid */
193 Int_t InitializeEtaCorrection(Bool_t isMC);
195 /** Initialize track by track correction matrices */
196 Int_t InitializeTrackbyTrackCorrection();
199 * ---------------------------------------------------------------------------------
200 * Event / Trigger Statistics - private
201 * ---------------------------------------------------------------------------------
204 /** Fill event cut statistics */
205 Bool_t FillEventStats(Int_t *aEventCuts);
208 * ---------------------------------------------------------------------------------
210 * ---------------------------------------------------------------------------------
213 AliESDInputHandler *fESDHandler; //! Ptr to ESD handler
214 AliPIDResponse *fPIDResponse; //! Ptr to PID response Object
215 AliESDEvent *fESD; //! Ptr to ESD event
216 AliAODInputHandler *fAODHandler; //! Ptr to AOD handler
217 AliAODEvent *fAOD; //! Ptr to AOD event
218 AliMCEvent *fMCEvent; //! Ptr to MC event
219 AliStack *fStack; //! Ptr to stack
221 // =======================================================================
223 Int_t fCentralityBin; // Centrality bin of current event within max centrality bin
224 Float_t fCentralityPercentile; // Centrality percentile of current event
225 // ----------------------------------------------------------------------
226 Int_t fCentralityBinMax; // Max centrality bin to be used
227 Float_t fVertexZMax; // VertexZ cut
228 Float_t fRapidityMax; // Rapidity cut
229 Float_t fMinTrackLengthMC; // Min track length for MC tracks
230 Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0.
231 Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0.
232 // -----------------------------------------------------------------------
233 AliPID::EParticleType fParticleSpecies; // Particle species on basis of AliPID
234 TString fPartName[2]; // Particle name (short) - particle/antiparticle
235 TString fPartTitle[2]; // Particle name (long) - particle/antiparticle
236 TString fPartTitleLatex[2]; // Particle name (LATEX) - particle/antiparticle
237 Int_t fControlParticleCode; // PDG code control particle
238 Bool_t fControlParticleIsNeutral; // Is control particle neutral
239 TString fControlParticleName; // Name of control particle
240 // -----------------------------------------------------------------------
241 Float_t fNSigmaMaxTPC; // N Sigma for TPC PID
242 Float_t fNSigmaMaxTOF; // N Sigma for TOF PID
243 Float_t fMinPtForTOFRequired; // Min pt from where TOF is required
245 // =======================================================================
247 TH1F *fHEventStat0; // Event cut statistics
248 TH1F *fHEventStat1; // Event cut statistics - incremental
249 Int_t fHEventStatMax; // Max N cuts to be included in HEventStat
250 // -----------------------------------------------------------------------
251 TH1F *fHTriggerStat; // Trigger statistics
252 Int_t fNTriggers; // N triggers used
253 // -----------------------------------------------------------------------
254 TH1F *fHCentralityStat; // Centrality statistics
255 Int_t fNCentralityBins; // N centrality bins used
257 // =======================================================================
259 TF1 *fEtaCorrFunc; //! Eta correction function for TPC dE/dx
260 THnSparseF ***fCorr0; // Correction matrices for particle / anti-particle
261 THnSparseF ***fCorr1; // Correction matrices [cross section corrected] matrices for particle/ anti-particle
262 // -----------------------------------------------------------------------
264 ClassDef(AliAnalysisNetParticleHelper, 1);