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