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