]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrBase/AliAnaCaloTrackCorrBaseClass.h
Rename base classes from PartCorr to CaloTrackCorr, agreed new naming and directory...
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliAnaCaloTrackCorrBaseClass.h
CommitLineData
f15155ed 1#ifndef ALIANACALOTRACKCORRBASECLASS_H
2#define ALIANACALOTRACKCORRBASECLASS_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//_________________________________________________________________________
7// Base class for CaloTrackCorr analysis algorithms
8//-- Author: Gustavo Conesa (INFN-LNF, LPSC-Grenoble)
9//-- Add the possibility for event selection analysis based on
10// vertex and multiplicity bins (Yaxian Mao, 10/10/2010)
11//
12//_________________________________________________________________________
13
14#include <cstdlib>
15
16//ROOT
17class TClonesArray ;
18class TObjArray ;
19#include <TList.h>
20#include <TObject.h>
21class TObjString;
22
23//Analysis
24class AliVCaloCells;
25#include "AliCaloTrackReader.h"
26#include "AliCaloPID.h"
27#include "AliFiducialCut.h"
28#include "AliIsolationCut.h"
29#include "AliMCAnalysisUtils.h"
30#include "AliNeutralMesonSelection.h"
31#include "AliCalorimeterUtils.h"
32#include "AliHistogramRanges.h"
33class AliStack ;
34class AliHeader ;
35class AliGenEventHeader ;
36#include "AliAODPWG4ParticleCorrelation.h"
37class AliEMCALGeometry;
38class AliPHOSGeoUtils;
39#include "AliMixedEvent.h"
40#include "AliCentrality.h"
41#include "AliEventplane.h"
42
43class AliAnaCaloTrackCorrBaseClass : public TObject {
44
45public:
46 AliAnaCaloTrackCorrBaseClass() ; // default ctor
47 virtual ~AliAnaCaloTrackCorrBaseClass() ; // virtual dtor
48
49 //General methods, to be declared in deriving classes if needed
50
51 virtual TList * GetCreateOutputObjects() { return (new TList) ; }
52
53 virtual void Init() {;}
54 virtual void InitParameters() ;
55
56 virtual void MakeAnalysisFillAOD() { ; }
57
58 virtual void MakeAnalysisFillHistograms() { ; }
59
60 virtual void Print(const Option_t * ) const ;
61
62 virtual void Terminate(TList * /*outputList*/) { ; }
63
64 //Histograms, cuts
65
66 virtual void AddToHistogramsName(TString add) { fAddToHistogramsName = add ; }
67 virtual TString GetAddedHistogramsStringToName() const { return fAddToHistogramsName ; }
68
69 virtual TObjString * GetAnalysisCuts() { return 0x0 ; }
70 virtual TString GetBaseParametersList();
71
72 //Getters, setters
73 virtual Int_t GetDebug() const { return fDebug ; }
74 virtual void SetDebug(Int_t d) { fDebug = d ; }
75
76 virtual Int_t GetEventNumber() const ;
77
78 //Centrality
79 virtual AliCentrality* GetCentrality() const { return fReader->GetCentrality() ; }
80 virtual Int_t GetEventCentrality() const { return fReader->GetEventCentrality() ; }
81
82 //Event plane
83 virtual AliEventplane* GetEventPlane() const { return fReader->GetEventPlane() ; }
84 virtual TString GetEventPlaneMethod() const { return fReader->GetEventPlaneMethod() ; }
85
86 //AOD branch
87 virtual void AddAODParticle(AliAODPWG4Particle part) ;
88
89 virtual void ConnectInputOutputAODBranches();
90
91 virtual TClonesArray * GetCreateOutputAODBranch() ;
92
93 virtual TString GetInputAODName() const { return fInputAODName ; }
94 virtual void SetInputAODName(TString name) { fInputAODName = name ; }
95
96 virtual TString GetOutputAODName() const { return fOutputAODName ; }
97 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
98
99 virtual Bool_t NewOutputAOD() const { return fNewAOD ; }
100
101 virtual TString GetOutputAODClassName() const { return fOutputAODClassName ; }
102 virtual void SetOutputAODClassName(TString name) { fOutputAODClassName = name ; }
103
104 virtual TString GetAODObjArrayName() const { return fAODObjArrayName ; }
105 virtual void SetAODObjArrayName(TString name) { fAODObjArrayName = name ; }
106
107 virtual TClonesArray * GetInputAODBranch() const { return fInputAODBranch ; }
108 virtual TClonesArray * GetOutputAODBranch() const { if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ; }
109 virtual TClonesArray * GetAODBranch(TString aodBranchName) const ;
110
111 //Track cluster arrays access methods
112 virtual TClonesArray* GetAODCaloClusters() const ; // Output AOD clusters, not used?
113 virtual TClonesArray* GetAODTracks() const ; // Output AOD tracks, not used?
114 virtual AliVCaloCells* GetPHOSCells() const { return fReader->GetPHOSCells() ; }
115 virtual AliVCaloCells* GetEMCALCells() const { return fReader->GetEMCALCells() ; }
116 virtual TObjArray* GetCTSTracks() const ;
117 virtual TObjArray* GetEMCALClusters() const ;
118 virtual TObjArray* GetPHOSClusters() const ;
119
120
121 // Common analysis switchs
122
123 virtual Bool_t IsDataMC() const { return fDataMC ; }
124 virtual void SwitchOnDataMC() { fDataMC = kTRUE ; if(!fMCUtils)fMCUtils = new AliMCAnalysisUtils();}
125 virtual void SwitchOffDataMC() { fDataMC = kFALSE ; }
126
127 virtual Bool_t IsFiducialCutOn() const { return fCheckFidCut ; }
128 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; if(!fFidCut)fFidCut = new AliFiducialCut();}
129 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE ; }
130
131 virtual Bool_t IsCaloPIDOn() const { return fCheckCaloPID ; }
132 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE; if(!fCaloPID)fCaloPID = new AliCaloPID();}
133 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE ; }
134
135 virtual Bool_t MakePlotsOn() const { return fMakePlots ; }
136 virtual void SwitchOnPlotsMaking() { fMakePlots = kTRUE ; }
137 virtual void SwitchOffPlotsMaking() { fMakePlots = kFALSE ; }
138
139 virtual Bool_t DoEventSelect() const { return fUseSelectEvent ; } // Do correlation analysis with different event buffers
140
141 virtual void SwitchOnEventSelection() { fUseSelectEvent = kTRUE ; }
142 virtual void SwitchOffEventSelection() { fUseSelectEvent = kFALSE ; }
143
144 // Cluster energy/momentum cut
145
146 virtual Float_t GetMaxPt() const { return fMaxPt ; }
147 virtual Float_t GetMinPt() const { return fMinPt ; }
148 virtual void SetMaxPt(Float_t pt) { fMaxPt = pt ; }
149 virtual void SetMinPt(Float_t pt) { fMinPt = pt ; }
150 virtual void SetPtCutRange(Double_t mi, Double_t ma) { fMaxPt = ma; fMinPt=mi; }
151
152 virtual Float_t GetMaxEnergy() const { return fMaxPt ; }
153 virtual Float_t GetMinEnergy() const { return fMinPt ; }
154 virtual void SetMaxEnergy(Float_t e) { fMaxPt = e ; }
155 virtual void SetMinEnergy(Float_t e) { fMinPt = e ; }
156 virtual void SetEnergyCutRange(Double_t mi, Double_t ma) { fMaxPt = ma; fMinPt = mi; }
157
158 //Cluster Pairs Time cut
159 virtual void SetPairTimeCut(Float_t t) { fPairTimeCut = t ; } //ns
160 virtual Float_t GetPairTimeCut() const { return fPairTimeCut ; } //ns
161
162 //Getters / Setters for parameters of event buffers
163
164 virtual Int_t GetMultiBin() const { return fMultiBin ; } //number of bins in Multiplicity
165 virtual Int_t GetNZvertBin() const { return fNZvertBin ; } //number of bins in vertex
166 virtual Int_t GetNRPBin() const { return fNrpBin ; } //number of bins in reaction plain
167 virtual Int_t GetNCentrBin() const { return fNCentrBin ; } //number of bins in centrality
168 virtual Int_t GetNMaxEvMix() const { return fNmaxMixEv ; } //maximal number of events for mixin
169 virtual Float_t GetZvertexCut() const { return GetReader()->GetZvertexCut();} //cut on vertex position
170 virtual Int_t GetMaxMulti() const { return fMaxMulti ; }
171 virtual Int_t GetMinMulti() const { return fMinMulti ; }
172
173 virtual void SetMultiBin(Int_t n=1) { fMultiBin = n ;} //number of bins in Multiplicity
174 virtual void SetNZvertBin(Int_t n=1) { fNZvertBin = n ;} //number of bins for vertex position
175 virtual void SetNRPBin(Int_t n=1) { fNrpBin = n ;} //number of bins in reaction plain
176 virtual void SetNCentrBin(Int_t n=1) { fNCentrBin = n ;} //number of bins in centrality
177 virtual void SetNMaxEvMix(Int_t n=20) { fNmaxMixEv = n ;} //maximal number of events for mixing
178 virtual void SetMultiplicity(Int_t multimin, Int_t multimax) {fMinMulti = multimin ; fMaxMulti = multimax ; }
179
180 //Mixed event
181 virtual AliMixedEvent * GetMixedEvent() { return GetReader()->GetMixedEvent() ; }
182 virtual Int_t GetNMixedEvent() const { return GetReader()->GetNMixedEvent() ; }
183
184 //Vertex methods
185 virtual void GetVertex(Double_t vertex[3]) const { GetReader()->GetVertex(vertex) ; }
186 virtual Double_t* GetVertex(const Int_t evtIndex) const { return GetReader()->GetVertex(evtIndex) ; }
187 virtual void GetVertex(Double_t vertex[3], const Int_t evtIndex) const { GetReader()->GetVertex(vertex,evtIndex) ; }
188
189
190 //MULTIPLICITY
191
192 virtual Int_t GetTrackMultiplicity() const { return fReader->GetTrackMultiplicity() ; }
193
194 //VZERO
195
196 virtual Int_t GetV0Signal(Int_t i ) const { return fReader->GetV0Signal(i) ; }
197
198 virtual Int_t GetV0Multiplicity(Int_t i ) const { return fReader->GetV0Multiplicity(i) ; }
199
200
201 //MC event acces methods
202 virtual AliStack * GetMCStack() const ;
203
204 virtual AliHeader* GetMCHeader() const ;
205
206 virtual AliGenEventHeader * GetMCGenEventHeader() const ;
207
208 //Analysis helpers classes pointers setters and getters
209
210 virtual AliCaloPID * GetCaloPID() { if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ; }
211
212 virtual AliCalorimeterUtils * GetCaloUtils() const { return fCaloUtils ; }
213
214 virtual AliFiducialCut * GetFiducialCut() { if(!fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ; }
215
216 virtual AliHistogramRanges * GetHistogramRanges() { if(!fHisto) fHisto = new AliHistogramRanges(); return fHisto ; }
217
218 virtual AliIsolationCut * GetIsolationCut() { if(!fIC) fIC = new AliIsolationCut(); return fIC ; }
219
220 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() { if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ; }
221
222 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() { if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ; }
223
224 virtual AliCaloTrackReader * GetReader() const { return fReader ; }
225
226 virtual AliEMCALGeometry * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry() ; }
227
228 virtual AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
229
230 virtual void SetCaloPID(AliCaloPID * const pid) { delete fCaloPID; fCaloPID = pid ; }
231
232 virtual void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
233
234 virtual void SetFiducialCut(AliFiducialCut * const fc) { delete fFidCut; fFidCut = fc ; }
235
236 virtual void SetHistogramRanges(AliHistogramRanges * const hr) { delete fHisto; fHisto = hr ; }
237
238 virtual void SetIsolationCut(AliIsolationCut * const ic) { delete fIC; fIC = ic ; }
239
240 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { delete fMCUtils; fMCUtils = mcutils ; }
241
242 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { delete fNMS; fNMS = nms ; }
243
244 virtual void SetReader(AliCaloTrackReader * const reader) { fReader = reader ; }
245
246 //Calorimeter specific access methods and calculations
247
248 virtual Bool_t IsTrackMatched(AliVCluster * cluster, AliVEvent* event) const {
249 return fCaloPID->IsTrackMatched(cluster, fCaloUtils, event) ; }
250
251 virtual Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
252 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU) ; }
253
254 virtual Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
255 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent()) ; }
256
257 virtual Int_t GetModuleNumber(AliVCluster * cluster) const {
258 return fCaloUtils->GetModuleNumber(cluster) ; }
259
260 virtual AliVCluster* FindCluster(TObjArray* clusters, const Int_t id, Int_t & iclus, const Int_t first=0) ;
261
262private:
263
264 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
265 Int_t fDebug ; // Debug level
266 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
267 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
268 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
269 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
270 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
271 Float_t fPairTimeCut; // Maximum difference between time of cluster pairs (ns)
272 Int_t fMultiBin ; // Number of bins in event container for multiplicity
273 Int_t fNZvertBin ; // Number of bins in event container for vertex position
274 Int_t fNrpBin ; // Number of bins in event container for reaction plain
275 Int_t fNCentrBin ; // Number of bins in event container for centrality
276 Int_t fNmaxMixEv ; // Maximal number of events stored in buffer for mixing
277 Int_t fMaxMulti ; // Maximum multiplicity of particles in the analysis
278 Int_t fMinMulti ; // Maximum multiplicity of particles in the analysis
279 Bool_t fUseSelectEvent ; // Select events based on multiplicity and vertex cuts
280 Bool_t fMakePlots ; // Print plots
281
282 TClonesArray* fInputAODBranch ; //! Selected input particles branch
283 TString fInputAODName ; // Name of input AOD branch;
284 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
285 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
286 TString fOutputAODName ; // Name of output AOD branch;
287 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
288 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
289 TString fAddToHistogramsName; // Add this string to histograms name
290
291 //Analysis helper classes access pointers
292 AliCaloPID * fCaloPID; // PID calculation
293 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
294 AliFiducialCut * fFidCut; // Acceptance cuts
295 AliHistogramRanges * fHisto ; // Histogram ranges container
296 AliIsolationCut * fIC; // Isolation cut
297 AliMCAnalysisUtils * fMCUtils; // MonteCarlo Analysis utils
298 AliNeutralMesonSelection * fNMS; // Neutral Meson Selection
299 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
300
301 AliAnaCaloTrackCorrBaseClass( const AliAnaCaloTrackCorrBaseClass & bc) ; // cpy ctor
302 AliAnaCaloTrackCorrBaseClass & operator = (const AliAnaCaloTrackCorrBaseClass & bc) ; // cpy assignment
303
304 ClassDef(AliAnaCaloTrackCorrBaseClass,20)
305} ;
306
307
308#endif //ALIANACALOTRACKCORRBASECLASS_H
309
310
311