]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/CaloTrackCorrBase/AliAnaCaloTrackCorrBaseClass.h
updated
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / 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
f15155ed 17#include <TList.h>
18#include <TObject.h>
0de1814a 19class TClonesArray ;
20class TObjArray ;
f15155ed 21class TObjString;
22
23//Analysis
f15155ed 24#include "AliCaloTrackReader.h"
25#include "AliCaloPID.h"
26#include "AliFiducialCut.h"
27#include "AliIsolationCut.h"
28#include "AliMCAnalysisUtils.h"
29#include "AliNeutralMesonSelection.h"
30#include "AliCalorimeterUtils.h"
31#include "AliHistogramRanges.h"
0de1814a 32#include "AliAODPWG4ParticleCorrelation.h"
33#include "AliMixedEvent.h"
34class AliVCaloCells;
f15155ed 35class AliStack ;
36class AliHeader ;
37class AliGenEventHeader ;
f15155ed 38class AliEMCALGeometry;
39class AliPHOSGeoUtils;
0de1814a 40class AliCentrality;
41class AliEventplane;
f15155ed 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() ; }
11045377 84 virtual Double_t GetEventPlaneAngle() const { return fReader->GetEventPlaneAngle() ; }
f15155ed 85 virtual TString GetEventPlaneMethod() const { return fReader->GetEventPlaneMethod() ; }
86
87 //AOD branch
88 virtual void AddAODParticle(AliAODPWG4Particle part) ;
89
90 virtual void ConnectInputOutputAODBranches();
91
92 virtual TClonesArray * GetCreateOutputAODBranch() ;
93
94 virtual TString GetInputAODName() const { return fInputAODName ; }
95 virtual void SetInputAODName(TString name) { fInputAODName = name ; }
96
97 virtual TString GetOutputAODName() const { return fOutputAODName ; }
98 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
99
100 virtual Bool_t NewOutputAOD() const { return fNewAOD ; }
101
102 virtual TString GetOutputAODClassName() const { return fOutputAODClassName ; }
103 virtual void SetOutputAODClassName(TString name) { fOutputAODClassName = name ; }
104
105 virtual TString GetAODObjArrayName() const { return fAODObjArrayName ; }
106 virtual void SetAODObjArrayName(TString name) { fAODObjArrayName = name ; }
107
108 virtual TClonesArray * GetInputAODBranch() const { return fInputAODBranch ; }
109 virtual TClonesArray * GetOutputAODBranch() const { if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ; }
110 virtual TClonesArray * GetAODBranch(TString aodBranchName) const ;
111
112 //Track cluster arrays access methods
113 virtual TClonesArray* GetAODCaloClusters() const ; // Output AOD clusters, not used?
114 virtual TClonesArray* GetAODTracks() const ; // Output AOD tracks, not used?
115 virtual AliVCaloCells* GetPHOSCells() const { return fReader->GetPHOSCells() ; }
116 virtual AliVCaloCells* GetEMCALCells() const { return fReader->GetEMCALCells() ; }
117 virtual TObjArray* GetCTSTracks() const ;
118 virtual TObjArray* GetEMCALClusters() const ;
119 virtual TObjArray* GetPHOSClusters() const ;
120
121
122 // Common analysis switchs
123
124 virtual Bool_t IsDataMC() const { return fDataMC ; }
125 virtual void SwitchOnDataMC() { fDataMC = kTRUE ; if(!fMCUtils)fMCUtils = new AliMCAnalysisUtils();}
126 virtual void SwitchOffDataMC() { fDataMC = kFALSE ; }
127
128 virtual Bool_t IsFiducialCutOn() const { return fCheckFidCut ; }
129 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; if(!fFidCut)fFidCut = new AliFiducialCut();}
130 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE ; }
131
132 virtual Bool_t IsCaloPIDOn() const { return fCheckCaloPID ; }
133 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE; if(!fCaloPID)fCaloPID = new AliCaloPID();}
134 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE ; }
135
136 virtual Bool_t MakePlotsOn() const { return fMakePlots ; }
137 virtual void SwitchOnPlotsMaking() { fMakePlots = kTRUE ; }
138 virtual void SwitchOffPlotsMaking() { fMakePlots = kFALSE ; }
139
140 virtual Bool_t DoEventSelect() const { return fUseSelectEvent ; } // Do correlation analysis with different event buffers
141
142 virtual void SwitchOnEventSelection() { fUseSelectEvent = kTRUE ; }
143 virtual void SwitchOffEventSelection() { fUseSelectEvent = kFALSE ; }
144
145 // Cluster energy/momentum cut
146
147 virtual Float_t GetMaxPt() const { return fMaxPt ; }
148 virtual Float_t GetMinPt() const { return fMinPt ; }
149 virtual void SetMaxPt(Float_t pt) { fMaxPt = pt ; }
150 virtual void SetMinPt(Float_t pt) { fMinPt = pt ; }
151 virtual void SetPtCutRange(Double_t mi, Double_t ma) { fMaxPt = ma; fMinPt=mi; }
152
153 virtual Float_t GetMaxEnergy() const { return fMaxPt ; }
154 virtual Float_t GetMinEnergy() const { return fMinPt ; }
155 virtual void SetMaxEnergy(Float_t e) { fMaxPt = e ; }
156 virtual void SetMinEnergy(Float_t e) { fMinPt = e ; }
157 virtual void SetEnergyCutRange(Double_t mi, Double_t ma) { fMaxPt = ma; fMinPt = mi; }
158
159 //Cluster Pairs Time cut
160 virtual void SetPairTimeCut(Float_t t) { fPairTimeCut = t ; } //ns
161 virtual Float_t GetPairTimeCut() const { return fPairTimeCut ; } //ns
162
163 //Getters / Setters for parameters of event buffers
164
1eb93b25 165 virtual Int_t GetMultiBin() const { return fMultiBin ; } // number of bins in Multiplicity
166 virtual Int_t GetNZvertBin() const { return fNZvertBin ; } // number of bins in vertex
167 virtual Int_t GetNRPBin() const { return fNrpBin ; } // number of bins in reaction plain
168 virtual Int_t GetNCentrBin() const { return fNCentrBin ; } // number of bins in centrality
169 virtual Int_t GetNMaxEvMix() const { return fNmaxMixEv ; } // maximal number of events for mixin
170 virtual Float_t GetZvertexCut() const { return GetReader()->GetZvertexCut();} // cut on vertex position
f15155ed 171 virtual Int_t GetMaxMulti() const { return fMaxMulti ; }
172 virtual Int_t GetMinMulti() const { return fMinMulti ; }
11045377 173
174 virtual Int_t GetEventCentralityBin();
175 virtual Int_t GetEventRPBin();
176 virtual Int_t GetEventVzBin();
177 virtual Int_t GetEventMixBin();
178 virtual Int_t GetEventMixBin(const Int_t iCen, const Int_t iVz, const Int_t iRP);
f15155ed 179
1eb93b25 180 virtual void SetMultiBin (Int_t n = 1 ) { fMultiBin = n ; if(n < 1) fMultiBin = 1 ; } // number of bins in Multiplicity
181 virtual void SetNZvertBin(Int_t n = 1 ) { fNZvertBin = n ; if(n < 1) fNZvertBin = 1 ; } // number of bins for vertex position
182 virtual void SetNRPBin (Int_t n = 1 ) { fNrpBin = n ; if(n < 1) fNrpBin = 1 ; } // number of bins in reaction plain
183 virtual void SetNCentrBin(Int_t n = 1 ) { fNCentrBin = n ; if(n < 1) fNCentrBin = 1 ; } // number of bins in centrality
184 virtual void SetNMaxEvMix(Int_t n = 20) { fNmaxMixEv = n ; if(n < 1) fNmaxMixEv = 1 ; } // maximal number of events for mixing
f15155ed 185 virtual void SetMultiplicity(Int_t multimin, Int_t multimax) {fMinMulti = multimin ; fMaxMulti = multimax ; }
186
11045377 187 virtual void SwitchOnTrackMultBins() { fUseTrackMultBins = kTRUE ; }
188 virtual void SwitchOffTrackMultBins() { fUseTrackMultBins = kFALSE ; }
189
190 virtual void SwitchOnOwnMix() { fDoOwnMix = kTRUE ; }
191 virtual void SwitchOffOwnMix() { fDoOwnMix = kFALSE ; }
192
193 virtual Bool_t DoOwnMix() { return fDoOwnMix ; }
194 virtual Bool_t UseTrackMultBins() { return fUseTrackMultBins ; }
195
04f7a616 196 //Mixed event
197 virtual Int_t CheckMixedEventVertex(const Int_t caloLabel, const Int_t trackLabel) ;
f15155ed 198 virtual AliMixedEvent * GetMixedEvent() { return GetReader()->GetMixedEvent() ; }
199 virtual Int_t GetNMixedEvent() const { return GetReader()->GetNMixedEvent() ; }
200
201 //Vertex methods
202 virtual void GetVertex(Double_t vertex[3]) const { GetReader()->GetVertex(vertex) ; }
203 virtual Double_t* GetVertex(const Int_t evtIndex) const { return GetReader()->GetVertex(evtIndex) ; }
204 virtual void GetVertex(Double_t vertex[3], const Int_t evtIndex) const { GetReader()->GetVertex(vertex,evtIndex) ; }
205
206
207 //MULTIPLICITY
208
209 virtual Int_t GetTrackMultiplicity() const { return fReader->GetTrackMultiplicity() ; }
210
211 //VZERO
212
213 virtual Int_t GetV0Signal(Int_t i ) const { return fReader->GetV0Signal(i) ; }
214
215 virtual Int_t GetV0Multiplicity(Int_t i ) const { return fReader->GetV0Multiplicity(i) ; }
216
217
218 //MC event acces methods
219 virtual AliStack * GetMCStack() const ;
220
221 virtual AliHeader* GetMCHeader() const ;
222
223 virtual AliGenEventHeader * GetMCGenEventHeader() const ;
224
225 //Analysis helpers classes pointers setters and getters
226
227 virtual AliCaloPID * GetCaloPID() { if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ; }
228
229 virtual AliCalorimeterUtils * GetCaloUtils() const { return fCaloUtils ; }
230
231 virtual AliFiducialCut * GetFiducialCut() { if(!fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ; }
232
233 virtual AliHistogramRanges * GetHistogramRanges() { if(!fHisto) fHisto = new AliHistogramRanges(); return fHisto ; }
234
235 virtual AliIsolationCut * GetIsolationCut() { if(!fIC) fIC = new AliIsolationCut(); return fIC ; }
236
237 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() { if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ; }
238
239 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() { if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ; }
240
241 virtual AliCaloTrackReader * GetReader() const { return fReader ; }
242
243 virtual AliEMCALGeometry * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry() ; }
244
245 virtual AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
246
247 virtual void SetCaloPID(AliCaloPID * const pid) { delete fCaloPID; fCaloPID = pid ; }
248
249 virtual void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
250
251 virtual void SetFiducialCut(AliFiducialCut * const fc) { delete fFidCut; fFidCut = fc ; }
252
253 virtual void SetHistogramRanges(AliHistogramRanges * const hr) { delete fHisto; fHisto = hr ; }
254
255 virtual void SetIsolationCut(AliIsolationCut * const ic) { delete fIC; fIC = ic ; }
256
257 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { delete fMCUtils; fMCUtils = mcutils ; }
258
259 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { delete fNMS; fNMS = nms ; }
260
261 virtual void SetReader(AliCaloTrackReader * const reader) { fReader = reader ; }
262
263 //Calorimeter specific access methods and calculations
264
ad5fec38 265 virtual Bool_t IsTrackMatched(AliVCluster * cluster, AliVEvent* event) {
266 return GetCaloPID()->IsTrackMatched(cluster, fCaloUtils, event) ; }
f15155ed 267
268 virtual Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
269 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU) ; }
270
271 virtual Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
272 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent()) ; }
273
274 virtual Int_t GetModuleNumber(AliVCluster * cluster) const {
275 return fCaloUtils->GetModuleNumber(cluster) ; }
276
277 virtual AliVCluster* FindCluster(TObjArray* clusters, const Int_t id, Int_t & iclus, const Int_t first=0) ;
278
279private:
280
281 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
282 Int_t fDebug ; // Debug level
283 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
284 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
285 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
286 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
287 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
288 Float_t fPairTimeCut; // Maximum difference between time of cluster pairs (ns)
289 Int_t fMultiBin ; // Number of bins in event container for multiplicity
290 Int_t fNZvertBin ; // Number of bins in event container for vertex position
291 Int_t fNrpBin ; // Number of bins in event container for reaction plain
292 Int_t fNCentrBin ; // Number of bins in event container for centrality
293 Int_t fNmaxMixEv ; // Maximal number of events stored in buffer for mixing
11045377 294 Bool_t fDoOwnMix; // Do combinatorial background not the one provided by the frame
295 Bool_t fUseTrackMultBins; // Use track multiplicity and not centrality bins in mixing
f15155ed 296 Int_t fMaxMulti ; // Maximum multiplicity of particles in the analysis
297 Int_t fMinMulti ; // Maximum multiplicity of particles in the analysis
298 Bool_t fUseSelectEvent ; // Select events based on multiplicity and vertex cuts
299 Bool_t fMakePlots ; // Print plots
300
301 TClonesArray* fInputAODBranch ; //! Selected input particles branch
302 TString fInputAODName ; // Name of input AOD branch;
303 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
304 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
305 TString fOutputAODName ; // Name of output AOD branch;
306 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
307 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
308 TString fAddToHistogramsName; // Add this string to histograms name
309
310 //Analysis helper classes access pointers
311 AliCaloPID * fCaloPID; // PID calculation
312 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
313 AliFiducialCut * fFidCut; // Acceptance cuts
314 AliHistogramRanges * fHisto ; // Histogram ranges container
315 AliIsolationCut * fIC; // Isolation cut
316 AliMCAnalysisUtils * fMCUtils; // MonteCarlo Analysis utils
317 AliNeutralMesonSelection * fNMS; // Neutral Meson Selection
318 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
319
320 AliAnaCaloTrackCorrBaseClass( const AliAnaCaloTrackCorrBaseClass & bc) ; // cpy ctor
321 AliAnaCaloTrackCorrBaseClass & operator = (const AliAnaCaloTrackCorrBaseClass & bc) ; // cpy assignment
322
11045377 323 ClassDef(AliAnaCaloTrackCorrBaseClass,21)
f15155ed 324} ;
325
326
327#endif //ALIANACALOTRACKCORRBASECLASS_H
328
329
330