]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/CaloTrackCorrBase/AliCaloTrackReader.h
coverity fix
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliCaloTrackReader.h
CommitLineData
1c5acb87 1#ifndef ALICALOTRACKREADER_H
2#define ALICALOTRACKREADER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
1c5acb87 5
6//_________________________________________________________________________
7// Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and
8// Central Barrel Tracking detectors.
9// Not all MC particles/tracks/clusters are kept, some kinematical restrictions are done.
591cc579 10// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TObjArrays (PHOS, EMCAL, CTS)
743aa53a 11// : AliCaloTrackMCReader : Fills Kinematics data in 3 TObjArrays (PHOS, EMCAL, CTS)
12// : AliCaloTrackAODReader: Fills AOD data in 3 TObjArrays (PHOS, EMCAL, CTS)
1c5acb87 13// -- Author: Gustavo Conesa (INFN-LNF)
743aa53a 14//////////////////////////////////////////////////////////////////////////////
1c5acb87 15
16// --- ROOT system ---
49b53920 17#include <TObject.h>
18#include <TString.h>
cfaba834 19class TObjArray ;
591cc579 20class TTree ;
f3138ecf 21class TArrayI ;
1c5acb87 22
23//--- ANALYSIS system ---
0de1814a 24#include "AliVEvent.h"
c5693f62 25class AliVCaloCells;
26class AliStack;
27class AliHeader;
28class AliGenEventHeader;
8dacfd76 29class AliAODEvent;
477d6cee 30class AliMCEvent;
c8fe2783 31class AliMixedEvent;
591cc579 32class AliAODMCHeader;
c5693f62 33class AliESDtrackCuts;
b6dd6ad2 34class AliCentrality;
48c37e02 35class AliTriggerAnalysis;
72542aba 36class AliEventplane;
f3138ecf 37class AliVCluster;
1c5acb87 38
0de1814a 39// --- CaloTrackCorr / EMCAL ---
cfaba834 40#include "AliFiducialCut.h"
0de1814a 41class AliEMCALRecoUtils;
c5693f62 42class AliCalorimeterUtils;
cfaba834 43
1c5acb87 44class AliCaloTrackReader : public TObject {
45
03190ad7 46public:
f3138ecf 47
48 AliCaloTrackReader() ; // ctor
49 virtual ~AliCaloTrackReader() ; // virtual dtor
cfaba834 50
51 //--------------------------------
52 // General methods
53 //--------------------------------
54
55 virtual void Init();
de0b770d 56
cfaba834 57 virtual void InitParameters();
de0b770d 58
cfaba834 59 virtual void Print(const Option_t * opt) const;
de0b770d 60
cfaba834 61 virtual void ResetLists();
1c5acb87 62
3c75ddf7 63 virtual Int_t GetDebug() const { return fDebug ; }
64 virtual void SetDebug(Int_t d) { fDebug = d ; }
cfaba834 65
66 enum inputDataType {kESD, kAOD, kMC};
3c75ddf7 67 virtual Int_t GetDataType() const { return fDataType ; }
68 virtual void SetDataType(Int_t data ) { fDataType = data ; }
1c5acb87 69
3c75ddf7 70 virtual Int_t GetEventNumber() const { return fEventNumber ; }
a79a2424 71
3c75ddf7 72 TString GetTaskName() const { return fTaskName ; }
73 void SetTaskName(TString name) { fTaskName = name ; }
cfaba834 74
cfaba834 75 //---------------------------------------
76 //Input/output event setters and getters
77 //---------------------------------------
78 virtual void SetInputEvent(AliVEvent* const input) ;
3c75ddf7 79 virtual void SetOutputEvent(AliAODEvent* const aod) { fOutputEvent = aod ; }
80 virtual void SetMC(AliMCEvent* const mc) { fMC = mc ; }
be518ab0 81 virtual void SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) { ; }
cfaba834 82
83 // Delta AODs
3c75ddf7 84 virtual TList * GetAODBranchList() const { return fAODBranchList ; }
85 void SetDeltaAODFileName(TString name ) { fDeltaAODFileName = name ; }
86 TString GetDeltaAODFileName() const { return fDeltaAODFileName ; }
87 void SwitchOnWriteDeltaAOD() { fWriteOutputDeltaAOD = kTRUE ; }
88 void SwitchOffWriteDeltaAOD() { fWriteOutputDeltaAOD = kFALSE ; }
89 Bool_t WriteDeltaAODToFile() const { return fWriteOutputDeltaAOD ; }
cfaba834 90
91 //------------------------------------------------------------
92 //Clusters/Tracks arrays filtering/filling methods and switchs
93 //------------------------------------------------------------
94
95 //Minimum pt setters and getters
3c75ddf7 96 Float_t GetEMCALPtMin() const { return fEMCALPtMin ; }
97 Float_t GetPHOSPtMin() const { return fPHOSPtMin ; }
98 Float_t GetCTSPtMin() const { return fCTSPtMin ; }
99 Float_t GetEMCALPtMax() const { return fEMCALPtMax ; }
100 Float_t GetPHOSPtMax() const { return fPHOSPtMax ; }
101 Float_t GetCTSPtMax() const { return fCTSPtMax ; }
a5fb4114 102
3c75ddf7 103 void SetEMCALPtMin(Float_t pt) { fEMCALPtMin = pt ; }
104 void SetPHOSPtMin (Float_t pt) { fPHOSPtMin = pt ; }
105 void SetCTSPtMin (Float_t pt) { fCTSPtMin = pt ; }
a5fb4114 106
3c75ddf7 107 void SetEMCALPtMax(Float_t pt) { fEMCALPtMax = pt ; }
108 void SetPHOSPtMax (Float_t pt) { fPHOSPtMax = pt ; }
109 void SetCTSPtMax (Float_t pt) { fCTSPtMax = pt ; }
a5fb4114 110
3c75ddf7 111 Float_t GetEMCALEMin() const { return GetEMCALPtMin() ; }
112 Float_t GetPHOSEMin() const { return GetPHOSPtMin() ; }
113 Float_t GetEMCALEMax() const { return GetEMCALPtMax() ; }
114 Float_t GetPHOSEMax() const { return GetPHOSPtMax() ; }
cfaba834 115
3c75ddf7 116 void SetEMCALEMin (Float_t e) { SetEMCALPtMin(e) ; }
117 void SetPHOSEMin (Float_t e) { SetPHOSPtMin (e) ; }
118 void SetEMCALEMax (Float_t e) { SetEMCALPtMax(e) ; }
119 void SetPHOSEMax (Float_t e) { SetPHOSPtMax (e) ; }
cfaba834 120
cc944149 121 // Track DCA cut
122 Bool_t AcceptDCA(const Float_t pt, const Float_t dca);
689d9f15 123 Double_t GetTrackDCACut(Int_t i) const { if(i >= 0 && i < 3 ) return fTrackDCACut[i] ;
124 else return -999 ; }
125
126 void SetTrackDCACut(Int_t i, Float_t cut) { if(i >= 0 && i < 3 )
127 fTrackDCACut[i] = cut ; }
128
129 void SwitchOnUseTrackDCACut() { fUseTrackDCACut = kTRUE ; }
130 void SwitchOffUseTrackDCACut() { fUseTrackDCACut = kFALSE ; }
cc944149 131 Bool_t IsDCACutOn() const { return fUseTrackDCACut ; }
689d9f15 132
ff440946 133 //Time cut
134
975b29fa 135 Double_t GetTrackTimeCutMin() const { return fTrackTimeCutMin ; }
136 Double_t GetTrackTimeCutMax() const { return fTrackTimeCutMax ; }
137
975b29fa 138 void SetTrackTimeCut(Double_t a, Double_t b) { fTrackTimeCutMin = a ;
139 fTrackTimeCutMax = b ; } // ns
140
4b7f6e01 141 void SwitchOnUseTrackTimeCut() { fUseTrackTimeCut = kTRUE ; }
142 void SwitchOffUseTrackTimeCut() { fUseTrackTimeCut = kFALSE ; }
143
ff440946 144 Double_t GetEMCALTimeCutMin() const { return fEMCALTimeCutMin ; }
145 Double_t GetEMCALTimeCutMax() const { return fEMCALTimeCutMax ; }
d2655d46 146
3c1a2e95 147 Bool_t IsInTimeWindow(const Double_t tof, const Float_t energy) const ;
148
ff440946 149 void SetEMCALTimeCut(Double_t a, Double_t b) { fEMCALTimeCutMin = a ;
d2655d46 150 fEMCALTimeCutMax = b ; } // ns
ff440946 151
152 void SetEMCALParametrizedMinTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMin[i] = par ; }
153 void SetEMCALParametrizedMaxTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMax[i] = par ; }
154
4b7f6e01 155 void SwitchOnUseEMCALTimeCut() { fUseEMCALTimeCut = kTRUE ; }
156 void SwitchOffUseEMCALTimeCut() { fUseEMCALTimeCut = kFALSE ; }
157
ff440946 158 void SwitchOnUseParametrizedTimeCut() { fUseParamTimeCut = kTRUE ; }
159 void SwitchOffUseParametrizedTimeCut() { fUseParamTimeCut = kFALSE ; }
160
cfaba834 161 // Fidutial cuts
a5fb4114 162 virtual AliFiducialCut * GetFiducialCut() {
163 if(!fFiducialCut) fFiducialCut = new AliFiducialCut();
3c75ddf7 164 return fFiducialCut ; }
165 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFiducialCut = fc ; }
166 virtual Bool_t IsFiducialCutOn() const { return fCheckFidCut ; }
167 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE ;
168 fFiducialCut = new AliFiducialCut() ; }
169 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE ; }
1c5acb87 170
cfaba834 171 // Cluster origin
a5fb4114 172 Bool_t IsEMCALCluster(AliVCluster *clus) const;
173 Bool_t IsPHOSCluster (AliVCluster *clus) const;
cfaba834 174 //Patch for cluster origin for Old AODs implementation
3c75ddf7 175 void SwitchOnOldAODs() { fOldAOD = kTRUE ; }
176 void SwitchOffOldAODs() { fOldAOD = kFALSE ; }
f37fa8d2 177
cfaba834 178 // Cluster/track/cells switchs
3c75ddf7 179 Bool_t IsCTSSwitchedOn() const { return fFillCTS ; }
180 void SwitchOnCTS() { fFillCTS = kTRUE ; }
181 void SwitchOffCTS() { fFillCTS = kFALSE ; }
1c5acb87 182
3c75ddf7 183 Bool_t IsEMCALSwitchedOn() const { return fFillEMCAL ; }
184 void SwitchOnEMCAL() { fFillEMCAL = kTRUE ; }
185 void SwitchOffEMCAL() { fFillEMCAL = kFALSE ; }
1c5acb87 186
3c75ddf7 187 Bool_t IsPHOSSwitchedOn() const { return fFillPHOS ; }
188 void SwitchOnPHOS() { fFillPHOS = kTRUE ; }
189 void SwitchOffPHOS() { fFillPHOS = kFALSE ; }
1c5acb87 190
3c75ddf7 191 Bool_t IsEMCALCellsSwitchedOn() const { return fFillEMCALCells ; }
192 void SwitchOnEMCALCells() { fFillEMCALCells = kTRUE ; }
193 void SwitchOffEMCALCells() { fFillEMCALCells = kFALSE ; }
1c5acb87 194
3c75ddf7 195 Bool_t IsPHOSCellsSwitchedOn() const { return fFillPHOSCells ; }
196 void SwitchOnPHOSCells() { fFillPHOSCells = kTRUE ; }
197 void SwitchOffPHOSCells() { fFillPHOSCells = kFALSE ; }
1c5acb87 198
3bfc4732 199 Bool_t AreClustersRecalculated() const { return fRecalculateClusters ; }
200 void SwitchOnClusterRecalculation() { fRecalculateClusters = kTRUE ; }
201 void SwitchOffClusterRecalculation() { fRecalculateClusters = kFALSE ; }
202
3c75ddf7 203 Bool_t IsEmbeddedClusterSelectionOn() const { return fSelectEmbeddedClusters ; }
204 void SwitchOnEmbeddedClustersSelection() { fSelectEmbeddedClusters = kTRUE ; }
205 void SwitchOffEmbeddedClustersSelection() { fSelectEmbeddedClusters = kFALSE ; }
6060ed91 206
be518ab0 207 // Filling/ filtering / detector information access methods
a5fb4114 208 virtual Bool_t FillInputEvent(const Int_t iEntry, const char *currentFileName) ;
209 virtual void FillInputCTS() ;
210 virtual void FillInputEMCAL() ;
211 virtual void FillInputEMCALAlgorithm(AliVCluster * clus, const Int_t iclus) ;
212 virtual void FillInputPHOS() ;
213 virtual void FillInputEMCALCells() ;
214 virtual void FillInputPHOSCells() ;
215 virtual void FillInputVZERO() ;
216
21812953 217 Int_t GetV0Signal(Int_t i) const { return fV0ADC[i] ; }
218 Int_t GetV0Multiplicity(Int_t i) const { return fV0Mul[i] ; }
a5fb4114 219
21812953 220 void SetEMCALClusterListName(TString &name) { fEMCALClustersListName = name ; }
221 TString GetEMCALClusterListName() const { return fEMCALClustersListName ; }
cfaba834 222
be518ab0 223 // Arrayes with clusters/track/cells access method
21812953 224 virtual TObjArray* GetCTSTracks() const { return fCTSTracks ; }
225 virtual TObjArray* GetEMCALClusters() const { return fEMCALClusters ; }
226 virtual TObjArray* GetPHOSClusters() const { return fPHOSClusters ; }
227 virtual AliVCaloCells* GetEMCALCells() const { return fEMCALCells ; }
228 virtual AliVCaloCells* GetPHOSCells() const { return fPHOSCells ; }
cfaba834 229
230 //-------------------------------------
231 // Event/track selection methods
232 //-------------------------------------
233
cd2e4ce6 234 void AcceptFastClusterEvents() { fAcceptFastCluster = kTRUE ; }
235 void RejectFastClusterEvents() { fAcceptFastCluster = kFALSE ; }
c5693f62 236 Bool_t IsFastClusterAccepted() const { return fAcceptFastCluster ; }
cd2e4ce6 237
238 void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; }
afb3af8a 239 void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; }
c5693f62 240 Bool_t IsLEDEventRemoved() const { return fRemoveLEDEvents ; }
a529ae05 241 Bool_t RejectLEDEvents();
242
a5fb4114 243 void SetFiredTriggerClassName(TString name ) { fFiredTriggerClassName = name ; }
244 TString GetFiredTriggerClassName() const { return fFiredTriggerClassName ; }
43074325 245 TString GetFiredTriggerClasses() ;
cfaba834 246
21812953 247 UInt_t GetEventTriggerMask() const { return fEventTriggerMask ; }
d9bea110 248 void SetEventTriggerMask(UInt_t evtTrig = AliVEvent::kAny)
029dea5a 249 { fEventTriggerMask = evtTrig ; }
d9bea110 250 Bool_t IsEventTriggerAtSEOn() const { return fEventTriggerAtSE ; }
251 void SwitchOnEventTriggerAtSE() { fEventTriggerAtSE = kTRUE ; }
252 void SwitchOffEventTriggerAtSE() { fEventTriggerAtSE = kFALSE ; }
253
254
255 TArrayI GetTriggerPatches();
afb3af8a 256 // void RejectExoticEvents(TArrayI patches);
257 //void RejectTriggeredEventsByPileUp(TArrayI patches);
258 void MatchTriggerCluster(TArrayI patches);
259
260 Bool_t IsExoticEvent() { return fIsExoticEvent ; }
261 Bool_t IsBadCellTriggerEvent() { return fIsBadCellEvent ; }
1035a8d9 262 Bool_t IsBadMaxCellTriggerEvent() { return fIsBadMaxCellEvent ; }
afb3af8a 263 Bool_t IsTriggerMatched() { return fIsTriggerMatch ; }
264 Int_t GetTriggerClusterBC() { return fTriggerClusterBC ; }
265 Int_t GetTriggerClusterIndex() { return fTriggerClusterIndex ; }
266 Int_t GetTriggerClusterId() { return fTriggerClusterId ; }
a529ae05 267
afb3af8a 268 Float_t GetEventTriggerThreshold() { return fTriggerEventThreshold ; }
269 void SetEventTriggerThreshold(Float_t tr) { fTriggerEventThreshold = tr ; }
9bf1c947 270
271 void SetTriggerPatchTimeWindow(Int_t min, Int_t max) { fTriggerPatchTimeWindow[0] = min ;
272 fTriggerPatchTimeWindow[1] = max ; }
273
afb3af8a 274 void SwitchOffBadTriggerEventsRemoval() { fRemoveBadTriggerEvents = kFALSE ; }
275 void SwitchOnBadTriggerEventsRemoval() { fRemoveBadTriggerEvents = kTRUE ; }
276
277 void SwitchOffTriggerPatchMatching() { fTriggerPatchClusterMatch = kFALSE ; }
278 void SwitchOnTriggerPatchMatching() { fTriggerPatchClusterMatch = kTRUE ; }
279
790dea42 280 UInt_t GetMixEventTriggerMask() const { return fMixEventTriggerMask ; }
281 void SetMixEventTriggerMaks(UInt_t evtTrig = AliVEvent::kAnyINT)
282 { fMixEventTriggerMask = evtTrig ; }
d9bea110 283 void SetEventTriggerBit();
284 Bool_t IsEventMinimumBias() const { return fEventTrigMinBias ; }
285 Bool_t IsEventCentral() const { return fEventTrigCentral ; }
286 Bool_t IsEventSemiCentral() const { return fEventTrigSemiCentral ; }
287 Bool_t IsEventEMCALL0() const { return fEventTrigEMCALL0 ; }
288 Bool_t IsEventEMCALL1Gamma1() const { return fEventTrigEMCALL1Gamma1 ; }
289 Bool_t IsEventEMCALL1Gamma2() const { return fEventTrigEMCALL1Gamma2 ; }
290 Bool_t IsEventEMCALL1Jet1() const { return fEventTrigEMCALL1Jet1 ; }
291 Bool_t IsEventEMCALL1Jet2() const { return fEventTrigEMCALL1Jet2 ; }
292 Bool_t IsEventEMCALL1Gamma() const { return (fEventTrigEMCALL1Gamma1 || fEventTrigEMCALL1Gamma2) ; }
293 Bool_t IsEventEMCALL1Jet() const { return (fEventTrigEMCALL1Jet1 || fEventTrigEMCALL1Jet2 ) ; }
294 Bool_t IsEventEMCALL1() const { return (IsEventEMCALL1Gamma() || IsEventEMCALL1Jet() ) ; }
295
296
cd2e4ce6 297 void SwitchOnEventSelection() { fDoEventSelection = kTRUE ; }
298 void SwitchOffEventSelection() { fDoEventSelection = kFALSE ; }
cc944149 299 Bool_t IsEventSelectionDone() const { return fDoEventSelection ; }
cfaba834 300
a5fb4114 301 void SwitchOnV0ANDSelection() { fDoV0ANDEventSelection = kTRUE ; }
302 void SwitchOffV0ANDSelection() { fDoV0ANDEventSelection = kFALSE ; }
303 Bool_t IsV0ANDEventSelectionDone() const { return fDoV0ANDEventSelection ; }
20218aea 304
cc944149 305 void SwitchOnVertexBCEventSelection() { fDoVertexBCEventSelection = kTRUE ; }
306 void SwitchOffVertexBCEventSelection() { fDoVertexBCEventSelection = kFALSE ; }
307 Bool_t IsVertexBCEventSelectionDone() const { return fDoVertexBCEventSelection ; }
308
a5fb4114 309 void SwitchOnPrimaryVertexSelection() { fUseEventsWithPrimaryVertex = kTRUE ; }
310 void SwitchOffPrimaryVertexSelection() { fUseEventsWithPrimaryVertex = kFALSE ; }
311 Bool_t IsPrimaryVertexSelectionDone() const { return fUseEventsWithPrimaryVertex ; }
20218aea 312
2644ead9 313 void SwitchOnRejectNoTrackEvents() { fDoRejectNoTrackEvents = kTRUE ; }
314 void SwitchOffRejectNoTrackEvents() { fDoRejectNoTrackEvents = kFALSE ; }
315 Bool_t IsEventWithNoTrackRejectionDone() const { return fDoRejectNoTrackEvents ; }
316
d9bea110 317
034e885b 318 //Time Stamp
319
b370e713 320 Double_t GetRunTimeStampMin() const { return fTimeStampRunMin ; }
321 Double_t GetRunTimeStampMax() const { return fTimeStampRunMax ; }
034e885b 322
b370e713 323 void SetRunTimeStamp(Double_t a, Double_t b) { fTimeStampRunMin = a ;
034e885b 324 fTimeStampRunMax = b ; } // seconds
325
326 Float_t GetEventTimeStampFractionMin() const { return fTimeStampEventFracMin ; }
327 Float_t GetEventTimeStampFractionMax() const { return fTimeStampEventFracMax ; }
328
329 void SetEventTimeStampFraction(Float_t a, Float_t b) { fTimeStampEventFracMin = a ;
330 fTimeStampEventFracMax = b ; }
331
332 void SwitchOnSelectEventTimeStamp() { fTimeStampEventSelect = kTRUE ; }
333 void SwitchOffSelectEventTimeStamp() { fTimeStampEventSelect = kFALSE ; }
334
b8d661af 335 Bool_t IsSelectEventTimeStampOn() {return fTimeStampEventSelect ; }
034e885b 336
3c1a2e95 337 Bool_t IsPileUpFromSPD() const ;
338 Bool_t IsPileUpFromEMCal() const ;
339 Bool_t IsPileUpFromSPDAndEMCal() const ;
340 Bool_t IsPileUpFromSPDOrEMCal() const ;
341 Bool_t IsPileUpFromSPDAndNotEMCal() const ;
342 Bool_t IsPileUpFromEMCalAndNotSPD() const ;
343 Bool_t IsPileUpFromNotSPDAndNotEMCal() const ;
344
345 void SetPileUpParamForSPD (Int_t i, Double_t param)
f5500c7a 346 { fPileUpParamSPD[i] = param ; }
347 void SetPileUpParamForEMCal(Int_t param) { fNPileUpClustersCut = param ; }
4b75cb39 348
f5500c7a 349 Int_t GetNPileUpClusters() { return fNPileUpClusters ; }
350 Int_t GetNNonPileUpClusters() { return fNNonPileUpClusters ; }
975b29fa 351
352 Int_t GetEMCalEventBC(Int_t bc) const { if(bc >=0 && bc < 19) return fEMCalBCEvent [bc] ; else return 0 ; }
353 Int_t GetTrackEventBC(Int_t bc) const { if(bc >=0 && bc < 19) return fTrackBCEvent [bc] ; else return 0 ; }
354 Int_t GetEMCalEventBCcut(Int_t bc) const { if(bc >=0 && bc < 19) return fEMCalBCEventCut[bc] ; else return 0 ; }
355 Int_t GetTrackEventBCcut(Int_t bc) const { if(bc >=0 && bc < 19) return fTrackBCEventCut[bc] ; else return 0 ; }
356
357 void SetEMCalEventBC(Int_t bc) { if(bc >=0 && bc < 19) fEMCalBCEvent [bc] = 1 ; }
358 void SetTrackEventBC(Int_t bc) { if(bc >=0 && bc < 19) fTrackBCEvent [bc] = 1 ; }
359 void SetEMCalEventBCcut(Int_t bc) { if(bc >=0 && bc < 19) fEMCalBCEventCut[bc] = 1 ; }
360 void SetTrackEventBCcut(Int_t bc) { if(bc >=0 && bc < 19) fTrackBCEventCut[bc] = 1 ; }
3c1a2e95 361
c2a62a94 362 Int_t GetVertexBC(const AliVVertex * vtx);
363 Int_t GetVertexBC() const { return fVertexBC ; }
364 void SwitchOnRecalculateVertexBC() { fRecalculateVertexBC = kTRUE ; }
365 void SwitchOffRecalculateVertexBC() { fRecalculateVertexBC = kFALSE ; }
975b29fa 366
3a58eee6 367 // Track selection
f5500c7a 368 ULong_t GetTrackStatus() const { return fTrackStatus ; }
369 void SetTrackStatus(ULong_t bit) { fTrackStatus = bit ; }
a5fb4114 370
f5500c7a 371 ULong_t GetTrackFilterMask() const {return fTrackFilterMask ; }
372 void SetTrackFilterMask(ULong_t bit) { fTrackFilterMask = bit ; }
3a58eee6 373
f5500c7a 374 AliESDtrackCuts* GetTrackCuts() const { return fESDtrackCuts ; }
c5693f62 375 void SetTrackCuts(AliESDtrackCuts * cuts) ;
21812953 376
d7601185 377 AliESDtrackCuts* GetTrackComplementaryCuts() const { return fESDtrackComplementaryCuts ; }
378 void SetTrackComplementaryCuts(AliESDtrackCuts * cuts) ;
379
380
f5500c7a 381 void SwitchOnConstrainTrackToVertex() { fConstrainTrack = kTRUE ; }
d7601185 382 void SwitchOffConstrainTrackToVertex() { fConstrainTrack = kFALSE ; }
a9b8c1d0 383
21812953 384 void SwitchOnAODHybridTrackSelection() { fSelectHybridTracks = kTRUE ; }
385 void SwitchOffAODHybridTrackSelection() { fSelectHybridTracks = kFALSE ; }
c5693f62 386
f5500c7a 387 void SwitchOnTrackHitSPDSelection() { fSelectSPDHitTracks = kTRUE ; }
388 void SwitchOffTrackHitSPDSelection() { fSelectSPDHitTracks = kFALSE ; }
389
390 Int_t GetTrackMultiplicity() const { return fTrackMult ; }
391 Float_t GetTrackMultiplicityEtaCut() const { return fTrackMultEtaCut ; }
392 void SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta ; }
c8fe2783 393
a5fb4114 394 // Calorimeter specific and patches
f5500c7a 395 void AnalyzeOnlyLED() { fAnaLED = kTRUE ; }
396 void AnalyzeOnlyPhysics() { fAnaLED = kFALSE ; }
a5fb4114 397
f5500c7a 398 void SwitchOnCaloFilterPatch() { fCaloFilterPatch = kTRUE ;
399 fFillCTS = kFALSE ; }
400 void SwitchOffCaloFilterPatch() { fCaloFilterPatch = kFALSE ; }
a5fb4114 401 Bool_t IsCaloFilterPatchOn() const {
402 if(fDataType == kAOD) { return fCaloFilterPatch ; }
f5500c7a 403 else { return kFALSE ; } }
d9bea110 404
cfaba834 405 //-------------------------------
48c37e02 406 //Vertex methods
cfaba834 407 //-------------------------------
a5fb4114 408 virtual void GetVertex(Double_t v[3]) const ;
409 virtual Double_t* GetVertex(const Int_t evtIndex) const { return fVertex[evtIndex] ; }
410 virtual void GetVertex(Double_t vertex[3], const Int_t evtIndex) const ;
cfaba834 411 virtual void FillVertexArray();
412 virtual Bool_t CheckForPrimaryVertex();
a5fb4114 413 virtual Float_t GetZvertexCut() const { return fZvtxCut ; } //cut on vertex position
414 virtual void SetZvertexCut(Float_t zcut=10.) { fZvtxCut=zcut ; } //cut on vertex position
0b13c1f9 415
05d0d05d 416 //--------------------------
72542aba 417 // Centrality / Event Plane
05d0d05d 418 //--------------------------
ee893147 419 virtual AliCentrality* GetCentrality() const { if(fDataType!=kMC) return fInputEvent->GetCentrality() ;
420 else return 0x0 ; }
a5fb4114 421 virtual void SetCentralityClass(TString name) { fCentralityClass = name ; }
422 virtual void SetCentralityOpt(Int_t opt) { fCentralityOpt = opt ; }
423 virtual TString GetCentralityClass() const { return fCentralityClass ; }
424 virtual Int_t GetCentralityOpt() const { return fCentralityOpt ; }
425 virtual Int_t GetEventCentrality() const ;
426 virtual void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
427 { fCentralityBin[0]=min; fCentralityBin[1]=max;
428 if(min>=0 && max > 0) fCentralityOpt = 100 ; }
429 virtual Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return 0 ;
430 else return fCentralityBin[i] ; }
431
ee893147 432 virtual AliEventplane* GetEventPlane() const { if(fDataType!=kMC) return fInputEvent->GetEventplane() ;
433 else return 0x0 ; }
9929c80b 434 virtual Double_t GetEventPlaneAngle() const ;
3c75ddf7 435 virtual void SetEventPlaneMethod(TString m) { fEventPlaneMethod = m ; }
436 virtual TString GetEventPlaneMethod() const { return fEventPlaneMethod ; }
72542aba 437
39364a52 438 //--------------------
439 // Mixing
440 //--------------------
441
d783becb 442 Int_t GetLastCaloMixedEvent() const { return fLastMixedCaloEvent ; }
39364a52 443 Int_t GetLastTracksMixedEvent () const { return fLastMixedTracksEvent ; }
444
50551817 445 TList * GetListWithMixedEventsForCalo (Int_t bi) const { if(fListMixedCaloEvents) return fListMixedCaloEvents[bi] ; else return 0 ; }
446 TList * GetListWithMixedEventsForTracks(Int_t bi) const { if(fListMixedTracksEvents) return fListMixedTracksEvents [bi] ; else return 0 ; }
39364a52 447
d783becb 448 Bool_t ListWithMixedEventsForCaloExists() const { if(fListMixedCaloEvents) return kTRUE ;
449 else return kFALSE ; }
39364a52 450
d783becb 451 Bool_t ListWithMixedEventsForTracksExists() const { if(fListMixedTracksEvents) return kTRUE ;
452 else return kFALSE ; }
39364a52 453
d783becb 454 void SetLastCaloMixedEvent (Int_t e) { fLastMixedCaloEvent = e ; }
455 void SetLastTracksMixedEvent(Int_t e) { fLastMixedTracksEvent = e ; }
39364a52 456
d783becb 457 void SetListWithMixedEventsForCalo (TList ** l) {
458 if(fListMixedCaloEvents) printf("AliCaloTrackReader::SetListWithMixedEventsForCalo() - Track Mixing event list already set, nothing done\n");
459 else fListMixedCaloEvents = l ; }
39364a52 460
d783becb 461 void SetListWithMixedEventsForTracks(TList ** l) {
462 if(fListMixedTracksEvents) printf("AliCaloTrackReader::SetListWithMixedEventsForTracks() - Calorimeter Mixing event list already set, nothing done\n");
39364a52 463 else fListMixedTracksEvents = l ; }
464
cfaba834 465 //-------------------------------------
466 // Other methods
467 //-------------------------------------
3c75ddf7 468 AliCalorimeterUtils * GetCaloUtils() const { return fCaloUtils ; }
469 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
48c37e02 470
a5fb4114 471 virtual Double_t GetBField() const { return fInputEvent->GetMagneticField() ; }
cfaba834 472
de0b770d 473 void SetImportGeometryFromFile(Bool_t import,
55d66f31 474 TString path = "") {
de0b770d 475 fImportGeometryFromFile = import ;
476 fImportGeometryFilePath = path ; }
477
cfaba834 478 //------------------------------------------------
479 // MC analysis specific methods
480 //-------------------------------------------------
481
482 //Kinematics and galice.root available
a5fb4114 483 virtual AliStack* GetStack() const ;
484 virtual AliHeader* GetHeader() const ;
485 virtual AliGenEventHeader* GetGenEventHeader() const ;
cfaba834 486
487 //Filtered kinematics in AOD
2644ead9 488 virtual TClonesArray* GetAODMCParticles() const ;
489 virtual AliAODMCHeader* GetAODMCHeader () const ;
2644ead9 490
3c75ddf7 491 virtual AliVEvent* GetInputEvent() const { return fInputEvent ; }
492 virtual AliVEvent* GetOriginalInputEvent() const { return 0x0 ; }
493 virtual AliAODEvent* GetOutputEvent() const { return fOutputEvent ; }
494 virtual AliMCEvent* GetMC() const { return fMC ; }
495 virtual AliMixedEvent* GetMixedEvent() const { return fMixedEvent ; }
496 virtual Int_t GetNMixedEvent() const { return fNMixedEvent ; }
a5fb4114 497
3c75ddf7 498 void SwitchOnStack() { fReadStack = kTRUE ; }
499 void SwitchOffStack() { fReadStack = kFALSE ; }
500 void SwitchOnAODMCParticles() { fReadAODMCParticles = kTRUE ; }
501 void SwitchOffAODMCParticles() { fReadAODMCParticles = kFALSE ; }
502 Bool_t ReadStack() const { return fReadStack ; }
503 Bool_t ReadAODMCParticles() const { return fReadAODMCParticles ; }
cfaba834 504
505 //Select generated events, depending on comparison of pT hard and jets.
a5fb4114 506 virtual Bool_t ComparePtHardAndJetPt() ;
507 virtual Bool_t IsPtHardAndJetPtComparisonSet() const { return fComparePtHardAndJetPt ; }
508 virtual void SetPtHardAndJetPtComparison(Bool_t compare) { fComparePtHardAndJetPt = compare ; }
509 virtual Float_t GetPtHardAndJetFactor() const { return fPtHardAndJetPtFactor ; }
510 virtual void SetPtHardAndJetPtFactor(Float_t factor) { fPtHardAndJetPtFactor = factor ; }
eb3e2665 511
dbb3de7b 512 virtual Bool_t ComparePtHardAndClusterPt() ;
513 virtual Bool_t IsPtHardAndClusterPtComparisonSet() const { return fComparePtHardAndClusterPt ; }
514 virtual void SetPtHardAndClusterPtComparison(Bool_t compare) { fComparePtHardAndClusterPt = compare ; }
515 virtual Float_t GetPtHardAndClusterFactor() const { return fPtHardAndClusterPtFactor ; }
516 virtual void SetPtHardAndClusterPtFactor(Float_t factor) { fPtHardAndClusterPtFactor = factor ; }
517
518
cfaba834 519 //MC reader methods, declared there to allow compilation, they are only used in the MC reader:
0ae57829 520
a5fb4114 521 virtual void AddNeutralParticlesArray(TArrayI & /*array*/) { ; }
522 virtual void AddChargedParticlesArray(TArrayI & /*array*/) { ; }
523 virtual void AddStatusArray(TArrayI & /*array*/) { ; }
524
525 virtual void SwitchOnPi0Decay() { ; }
526 virtual void SwitchOffPi0Decay() { ; }
527 virtual void SwitchOnStatusSelection() { ; }
528 virtual void SwitchOffStatusSelection() { ; }
529 virtual void SwitchOnOverlapCheck() { ; }
530 virtual void SwitchOffOverlapCheck() { ; }
531 virtual void SwitchOnOnlyGeneratorParticles() { ; }
532 virtual void SwitchOffOnlyGeneratorParticles() { ; }
be518ab0 533
a5fb4114 534 virtual void SetEMCALOverlapAngle(Float_t /*angle*/) { ; }
535 virtual void SetPHOSOverlapAngle(Float_t /*angle*/) { ; }
af7b3903 536
0ae57829 537
1c5acb87 538 protected:
d9bea110 539 Int_t fEventNumber; // Event number
540 Int_t fDataType ; // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
541 Int_t fDebug; // Debugging level
542 AliFiducialCut * fFiducialCut; // Acceptance cuts
543 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
544
545 Bool_t fComparePtHardAndJetPt; // In MonteCarlo, jet events, reject fake events with wrong jet energy.
546 Float_t fPtHardAndJetPtFactor; // Factor between ptHard and jet pT to reject/accept event.
547
548 Bool_t fComparePtHardAndClusterPt; // In MonteCarlo, jet events, reject events with too large cluster energy
549 Float_t fPtHardAndClusterPtFactor; // Factor between ptHard and cluster pT to reject/accept event.
550
551 Float_t fCTSPtMin; // pT Threshold on charged particles
552 Float_t fEMCALPtMin; // pT Threshold on emcal clusters
553 Float_t fPHOSPtMin; // pT Threshold on phos clusters
554 Float_t fCTSPtMax; // pT Threshold on charged particles
555 Float_t fEMCALPtMax; // pT Threshold on emcal clusters
556 Float_t fPHOSPtMax; // pT Threshold on phos clusters
557 Bool_t fUseEMCALTimeCut; // Do time cut selection
558 Bool_t fUseParamTimeCut; // Use simple or parametrized time cut
559 Bool_t fUseTrackTimeCut; // Do time cut selection
560 Double_t fEMCALTimeCutMin; // Remove clusters/cells with time smaller than this value, in ns
561 Double_t fEMCALTimeCutMax; // Remove clusters/cells with time larger than this value, in ns
562 Float_t fEMCALParamTimeCutMin[4]; // Remove clusters/cells with time smaller than parametrized value, in ns
563 Double_t fEMCALParamTimeCutMax[4]; // Remove clusters/cells with time larger than parametrized value, in ns
564 Double_t fTrackTimeCutMin; // Remove tracks with time smaller than this value, in ns
565 Double_t fTrackTimeCutMax; // Remove tracks with time larger than this value, in ns
566 Bool_t fUseTrackDCACut; // Do DCA selection
567 Double_t fTrackDCACut[3]; // Remove tracks with DCA larger than cut, parameters of function stored here
568
569 TList * fAODBranchList ; //-> List with AOD branches created and needed in analysis
570 TObjArray * fCTSTracks ; //-> temporal array with tracks
571 TObjArray * fEMCALClusters ; //-> temporal array with EMCAL CaloClusters
572 TObjArray * fPHOSClusters ; //-> temporal array with PHOS CaloClusters
573 AliVCaloCells * fEMCALCells ; //! temporal array with EMCAL CaloCells
574 AliVCaloCells * fPHOSCells ; //! temporal array with PHOS CaloCells
575
576 AliVEvent * fInputEvent; //! pointer to esd or aod input
577 AliAODEvent * fOutputEvent; //! pointer to aod output
578 AliMCEvent * fMC; //! Monte Carlo Event Handler
579
580 Bool_t fFillCTS; // use data from CTS
581 Bool_t fFillEMCAL; // use data from EMCAL
582 Bool_t fFillPHOS; // use data from PHOS
583 Bool_t fFillEMCALCells; // use data from EMCAL
584 Bool_t fFillPHOSCells; // use data from PHOS
585 Bool_t fRecalculateClusters; // Correct clusters, recalculate them if recalibration parameters is given
586 Bool_t fSelectEmbeddedClusters; // Use only simulated clusters that come from embedding.
587
588 ULong_t fTrackStatus ; // Track selection bit, select tracks refitted in TPC, ITS ...
589 ULong_t fTrackFilterMask ; // Track selection bit, for AODs (any difference with track status?)
590 AliESDtrackCuts *fESDtrackCuts ; // Track cut
591 AliESDtrackCuts *fESDtrackComplementaryCuts; // Track cut, complementary cuts for hybrids
592 Bool_t fConstrainTrack ; // Constrain Track to vertex
593 Bool_t fSelectHybridTracks ; // Select CTS tracks of type hybrid (only for AODs)
594 Bool_t fSelectSPDHitTracks ; // Ensure that track hits SPD layers
595 Int_t fTrackMult ; // Track multiplicity
596 Float_t fTrackMultEtaCut ; // Track multiplicity eta cut
597 Bool_t fReadStack ; // Access kine information from stack
598 Bool_t fReadAODMCParticles ; // Access kine information from filtered AOD MC particles
591cc579 599
d9bea110 600 TString fDeltaAODFileName ; // Delta AOD file name
601 TString fFiredTriggerClassName; // Name of trigger event type used to do the analysis
602
603 // Trigger bit
604 UInt_t fEventTriggerMask ; // select this triggerered event
605 UInt_t fMixEventTriggerMask ; // select this triggerered event for mixing, tipically kMB or kAnyINT
606 Bool_t fEventTriggerAtSE; // select triggered event at SE base task or here
607
608 Bool_t fEventTrigMinBias ; // Event is min bias on its name, it should correspond to AliVEvent::kMB, AliVEvent::kAnyInt
609 Bool_t fEventTrigCentral ; // Event is AliVEvent::kCentral on its name, it should correspond to PbPb
610 Bool_t fEventTrigSemiCentral ; // Event is AliVEvent::kSemiCentral on its name, it should correspond to PbPb
611 Bool_t fEventTrigEMCALL0 ; // Event is EMCal L0 on its name, it should correspond to AliVEvent::kEMC7, AliVEvent::kEMC1
612 Bool_t fEventTrigEMCALL1Gamma1 ; // Event is L1-Gamma, threshold 1 on its name, it should correspond kEMCEGA
613 Bool_t fEventTrigEMCALL1Gamma2 ; // Event is L1-Gamma, threshold 2 on its name, it should correspond kEMCEGA
614 Bool_t fEventTrigEMCALL1Jet1 ; // Event is L1-Gamma, threshold 1 on its name, it should correspond kEMCEGA
615 Bool_t fEventTrigEMCALL1Jet2 ; // Event is L1-Gamma, threshold 2 on its name, it should correspond kEMCEGA
616
617 Int_t fBitEGA; // Trigger bit on VCaloTrigger for EGA
618 Int_t fBitEJE; // Trigger bit on VCaloTrigger for EJE
619
620 Bool_t fAnaLED; // Analyze LED data only.
c1ac3823 621
d9bea110 622 TString fTaskName; // Name of task that executes the analysis
765d44e7 623
d9bea110 624 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
c8fe2783 625
d9bea110 626 AliMixedEvent * fMixedEvent ; //! mixed event object. This class is not the owner
627 Int_t fNMixedEvent ; // number of events in mixed event buffer
628 Double_t ** fVertex ; //! vertex array 3 dim for each mixed event buffer
c8fe2783 629
d9bea110 630 TList ** fListMixedTracksEvents ; //! Container for tracks stored for different events, used in case of own mixing, set in analysis class
631 TList ** fListMixedCaloEvents; //! Container for photon stored for different events, used in case of own mixing, set in analysis class
632 Int_t fLastMixedTracksEvent ; // Temporary container with the last event added to the mixing list for tracks
633 Int_t fLastMixedCaloEvent ; // Temporary container with the last event added to the mixing list for photons
39364a52 634
d9bea110 635 Bool_t fWriteOutputDeltaAOD; // Write the created delta AOD objects into file
636 Bool_t fOldAOD; // Old AODs, before revision 4.20
f37fa8d2 637
d9bea110 638 Int_t fV0ADC[2] ; // Integrated V0 signal
639 Int_t fV0Mul[2] ; // Integrated V0 Multiplicity
798a9b04 640
d9bea110 641 Bool_t fCaloFilterPatch; // CaloFilter patch
642 TString fEMCALClustersListName; // Alternative list of clusters produced elsewhere and not from InputEvent
cd2e4ce6 643
644 // Event selection
645 Float_t fZvtxCut ; // Cut on vertex position
646 Bool_t fAcceptFastCluster; // Accept events from fast cluster, exclude these events for LHC11a
647 Bool_t fRemoveLEDEvents; // Remove events where LED was wrongly firing - EMCAL LHC11a
9bf1c947 648
afb3af8a 649 Bool_t fRemoveBadTriggerEvents; // Remove triggered events because trigger was exotic, bad, or out of BC
650 Bool_t fTriggerPatchClusterMatch; // Search for the trigger patch and check if associated cluster was the trigger
9bf1c947 651 Int_t fTriggerPatchTimeWindow[2]; // Trigger patch selection window
afb3af8a 652 Float_t fTriggerEventThreshold; // Threshold to look for triggered events
653 Int_t fTriggerClusterBC; // Event triggered by a cluster in BC -5 0 to 5
654 Int_t fTriggerClusterIndex; // Index in clusters array of trigger cluster
655 Int_t fTriggerClusterId; // Id of trigger cluster (cluster->GetID())
656 Bool_t fIsExoticEvent; // Exotic trigger event flag
1035a8d9 657 Bool_t fIsBadCellEvent; // Bad cell triggered event flag, any cell in cluster is bad
658 Bool_t fIsBadMaxCellEvent; // Bad cell triggered event flag, only max energy cell is bad
afb3af8a 659 Int_t fIsTriggerMatch; // Could not match the event to a trigger patch
9bf1c947 660
20218aea 661 Bool_t fDoEventSelection; // Select events depending on V0, pileup, vertex well reconstructed, at least 1 track ...
662 Bool_t fDoV0ANDEventSelection; // Select events depending on V0, fDoEventSelection should be on
cc944149 663 Bool_t fDoVertexBCEventSelection; // Select events with vertex on BC=0 or -100
2644ead9 664 Bool_t fDoRejectNoTrackEvents; // Reject events with no selected tracks in event
20218aea 665 Bool_t fUseEventsWithPrimaryVertex ; // Select events with primary vertex
666 AliTriggerAnalysis* fTriggerAnalysis; // Access to trigger selection algorithm for V0AND calculation
034e885b 667
668 Bool_t fTimeStampEventSelect; // Select events within a fraction of data taking time
669 Float_t fTimeStampEventFracMin; // Minimum value of time stamp fraction event
670 Float_t fTimeStampEventFracMax; // Maximum value of time stamp fraction event
b370e713 671 Double_t fTimeStampRunMin; // Minimum value of time stamp in run
672 Double_t fTimeStampRunMax; // Maximum value of time stamp in run
034e885b 673
3c1a2e95 674 Double_t fPileUpParamSPD[5]; // Parameters to pass to method IsPileupFromSPD: Int_t minContributors,
4b75cb39 675 // Double_t minZdist,
676 // Double_t nSigmaZdist,
677 // Double_t nSigmaDiamXY,
678 // Double_t nSigmaDiamZ)
034e885b 679
3c1a2e95 680 // Pile-up in EMCal
681 Int_t fNPileUpClusters; // Number of clusters with time avobe 20 ns
682 Int_t fNNonPileUpClusters; // Number of clusters with time below 20 ns
683 Int_t fNPileUpClustersCut; // Cut to select event as pile-up
975b29fa 684 Int_t fEMCalBCEvent[19]; // Fill one entry per event if there is a cluster in a given BC
685 Int_t fEMCalBCEventCut[19]; // Fill one entry per event if there is a cluster in a given BC, depend on cluster E, acceptance cut
686 Int_t fTrackBCEvent[19]; // Fill one entry per event if there is a track in a given BC
687 Int_t fTrackBCEventCut[19]; // Fill one entry per event if there is a track in a given BC, depend on track pT, acceptance cut
cc944149 688 Int_t fVertexBC; // Vertex BC
689 Bool_t fRecalculateVertexBC; // Recalculate vertex BC from tracks pointing to vertex
690
72542aba 691 //Centrality/Event plane
d9bea110 692 TString fCentralityClass; // Name of selected centrality class
693 Int_t fCentralityOpt; // Option for the returned value of the centrality, possible options 5, 10, 100
694 Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
695 TString fEventPlaneMethod; // Name of event plane method, by default "Q"
32fd29fe 696
d9bea110 697 Bool_t fImportGeometryFromFile; // Import geometry settings in geometry.root file
698 TString fImportGeometryFilePath; // path fo geometry.root file
de0b770d 699
d9bea110 700
0de1814a 701 AliCaloTrackReader( const AliCaloTrackReader & r) ; // cpy ctor
702 AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
f3138ecf 703
d9bea110 704 ClassDef(AliCaloTrackReader,56)
f3138ecf 705
1c5acb87 706} ;
707
708
709#endif //ALICALOTRACKREADER_H
710
711
712