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