]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/NetParticle/AliAnalysisNetParticleHelper.h
changing correlation loop over tracks in mixing mode (not breaking if N2 gt N1) ...
[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 */
8
9// Helper Class for for NetParticle Distributions
10// Authors: Jochen Thaeder <jochen@thaeder.de>
11
478c95cf 12#include "THnBase.h"
13#include "THn.h"
cb68eb1d 14#include "TParticle.h"
15#include "TH1F.h"
16#include "TF1.h"
17
18class AliESDtrack;
19class AliMCEvent;
20class AliStack;
21class AliPIDResponse;
478c95cf 22class AliInputEventHandler;
cb68eb1d 23class AliESDInputHandler;
9be43c8e 24class AliAODInputHandler;
25class AliAODEvent;
26class AliAODTrack;
27class AliAODMCParticle;
cb68eb1d 28
29class AliAnalysisNetParticleHelper : public TNamed {
30
31 public:
32
33 /*
34 * ---------------------------------------------------------------------------------
35 * Constructor / Destructor
36 * ---------------------------------------------------------------------------------
37 */
38
39 AliAnalysisNetParticleHelper();
40 virtual ~AliAnalysisNetParticleHelper();
41
42 /*
43 * ---------------------------------------------------------------------------------
44 * Setter
45 * ---------------------------------------------------------------------------------
46 */
47
48 void SetCentralityBinMax(Int_t d) {fCentralityBinMax = d;}
49 void SetVertexZMax(Float_t f) {fVertexZMax = f;}
50 void SetRapidityMax(Float_t f) {fRapidityMax = f;}
51 void SetMinTrackLengthMC(Float_t f) {fMinTrackLengthMC = f;}
52 void SetNSigmaMaxCdd(Float_t f) {fNSigmaMaxCdd = f;}
53 void SetNSigmaMaxCzz(Float_t f) {fNSigmaMaxCzz = f;}
54
3aa68b92 55 void SetParticleSpecies(AliPID::EParticleType pid);
cb68eb1d 56 void SetControlParticleSpecies(Int_t pdgCode, Bool_t isNeutral, TString name) {
57 fControlParticleCode = pdgCode;
58 fControlParticleIsNeutral = isNeutral;
59 fControlParticleName = name;
60 }
61
478c95cf 62 void SetUsePID(Bool_t b);
cb68eb1d 63 void SetNSigmaMaxTPC(Float_t f) {fNSigmaMaxTPC = f;}
64 void SetNSigmaMaxTOF(Float_t f) {fNSigmaMaxTOF = f;}
65 void SetMinPtForTOFRequired(Float_t f) {fMinPtForTOFRequired = f;}
66
67 /*
68 * ---------------------------------------------------------------------------------
69 * Getter
70 * ---------------------------------------------------------------------------------
71 */
72
73 AliPID::EParticleType GetParticleSpecies(){return fParticleSpecies;}
3aa68b92 74 TString GetParticleName(Int_t idxPart);
75 TString GetParticleTitle(Int_t idxPart);
76 TString GetParticleTitleLatex(Int_t idxPart);
77 TString GetControlParticleName(Int_t idxPart);
78 TString GetControlParticleTitle(Int_t idxPart);
cb68eb1d 79
80 TH1F* GetHEventStat0() {return fHEventStat0;}
81 TH1F* GetHEventStat1() {return fHEventStat1;}
82 TH1F* GetHTriggerStat() {return fHTriggerStat;}
83 TH1F* GetHCentralityStat() {return fHCentralityStat;}
84
85 Int_t GetCentralityBin() {return fCentralityBin;}
86 Float_t GetCentralityPercentile() {return fCentralityPercentile;}
87
478c95cf 88 Bool_t GetUsePID() {return fUsePID;}
89
cb68eb1d 90 Int_t GetControlParticleCode() {return fControlParticleCode;}
91 Bool_t IsControlParticleNeutral() {return fControlParticleIsNeutral;}
92 TString& GetControlParticleName() {return fControlParticleName;}
93
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
478c95cf 124 /** Check if charged MC particle is accepted for basic parameters
125 NOT possible for AODs (AliAODMCParticle NOT from TParticle) */
cb68eb1d 126 Bool_t IsParticleAcceptedBasicCharged(TParticle *particle, Int_t idxMC);
9be43c8e 127 Bool_t IsParticleAcceptedBasicCharged(AliAODMCParticle *particle);
cb68eb1d 128
478c95cf 129 /** Check if neutral MC particle is accepted for basic parameters
130 NOT possible for AODs (AliAODMCParticle NOT from TParticle) */
cb68eb1d 131 Bool_t IsParticleAcceptedBasicNeutral(TParticle *particle, Int_t idxMC);
9be43c8e 132 Bool_t IsParticleAcceptedBasicNeutral(AliAODMCParticle *particle);
cb68eb1d 133
134 /** Check if MC particle is accepted for Rapidity */
135 Bool_t IsParticleAcceptedRapidity(TParticle *particle, Double_t &yP);
8c6128b7 136 Bool_t IsParticleAcceptedRapidity(AliAODMCParticle *particle, Double_t &yP);
cb68eb1d 137
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
159 /*
160 * ---------------------------------------------------------------------------------
161 * Helper Methods
162 * ---------------------------------------------------------------------------------
163 */
164
165 /** Update eta corrected TPC pid */
166 void UpdateEtaCorrectedTPCPid();
167
168 /** Get efficiency correctionf of particle dependent on (eta, phi, pt, centrality) */
169 Double_t GetTrackbyTrackCorrectionFactor(Double_t *aTrack, Int_t flag);
170
171 /** Method for the correct logarithmic binning of histograms */
478c95cf 172 void BinLogAxis(const THnBase *h, Int_t axisNumber);
cb68eb1d 173
174 ///////////////////////////////////////////////////////////////////////////////////
175
176 private:
177
178 AliAnalysisNetParticleHelper(const AliAnalysisNetParticleHelper&); // not implemented
179 AliAnalysisNetParticleHelper& operator=(const AliAnalysisNetParticleHelper&); // not implemented
180
181 /*
182 * ---------------------------------------------------------------------------------
183 * Initialize - Private
184 * ---------------------------------------------------------------------------------
185 */
186
187 /** Initialize event cut statistics */
188 void InitializeEventStats();
189
190 /** Initialize trigger statistics */
191 void InitializeTriggerStats();
192
193 /** Initialize centrality statistics */
194 void InitializeCentralityStats();
195
196 /** Initialize eta correction maps for TPC pid */
197 Int_t InitializeEtaCorrection(Bool_t isMC);
198
199 /** Initialize track by track correction matrices */
200 Int_t InitializeTrackbyTrackCorrection();
201
202 /*
203 * ---------------------------------------------------------------------------------
204 * Event / Trigger Statistics - private
205 * ---------------------------------------------------------------------------------
206 */
207
208 /** Fill event cut statistics */
209 Bool_t FillEventStats(Int_t *aEventCuts);
210
211 /*
212 * ---------------------------------------------------------------------------------
213 * Members - private
214 * ---------------------------------------------------------------------------------
215 */
478c95cf 216 Int_t fModeDistCreation; // Dist creation mode : 1 = on | 0 = off
cb68eb1d 217
478c95cf 218 AliInputEventHandler *fInputEventHandler; //! Ptr to input event handler (ESD or AOD)
cb68eb1d 219 AliPIDResponse *fPIDResponse; //! Ptr to PID response Object
220 AliESDEvent *fESD; //! Ptr to ESD event
9be43c8e 221 AliAODEvent *fAOD; //! Ptr to AOD event
cb68eb1d 222 AliMCEvent *fMCEvent; //! Ptr to MC event
223 AliStack *fStack; //! Ptr to stack
224
225 // =======================================================================
226
227 Int_t fCentralityBin; // Centrality bin of current event within max centrality bin
228 Float_t fCentralityPercentile; // Centrality percentile of current event
229 // ----------------------------------------------------------------------
230 Int_t fCentralityBinMax; // Max centrality bin to be used
231 Float_t fVertexZMax; // VertexZ cut
232 Float_t fRapidityMax; // Rapidity cut
233 Float_t fMinTrackLengthMC; // Min track length for MC tracks
234 Float_t fNSigmaMaxCdd; // N Sigma for dcar / sqrt(cdd) - turn off with 0.
235 Float_t fNSigmaMaxCzz; // N Sigma for dcaz / sqrt(czz) - turn off with 0.
236 // -----------------------------------------------------------------------
237 AliPID::EParticleType fParticleSpecies; // Particle species on basis of AliPID
3aa68b92 238 TString fPartName[2]; // Particle name (short) - particle/antiparticle
239 TString fPartTitle[2]; // Particle name (long) - particle/antiparticle
240 TString fPartTitleLatex[2]; // Particle name (LATEX) - particle/antiparticle
cb68eb1d 241 Int_t fControlParticleCode; // PDG code control particle
242 Bool_t fControlParticleIsNeutral; // Is control particle neutral
243 TString fControlParticleName; // Name of control particle
244 // -----------------------------------------------------------------------
478c95cf 245 Bool_t fUsePID; // Use PID, default is on
cb68eb1d 246 Float_t fNSigmaMaxTPC; // N Sigma for TPC PID
247 Float_t fNSigmaMaxTOF; // N Sigma for TOF PID
248 Float_t fMinPtForTOFRequired; // Min pt from where TOF is required
249
250 // =======================================================================
251
252 TH1F *fHEventStat0; // Event cut statistics
253 TH1F *fHEventStat1; // Event cut statistics - incremental
254 Int_t fHEventStatMax; // Max N cuts to be included in HEventStat
255 // -----------------------------------------------------------------------
256 TH1F *fHTriggerStat; // Trigger statistics
257 Int_t fNTriggers; // N triggers used
258 // -----------------------------------------------------------------------
259 TH1F *fHCentralityStat; // Centrality statistics
260 Int_t fNCentralityBins; // N centrality bins used
261
262 // =======================================================================
263
264 TF1 *fEtaCorrFunc; //! Eta correction function for TPC dE/dx
478c95cf 265 THnF ***fCorr0; // Correction matrices for particle / anti-particle
266 THnF ***fCorr1; // Correction matrices [cross section corrected] matrices for particle / anti-particle
267 THnF ***fCorr2; // Correction matrices cross section correction matrices only for particle / anti-particle
cb68eb1d 268 // -----------------------------------------------------------------------
269
270 ClassDef(AliAnalysisNetParticleHelper, 1);
271};
272
273#endif