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;
23 class AliAnalysisNetParticleHelper : public TNamed {
28 * ---------------------------------------------------------------------------------
29 * Constructor / Destructor
30 * ---------------------------------------------------------------------------------
33 AliAnalysisNetParticleHelper();
34 virtual ~AliAnalysisNetParticleHelper();
37 * ---------------------------------------------------------------------------------
39 * ---------------------------------------------------------------------------------
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;}
49 void SetParticleSpecies(AliPID::EParticleType pid) {fParticleSpecies = pid;}
50 void SetControlParticleSpecies(Int_t pdgCode, Bool_t isNeutral, TString name) {
51 fControlParticleCode = pdgCode;
52 fControlParticleIsNeutral = isNeutral;
53 fControlParticleName = name;
56 void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;}
57 void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;}
58 void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;}
61 * ---------------------------------------------------------------------------------
63 * ---------------------------------------------------------------------------------
66 AliPID::EParticleType GetParticleSpecies(){return fParticleSpecies;}
68 TH1F* GetHEventStat0() {return fHEventStat0;}
69 TH1F* GetHEventStat1() {return fHEventStat1;}
70 TH1F* GetHTriggerStat() {return fHTriggerStat;}
71 TH1F* GetHCentralityStat() {return fHCentralityStat;}
73 Int_t GetCentralityBin() {return fCentralityBin;}
74 Float_t GetCentralityPercentile() {return fCentralityPercentile;}
76 Int_t GetControlParticleCode() {return fControlParticleCode;}
77 Bool_t IsControlParticleNeutral() {return fControlParticleIsNeutral;}
78 TString& GetControlParticleName() {return fControlParticleName;}
81 * ---------------------------------------------------------------------------------
83 * ---------------------------------------------------------------------------------
86 /** Initialize Helper */
87 Int_t Initialize(Bool_t isMC);
90 Int_t SetupEvent(AliESDInputHandler *esdHandler, AliMCEvent *mcEvent);
93 * ---------------------------------------------------------------------------------
94 * Event / Trigger Statistics
95 * ---------------------------------------------------------------------------------
98 /** Check if event is triggred */
99 Bool_t IsEventTriggered();
101 /** Fill event cut statistics */
102 Bool_t IsEventRejected();
105 * ---------------------------------------------------------------------------------
106 * Accept Particle Methods - private
107 * ---------------------------------------------------------------------------------
110 /** Check if charged MC particle is accepted for basic parameters */
111 Bool_t IsParticleAcceptedBasicCharged(TParticle *particle, Int_t idxMC);
113 /** Check if neutral MC particle is accepted for basic parameters */
114 Bool_t IsParticleAcceptedBasicNeutral(TParticle *particle, Int_t idxMC);
116 /** Check if MC particle is accepted for Rapidity */
117 Bool_t IsParticleAcceptedRapidity(TParticle *particle, Double_t &yP);
119 /** Check if MC particle is findable tracks */
120 Bool_t IsParticleFindable(Int_t label);
123 * ---------------------------------------------------------------------------------
124 * Accept Track Methods - public
125 * ---------------------------------------------------------------------------------
128 /** Check if track is accepted for basic parameters */
129 Bool_t IsTrackAcceptedBasicCharged(AliESDtrack *track);
131 /** Check if track is accepted for Rapidity */
132 Bool_t IsTrackAcceptedRapidity(AliESDtrack *track, Double_t &yP);
134 /** Check if track is accepted for DCA */
135 Bool_t IsTrackAcceptedDCA(AliESDtrack *track);
137 /** Check if track is accepted for PID */
138 Bool_t IsTrackAcceptedPID(AliESDtrack *track, Double_t *pid);
141 * ---------------------------------------------------------------------------------
143 * ---------------------------------------------------------------------------------
146 /** Update eta corrected TPC pid */
147 void UpdateEtaCorrectedTPCPid();
149 /** Get efficiency correctionf of particle dependent on (eta, phi, pt, centrality) */
150 Double_t GetTrackbyTrackCorrectionFactor(Double_t *aTrack, Int_t flag);
152 /** Method for the correct logarithmic binning of histograms */
153 void BinLogAxis(const THnSparseF *h, Int_t axisNumber);
155 ///////////////////////////////////////////////////////////////////////////////////
159 AliAnalysisNetParticleHelper(const AliAnalysisNetParticleHelper&); // not implemented
160 AliAnalysisNetParticleHelper& operator=(const AliAnalysisNetParticleHelper&); // not implemented
163 * ---------------------------------------------------------------------------------
164 * Initialize - Private
165 * ---------------------------------------------------------------------------------
168 /** Initialize event cut statistics */
169 void InitializeEventStats();
171 /** Initialize trigger statistics */
172 void InitializeTriggerStats();
174 /** Initialize centrality statistics */
175 void InitializeCentralityStats();
177 /** Initialize eta correction maps for TPC pid */
178 Int_t InitializeEtaCorrection(Bool_t isMC);
180 /** Initialize track by track correction matrices */
181 Int_t InitializeTrackbyTrackCorrection();
184 * ---------------------------------------------------------------------------------
185 * Event / Trigger Statistics - private
186 * ---------------------------------------------------------------------------------
189 /** Fill event cut statistics */
190 Bool_t FillEventStats(Int_t *aEventCuts);
193 * ---------------------------------------------------------------------------------
195 * ---------------------------------------------------------------------------------
198 AliESDInputHandler *fESDHandler; //! Ptr to ESD handler
199 AliPIDResponse *fPIDResponse; //! Ptr to PID response Object
200 AliESDEvent *fESD; //! Ptr to ESD event
201 AliMCEvent *fMCEvent; //! Ptr to MC event
202 AliStack *fStack; //! Ptr to stack
204 // =======================================================================
206 Int_t fCentralityBin; // Centrality bin of current event within max centrality bin
207 Float_t fCentralityPercentile; // Centrality percentile of current event
208 // ----------------------------------------------------------------------
209 Int_t fCentralityBinMax; // Max centrality bin to be used
210 Float_t fVertexZMax; // VertexZ cut
211 Float_t fRapidityMax; // Rapidity cut
212 Float_t fMinTrackLengthMC; // Min track length for MC tracks
213 Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0.
214 Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0.
215 // -----------------------------------------------------------------------
216 AliPID::EParticleType fParticleSpecies; // Particle species on basis of AliPID
217 Int_t fControlParticleCode; // PDG code control particle
218 Bool_t fControlParticleIsNeutral; // Is control particle neutral
219 TString fControlParticleName; // Name of control particle
220 // -----------------------------------------------------------------------
221 Float_t fNSigmaMaxTPC; // N Sigma for TPC PID
222 Float_t fNSigmaMaxTOF; // N Sigma for TOF PID
223 Float_t fMinPtForTOFRequired; // Min pt from where TOF is required
225 // =======================================================================
227 TH1F *fHEventStat0; // Event cut statistics
228 TH1F *fHEventStat1; // Event cut statistics - incremental
229 Int_t fHEventStatMax; // Max N cuts to be included in HEventStat
230 // -----------------------------------------------------------------------
231 TH1F *fHTriggerStat; // Trigger statistics
232 Int_t fNTriggers; // N triggers used
233 // -----------------------------------------------------------------------
234 TH1F *fHCentralityStat; // Centrality statistics
235 Int_t fNCentralityBins; // N centrality bins used
237 // =======================================================================
239 TF1 *fEtaCorrFunc; //! Eta correction function for TPC dE/dx
240 THnSparseF ***fCorr0; // Correction matrices for particle / anti-particle
241 THnSparseF ***fCorr1; // Correction matrices [cross section corrected] matrices for particle/ anti-particle
242 // -----------------------------------------------------------------------
244 ClassDef(AliAnalysisNetParticleHelper, 1);