add method to get centrality of the event for a given centrality class, use it in...
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliAnaPartCorrBaseClass.h
CommitLineData
1c5acb87 1#ifndef ALIANAPARTCORRBASECLASS_H
2#define ALIANAPARTCORRBASECLASS_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5/* $Id: $ */
6
c8fe2783 7 //_________________________________________________________________________
8 // Base class for analysis algorithms
9 //-- Author: Gustavo Conesa (INFN-LNF)
5025c139 10//-Add the possibality for event selection analysis based on vertex and multiplicity bins (Yaxian Mao, 10/10/2010)
fbeaf916 11#include <cstdlib>
12
c8fe2783 13 //ROOT
1c5acb87 14class TClonesArray ;
591cc579 15class TObjArray ;
a3aebfff 16#include <TList.h>
1c5acb87 17#include <TObject.h>
0c1383b5 18class TObjString;
1c5acb87 19
c8fe2783 20 //Analysis
f37fa8d2 21class AliVCaloCells;
e6e63685 22#include "AliCaloTrackReader.h"
decca433 23#include "AliCaloPID.h"
24#include "AliFiducialCut.h"
25#include "AliIsolationCut.h"
26#include "AliMCAnalysisUtils.h"
27#include "AliNeutralMesonSelection.h"
8cfc6870 28#include "AliCalorimeterUtils.h"
1c5acb87 29class AliStack ;
30class AliHeader ;
31class AliGenEventHeader ;
a3aebfff 32#include "AliAODPWG4ParticleCorrelation.h"
765d44e7 33class AliEMCALGeoUtils;
34class AliPHOSGeoUtils;
c8fe2783 35#include "AliMixedEvent.h"
eb3e2665 36#include "AliESDCentrality.h"
1c5acb87 37
38class AliAnaPartCorrBaseClass : public TObject {
39
c8fe2783 40public:
477d6cee 41 AliAnaPartCorrBaseClass() ; // default ctor
78219bac 42 virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor
43
c8fe2783 44private:
477d6cee 45 AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor
46 AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment
477d6cee 47
c8fe2783 48public:
f37fa8d2 49
a3aebfff 50 virtual void AddAODParticle(AliAODPWG4Particle part) ;
51
477d6cee 52 virtual void ConnectInputOutputAODBranches();
53
4a745797 54 virtual TList * GetCreateOutputObjects() { return (new TList) ;}
4a745797 55
a3aebfff 56 virtual void AddToHistogramsName(TString add) { fAddToHistogramsName = add; }
57 virtual TString GetAddedHistogramsStringToName() {return fAddToHistogramsName ;}
58
477d6cee 59 virtual void Init() {;}
60 virtual void InitParameters() ;
61
62 virtual void Print(const Option_t * ) const ;
63
64 virtual void MakeAnalysisFillAOD() {;}
65
66 virtual void MakeAnalysisFillHistograms() {;}
f37fa8d2 67
0c1383b5 68 virtual TObjString * GetAnalysisCuts() {return 0x0;}
69
477d6cee 70 virtual Int_t GetDebug() const { return fDebug ; }
71 virtual void SetDebug(Int_t d) { fDebug = d ; }
72
73 virtual Int_t GetEventNumber() const ;
c8fe2783 74
477d6cee 75 virtual AliCaloTrackReader * GetReader() const {return fReader ; }
42dc8e7d 76 virtual void SetReader(AliCaloTrackReader * const reader) { fReader = reader ; }
798a9b04 77
f37fa8d2 78 //Calorimeter helper class access methods
765d44e7 79 AliEMCALGeoUtils * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry(); }
80 AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
c8fe2783 81
e6e63685 82 Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
765d44e7 83 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU);}
b05a14a3 84 Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
765d44e7 85 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent());}
c8fe2783 86 Int_t GetModuleNumber(AliVCluster * cluster) const {
765d44e7 87 return fCaloUtils->GetModuleNumber(cluster);}
f37fa8d2 88
3ff76907 89 //Centrality
90 AliESDCentrality* GetCentrality() const { return fReader->GetCentrality() ;}
91 void SetCentralityClass(TString name) { fCentralityClass = name ;}
92 void SetCentralityOpt(Int_t opt) { fCentralityOpt = opt ;}
93 TString GetCentralityClass() const { return fCentralityClass ;}
94 Int_t GetCentralityPercent() const { return fCentralityOpt ;}
95 Int_t GetEventCentrality() const ;
96
a5cc4f03 97 virtual void Terminate(TList * /*outputList*/) {;}
98
f37fa8d2 99 //analysis AOD branch
477d6cee 100 virtual TClonesArray * GetCreateOutputAODBranch() ;
101 virtual TString GetInputAODName() const {return fInputAODName ; }
102 virtual void SetInputAODName(TString name) { fInputAODName = name; }
103 virtual TString GetOutputAODName() const {return fOutputAODName ; }
104 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
105 virtual Bool_t NewOutputAOD() const {return fNewAOD;}
106 virtual TString GetOutputAODClassName() const {return fOutputAODClassName;}
107 virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; }
765d44e7 108 virtual AliCalorimeterUtils * GetCaloUtils() const {return fCaloUtils ; }
109 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
110
591cc579 111 virtual TString GetAODObjArrayName() const {return fAODObjArrayName;}
112 virtual void SetAODObjArrayName(TString name) {fAODObjArrayName = name; }
c8fe2783 113
477d6cee 114 virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;}
1e86c71e 115 virtual TClonesArray* GetOutputAODBranch() const {if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ;}
42dc8e7d 116 virtual TClonesArray* GetAODBranch(TString aodBranchName) const ;
117
477d6cee 118 virtual TClonesArray* GetAODCaloClusters() const ;
119 virtual TClonesArray* GetAODTracks() const ;
f37fa8d2 120 virtual AliVCaloCells* GetPHOSCells() const {return fReader->GetPHOSCells() ;}
121 virtual AliVCaloCells* GetEMCALCells() const {return fReader->GetEMCALCells() ;}
122
591cc579 123 virtual TObjArray* GetAODCTS() const ;
124 virtual TObjArray* GetAODEMCAL() const ;
125 virtual TObjArray* GetAODPHOS() const ;
477d6cee 126
127 virtual TString GetBaseParametersList();
f37fa8d2 128
477d6cee 129 virtual AliStack * GetMCStack() const ;
130 virtual AliHeader* GetMCHeader() const ;
131 virtual AliGenEventHeader* GetMCGenEventHeader() const ;
132
f37fa8d2 133 //Analysis helpers classes pointers setters and getters
decca433 134 virtual AliCaloPID * GetCaloPID() {if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ;}
42dc8e7d 135 virtual void SetCaloPID(AliCaloPID * const pid) { fCaloPID = pid ;}
477d6cee 136
2ebb9054 137 virtual AliFiducialCut * GetFiducialCut() {if(!fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ;}
ff45398a 138 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFidCut = fc ;}
477d6cee 139
decca433 140 virtual AliIsolationCut * GetIsolationCut() {if(!fIC) fIC = new AliIsolationCut(); return fIC ;}
42dc8e7d 141 virtual void SetIsolationCut(AliIsolationCut * const ic) { fIC = ic ;}
477d6cee 142
decca433 143 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() {if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ;}
42dc8e7d 144 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { fMCUtils = mcutils ;}
477d6cee 145
decca433 146 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() {if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ;}
42dc8e7d 147 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { fNMS = nms ;}
765d44e7 148
1e274f1c 149 virtual Bool_t IsDataMC() {return fDataMC ; }
150 virtual void SwitchOnDataMC() {fDataMC = kTRUE ; if(!fMCUtils)fMCUtils = new AliMCAnalysisUtils();}
decca433 151 virtual void SwitchOffDataMC() {fDataMC = kFALSE ; }
c8fe2783 152
1e274f1c 153 virtual Bool_t IsFiducialCutOn() { return fCheckFidCut ; }
154 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; if(!fFidCut)fFidCut = new AliFiducialCut();}
decca433 155 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE;}
477d6cee 156
1e274f1c 157 virtual Bool_t IsCaloPIDOn() { return fCheckCaloPID ; }
158 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE; if(!fCaloPID)fCaloPID = new AliCaloPID();}
decca433 159 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;}
477d6cee 160
1e274f1c 161 virtual Bool_t IsCaloPIDRecalculationOn() { return fRecalculateCaloPID ; }
decca433 162 virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;}
163 virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;}
477d6cee 164
165 virtual Float_t GetMaxPt() const {return fMaxPt ; }
166 virtual Float_t GetMinPt() const {return fMinPt ; }
decca433 167 virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; }
168 virtual void SetMinPt(Float_t pt) {fMinPt = pt ; }
765d44e7 169 virtual void SetPtCutRange(Double_t ptmin, Double_t ptmax)
477d6cee 170 { fMaxPt=ptmax; fMinPt=ptmin;}
5025c139 171 //Setters for parameters of event buffers
172 virtual void SetMultiBin(Int_t n=1) {fMultiBin=n ;} //number of bins in Multiplicity
173 virtual void SetNZvertBin(Int_t n=1) {fNZvertBin=n ;} //number of bins for vertex position
174 virtual void SetNRPBin(Int_t n=1) {fNrpBin=n ;} //number of bins in reaction plain
175 virtual void SetZvertexCut(Float_t zcut=40.){fZvtxCut=zcut ;} //cut on vertex position
176 virtual void SetMultiplicity(Int_t multimin, Int_t multimax) {fMinMulti = multimin ; fMaxMulti = multimax ; }
177 virtual void SwitchOnEventSelection() {fUseSelectEvent = kTRUE ; }
178 virtual void SwitchOffEventSelection() {fUseSelectEvent = kFALSE ; }
179 //Getters for event selection
180 virtual Int_t GetMultiBin() const {return fMultiBin ;} //number of bins in Multiplicity
181 virtual Int_t GetNZvertBin() const {return fNZvertBin ;} //number of bins in vertex
182 virtual Int_t GetNRPBin() const {return fNrpBin ;} //number of bins in reaction plain
183 //Getters for event selection
184 virtual Float_t GetZvertexCut() const {return fZvtxCut ;} //cut on vertex position
185 virtual Int_t GetMaxMulti() const {return fMaxMulti ; }
186 virtual Int_t GetMinMulti() const {return fMinMulti ; }
187
188 // Do correlation analysis with different event buffers
189 virtual Bool_t DoEventSelect() const {return fUseSelectEvent ; }
477d6cee 190
f37fa8d2 191 //Histogrammes setters and getters
192 //Pt, Energy
477d6cee 193 virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 194 fHistoPtBins = n ;
477d6cee 195 fHistoPtMax = max ;
196 fHistoPtMin = min ;
197 }
198
765d44e7 199 virtual Int_t GetHistoPtBins() const { return fHistoPtBins; }
200 virtual Float_t GetHistoPtMin() const { return fHistoPtMin ; }
201 virtual Float_t GetHistoPtMax() const { return fHistoPtMax ; }
477d6cee 202
c8fe2783 203 //Azimuthal angle
477d6cee 204 virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 205 fHistoPhiBins = n ;
206 fHistoPhiMax = max ;
207 fHistoPhiMin = min ;
477d6cee 208 }
209
765d44e7 210 virtual Int_t GetHistoPhiBins() const { return fHistoPhiBins; }
211 virtual Float_t GetHistoPhiMin() const { return fHistoPhiMin ; }
212 virtual Float_t GetHistoPhiMax() const { return fHistoPhiMax ; }
477d6cee 213
f37fa8d2 214 //Pseudorapidity-rapidity
477d6cee 215 virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 216 fHistoEtaBins = n ;
217 fHistoEtaMax = max ;
218 fHistoEtaMin = min ;
477d6cee 219 }
220
765d44e7 221 virtual Int_t GetHistoEtaBins() const { return fHistoEtaBins; }
222 virtual Float_t GetHistoEtaMin() const { return fHistoEtaMin ; }
223 virtual Float_t GetHistoEtaMax() const { return fHistoEtaMax ; }
5a2dbc3c 224
f37fa8d2 225 //Mass
5a2dbc3c 226 virtual void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 227 fHistoMassBins = n ;
228 fHistoMassMax = max ;
229 fHistoMassMin = min ;
5a2dbc3c 230 }
231
765d44e7 232 virtual Int_t GetHistoMassBins() const { return fHistoMassBins ; }
233 virtual Float_t GetHistoMassMin() const { return fHistoMassMin ; }
234 virtual Float_t GetHistoMassMax() const { return fHistoMassMax ; }
5a2dbc3c 235
f37fa8d2 236 //Asymetry
5a2dbc3c 237 virtual void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 238 fHistoAsymBins = n ;
239 fHistoAsymMax = max ;
240 fHistoAsymMin = min ;
5a2dbc3c 241 }
242
765d44e7 243 virtual Int_t GetHistoAsymmetryBins() const { return fHistoAsymBins ; }
244 virtual Float_t GetHistoAsymmetryMin() const { return fHistoAsymMin ; }
245 virtual Float_t GetHistoAsymmetryMax() const { return fHistoAsymMax ; }
c8fe2783 246
798a9b04 247
248 //VZero
249 virtual void SetHistoV0SignalRangeAndNBins(Int_t min, Int_t max, Int_t n) {
250 fHistoV0SBins = n ;
251 fHistoV0SMax = max ;
252 fHistoV0SMin = min ;
253 }
254
c75defdf 255 virtual Int_t GetHistoV0SignalBins() const { return fHistoV0SBins ; }
256 virtual Int_t GetHistoV0SignalMin() const { return fHistoV0SMin ; }
257 virtual Int_t GetHistoV0SignalMax() const { return fHistoV0SMax ; }
798a9b04 258
259 virtual void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n) {
260 fHistoV0MBins = n ;
261 fHistoV0MMax = max ;
262 fHistoV0MMin = min ;
263 }
264
c75defdf 265 virtual Int_t GetHistoV0MultiplicityBins() const { return fHistoV0MBins ; }
266 virtual Int_t GetHistoV0MultiplicityMin() const { return fHistoV0MMin ; }
267 virtual Int_t GetHistoV0MultiplicityMax() const { return fHistoV0MMax ; }
798a9b04 268
269 virtual void SetHistoTrackMultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n) {
270 fHistoTrMBins = n ;
271 fHistoTrMMax = max ;
272 fHistoTrMMin = min ;
273 }
274
c75defdf 275 virtual Int_t GetHistoTrackMultiplicityBins() const { return fHistoTrMBins ; }
276 virtual Int_t GetHistoTrackMultiplicityMin() const { return fHistoTrMMin ; }
277 virtual Int_t GetHistoTrackMultiplicityMax() const { return fHistoTrMMax ; }
798a9b04 278
f8006433 279 virtual AliMixedEvent * GetMixedEvent() { return GetReader()->GetMixedEvent() ; }
280 virtual Int_t GetNMixedEvent() const { return GetReader()->GetNMixedEvent() ; }
281
282 virtual void GetVertex(Double_t vertex[3]) const { GetReader()->GetVertex(vertex) ; }
283 virtual void GetVertex(Double_t vertex[3],const Int_t evtIndex) const { GetReader()->GetVertex(vertex,evtIndex) ; }
284 virtual Double_t* GetVertex(const Int_t evtIndex) const { return GetReader()->GetVertex(evtIndex) ; }
c8fe2783 285
f2ccb5b8 286 virtual Bool_t IsTrackMatched(const AliVCluster * cluster) const { return fCaloPID->IsTrackMatched(cluster, fCaloUtils); }
f37fa8d2 287
d7c10d78 288 void SwitchOnPlotsMaking() {fMakePlots = kTRUE ;}
289 void SwitchOffPlotsMaking() {fMakePlots = kFALSE ;}
290 Bool_t MakePlotsOn() const {return fMakePlots;}
291
798a9b04 292 //MULTIPLICITY
293 Int_t GetTrackMultiplicity() const {return fReader->GetTrackMultiplicity();}
294 //VZERO
295 Int_t GetV0Signal(Int_t i ) const {return fReader->GetV0Signal(i);}
296 Int_t GetV0Multiplicity(Int_t i ) const {return fReader->GetV0Multiplicity(i);}
297
c8fe2783 298private:
477d6cee 299
798a9b04 300 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
301 Int_t fDebug ; // Debug level
302 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
303 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
304 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
305 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
306 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
307 Int_t fMultiBin ; // Number of bins in event container for multiplicity
308 Int_t fNZvertBin ; // Number of bins in event container for vertex position
309 Int_t fNrpBin ; // Number of bins in event container for reaction plain
310 Float_t fZvtxCut ; // Cut on vertex position
311 Int_t fMaxMulti ; // Maximum multiplicity of particles in the analysis
312 Int_t fMinMulti ; // Maximum multiplicity of particles in the analysis
313 Bool_t fUseSelectEvent ; // Select events based on multiplicity and vertex cuts
314 Bool_t fMakePlots ; // Print plots
d7c10d78 315
591cc579 316
39ffdc47 317 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
477d6cee 318
319 TClonesArray* fInputAODBranch ; //! Selected input particles branch
320 TString fInputAODName ; // Name of input AOD branch;
321 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
322 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
323 TString fOutputAODName ; // Name of output AOD branch;
324 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
3ff76907 325 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
326 TString fAddToHistogramsName;// Add this string to histograms name
327
328 TString fCentralityClass; // Name of selected centrality class
329 Int_t fCentralityOpt; // Option for the returned value of the centrality, possible options 5, 10, 100
477d6cee 330
f37fa8d2 331 //Analysis helper classes access pointers
614701c6 332 AliCaloPID * fCaloPID; //! PID calculation
333 AliFiducialCut * fFidCut; //! Acceptance cuts
334 AliIsolationCut * fIC; //! Isolation cut
335 AliMCAnalysisUtils * fMCUtils; //! MonteCarlo Analysis utils
336 AliNeutralMesonSelection * fNMS; //! Neutral Meson Selection
765d44e7 337 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
f37fa8d2 338
339 //Histograms binning and range
5a2dbc3c 340 Int_t fHistoPtBins ; // Number of bins in pt axis
341 Float_t fHistoPtMax ; // Maximum value of pt histogram range
342 Float_t fHistoPtMin ; // Minimum value of pt histogram range
343 Int_t fHistoPhiBins ; // Number of bins in phi axis
344 Float_t fHistoPhiMax ; // Maximum value of phi histogram range
345 Float_t fHistoPhiMin ; // Minimum value of phi histogram range
346 Int_t fHistoEtaBins ; // Number of bins in eta axis
347 Float_t fHistoEtaMax ; // Maximum value of eta histogram range
348 Float_t fHistoEtaMin ; // Minimum value of eta histogram range
349 Int_t fHistoMassBins ; // Number of bins in mass axis
350 Float_t fHistoMassMax ; // Maximum value of mass histogram range
351 Float_t fHistoMassMin ; // Minimum value of mass histogram range
352 Int_t fHistoAsymBins ; // Number of bins in asymmetry axis
353 Float_t fHistoAsymMax ; // Maximum value of asymmetry histogram range
354 Float_t fHistoAsymMin ; // Minimum value of asymmetry histogram range
798a9b04 355 Int_t fHistoV0SBins ; // Number of bins in V0 signal axis
356 Int_t fHistoV0SMax ; // Maximum value of V0 signal histogram range
357 Int_t fHistoV0SMin ; // Minimum value of V0 signal histogram range
358 Int_t fHistoV0MBins ; // Number of bins in V0 multiplicity axis
359 Int_t fHistoV0MMax ; // Maximum value of V0 multiplicity histogram range
360 Int_t fHistoV0MMin ; // Minimum value of V0 multiplicity histogram range
361 Int_t fHistoTrMBins ; // Number of bins in V0 multiplicity axis
362 Int_t fHistoTrMMax ; // Maximum value of track multiplicity histogram range
363 Int_t fHistoTrMMin ; // Minimum value of track multiplicity histogram range
364
3ff76907 365 ClassDef(AliAnaPartCorrBaseClass,14)
c8fe2783 366} ;
1c5acb87 367
368
369#endif //ALIANAPARTCORRBASECLASS_H
370
371
372