]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrBase/AliCaloTrackReader.h
Select events within a given centrality bin, move centrality code from AliAnaPartCorr...
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / 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 */
5/* $Id: $ */
6
7//_________________________________________________________________________
8// Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and
9// Central Barrel Tracking detectors.
10// Not all MC particles/tracks/clusters are kept, some kinematical restrictions are done.
591cc579 11// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TObjArrays (PHOS, EMCAL, CTS)
12// : AliCaloTrackMCReader: Fills Kinematics data in 3 TObjArrays (PHOS, EMCAL, CTS)
13// : AliCaloTrackAODReader: Fills AOD data in 3 TObjArrays (PHOS, EMCAL, CTS)
1e68a3f4 14//
15// This part is commented: Mixing analysis can be done, input AOD with events
16// is opened in the AliCaloTrackReader::Init()
17
1c5acb87 18// -- Author: Gustavo Conesa (INFN-LNF)
19
20// --- ROOT system ---
21#include "TObject.h"
591cc579 22class TObjArray ;
a97cd470 23#include "TString.h"
591cc579 24class TTree ;
1c5acb87 25
26//--- ANALYSIS system ---
27class AliStack ;
28class AliHeader ;
29class AliGenEventHeader ;
477d6cee 30class AliVEvent;
8dacfd76 31class AliAODEvent;
477d6cee 32class AliMCEvent;
c8fe2783 33class AliMixedEvent;
34#include "AliVCaloCells.h"
decca433 35#include "AliFiducialCut.h"
591cc579 36class AliAODMCHeader;
765d44e7 37#include "AliCalorimeterUtils.h"
3a58eee6 38class AliESDtrackCuts;
b6dd6ad2 39class AliCentrality;
1c5acb87 40
41class AliCaloTrackReader : public TObject {
42
03190ad7 43public:
1c5acb87 44 AliCaloTrackReader() ; // ctor
1c5acb87 45 virtual ~AliCaloTrackReader() ;//virtual dtor
03190ad7 46private:
78219bac 47 AliCaloTrackReader(const AliCaloTrackReader & g) ; // cpy ctor
03190ad7 48 AliCaloTrackReader & operator = (const AliCaloTrackReader & g) ;//cpy assignment
49
50public:
1c5acb87 51 enum inputDataType {kESD, kAOD, kMC};
f37fa8d2 52
591cc579 53 //Select generated events, depending on comparison of pT hard and jets.
54 virtual Bool_t ComparePtHardAndJetPt() ;
55 virtual Bool_t IsPtHardAndJetPtComparisonSet() const {return fComparePtHardAndJetPt ;}
56 virtual void SetPtHardAndJetPtComparison(Bool_t compare) { fComparePtHardAndJetPt = compare ;}
57 virtual Float_t GetPtHardAndJetFactor() const {return fPtHardAndJetPtFactor ;}
58 virtual void SetPtHardAndJetPtFactor(Float_t factor) { fPtHardAndJetPtFactor = factor ;}
59
1c5acb87 60 virtual void InitParameters();
61 virtual void Print(const Option_t * opt) const;
62
63 virtual Int_t GetDebug() const { return fDebug ; }
64 virtual void SetDebug(Int_t d) { fDebug = d ; }
65 virtual Int_t GetDataType() const { return fDataType ; }
66 virtual void SetDataType(Int_t data ) { fDataType = data ; }
67
a79a2424 68 virtual Int_t GetEventNumber() const {return fEventNumber ; }
69 virtual TString GetCurrentFileName() const {return fCurrentFileName ; }
70
1c5acb87 71 //Minimum pt setters and getters
72 virtual Float_t GetEMCALPtMin() const { return fEMCALPtMin ; }
73 virtual Float_t GetPHOSPtMin() const { return fPHOSPtMin ; }
74 virtual Float_t GetCTSPtMin() const { return fCTSPtMin ; }
75
76 virtual void SetEMCALPtMin(Float_t pt) { fEMCALPtMin = pt ; }
77 virtual void SetPHOSPtMin(Float_t pt) { fPHOSPtMin = pt ; }
78 virtual void SetCTSPtMin(Float_t pt) { fCTSPtMin = pt ; }
79
80 //Input setters and getters
f37fa8d2 81 Bool_t IsEMCALCluster(AliVCluster *clus) const;
82 Bool_t IsPHOSCluster (AliVCluster *clus) const;
83 void SwitchOnOldAODs() {fOldAOD = kTRUE ; }
84 void SwitchOffOldAODs() {fOldAOD = kFALSE ; }
85
1c5acb87 86 Bool_t IsCTSSwitchedOn() const { return fFillCTS ; }
f37fa8d2 87 void SwitchOnCTS() {fFillCTS = kTRUE ; }
1c5acb87 88 void SwitchOffCTS() {fFillCTS = kFALSE ; }
89
90 Bool_t IsEMCALSwitchedOn() const { return fFillEMCAL ; }
f37fa8d2 91 void SwitchOnEMCAL() {fFillEMCAL = kTRUE ; }
1c5acb87 92 void SwitchOffEMCAL() {fFillEMCAL = kFALSE ; }
93
94 Bool_t IsPHOSSwitchedOn() const { return fFillPHOS ; }
f37fa8d2 95 void SwitchOnPHOS() {fFillPHOS = kTRUE ; }
1c5acb87 96 void SwitchOffPHOS() {fFillPHOS = kFALSE ; }
97
98 Bool_t IsEMCALCellsSwitchedOn() const { return fFillEMCALCells ; }
f37fa8d2 99 void SwitchOnEMCALCells() {fFillEMCALCells = kTRUE ; }
1c5acb87 100 void SwitchOffEMCALCells() {fFillEMCALCells = kFALSE ; }
101
102 Bool_t IsPHOSCellsSwitchedOn() const { return fFillPHOSCells ; }
f37fa8d2 103 void SwitchOnPHOSCells() {fFillPHOSCells = kTRUE ; }
1c5acb87 104 void SwitchOffPHOSCells() {fFillPHOSCells = kFALSE ; }
105
29b2ceec 106 virtual Bool_t FillInputEvent(const Int_t iEntry, const char *currentFileName) ;
c8fe2783 107 virtual void FillInputCTS() ;
108 virtual void FillInputEMCAL() ;
c4eec29f 109 virtual void FillInputEMCALAlgorithm(AliVCluster * clus, const Int_t iclus) ;
c8fe2783 110 virtual void FillInputPHOS() ;
111 virtual void FillInputEMCALCells() ;
112 virtual void FillInputPHOSCells() ;
c4eec29f 113 void SetEMCALClusterListName(TString &name) {fEMCALClustersListName = name;}
114
f37fa8d2 115 virtual TList * GetAODBranchList() const { return fAODBranchList ; }
1c5acb87 116
f37fa8d2 117 virtual TObjArray* GetAODCTS() const {return fAODCTS ;}
591cc579 118 virtual TObjArray* GetAODEMCAL() const {return fAODEMCAL ;}
f37fa8d2 119 virtual TObjArray* GetAODPHOS() const {return fAODPHOS ;}
c8fe2783 120 virtual AliVCaloCells* GetEMCALCells() const { return fEMCALCells ;}
f37fa8d2 121 virtual AliVCaloCells* GetPHOSCells() const { return fPHOSCells ;}
1c5acb87 122
591cc579 123 //Get MC informatio
124 //Kinematics and galice.root available
477d6cee 125 virtual AliStack* GetStack() const ;
126 virtual AliHeader* GetHeader() const ;
1c5acb87 127 virtual AliGenEventHeader* GetGenEventHeader() const ;
591cc579 128 //Filtered kinematics in AOD
129 virtual TClonesArray* GetAODMCParticles(Int_t input = 0) const ;
130 virtual AliAODMCHeader* GetAODMCHeader(Int_t input = 0) const ;
131
f8006433 132 virtual AliVEvent* GetInputEvent() const {return fInputEvent;}
133 virtual AliAODEvent* GetOutputEvent() const {return fOutputEvent;}
134 virtual AliMCEvent* GetMC() const {return fMC;}
135 virtual AliMixedEvent* GetMixedEvent() const {return fMixedEvent;}
136 virtual Int_t GetNMixedEvent() const {return fNMixedEvent ; }
137
138 virtual Double_t GetBField() const { return 0.;}
591cc579 139
140 virtual void Init();
f8006433 141
c8fe2783 142// virtual void SetInputEvent(AliVEvent* const input) {fInputEvent = input;}
143 virtual void SetInputEvent(AliVEvent* const input) ;
8dacfd76 144 virtual void SetOutputEvent(AliAODEvent* const aod) {fOutputEvent = aod;}
145 virtual void SetMC(AliMCEvent* const mc) {fMC = mc;}
1c5acb87 146
147 virtual void ResetLists();
148
decca433 149 virtual AliFiducialCut * GetFiducialCut() {if(!fFiducialCut) fFiducialCut = new AliFiducialCut();
150 return fFiducialCut ;}
ff45398a 151 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFiducialCut = fc ;}
decca433 152 virtual Bool_t IsFiducialCutOn() {return fCheckFidCut ; }
153 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; fFiducialCut = new AliFiducialCut();}
154 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE;}
29b2ceec 155
477d6cee 156 virtual void SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) {;}
591cc579 157
158 //Methods for mixing with external input file (AOD)
1e68a3f4 159 //virtual TTree* GetSecondInputAODTree() const {return fSecondInputAODTree ; }
591cc579 160 //virtual void SetSecondInputAODTree(TTree * tree) {fSecondInputAODTree = tree ;
161 // fSecondInputAODEvent->ReadFromTree(tree);}//Connect tree and AOD event.
162
1e68a3f4 163 //virtual AliAODEvent* GetSecondInputAODEvent() const { return fSecondInputAODEvent ; }
591cc579 164
1e68a3f4 165 //TString GetSecondInputFileName() const {return fSecondInputFileName ; }
166 //void SetSecondInputFileName(TString name) { fSecondInputFileName = name ; }
1c5acb87 167
1e68a3f4 168 //Int_t GetSecondInputFirstEvent() const {return fSecondInputFirstEvent ; }
169 //void SetSecondInputFirstEvent(Int_t iEvent0) { fSecondInputFirstEvent = iEvent0 ; }
591cc579 170
1e68a3f4 171// Int_t GetAODCTSNormalInputEntries() {if(!fSecondInputAODTree) { fAODCTSNormalInputEntries = fAODCTS->GetEntriesFast() ;}
172// return fAODCTSNormalInputEntries ; }
173// Int_t GetAODEMCALNormalInputEntries() {if(!fSecondInputAODTree) { fAODEMCALNormalInputEntries = fAODEMCAL->GetEntriesFast();}
174// return fAODEMCALNormalInputEntries ; }
175// Int_t GetAODPHOSNormalInputEntries() {if(!fSecondInputAODTree) { fAODPHOSNormalInputEntries = fAODPHOS->GetEntriesFast() ;}
176// return fAODPHOSNormalInputEntries ; }
591cc579 177
3a58eee6 178 // Track selection
179 ULong_t GetTrackStatus() const {return fTrackStatus ; }
591cc579 180 void SetTrackStatus(ULong_t bit) { fTrackStatus = bit ; }
181
3a58eee6 182 AliESDtrackCuts* GetTrackCuts() const { return fESDtrackCuts ; }
183 void SetTrackCuts(AliESDtrackCuts * cuts) { fESDtrackCuts = cuts ; }
184 Int_t GetTrackMultiplicity() const { return fTrackMult ; }
185 Float_t GetTrackMultiplicityEtaCut() const { return fTrackMultEtaCut ; }
186 void SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta ; }
187
188 //MC switchs
591cc579 189 void SwitchOnStack() { fReadStack = kTRUE ; }
190 void SwitchOffStack() { fReadStack = kFALSE ; }
191 void SwitchOnAODMCParticles() { fReadAODMCParticles = kTRUE ; }
192 void SwitchOffAODMCParticles() { fReadAODMCParticles = kFALSE ; }
193 Bool_t ReadStack() const { return fReadStack ; }
194 Bool_t ReadAODMCParticles() const { return fReadAODMCParticles ; }
195
42dc8e7d 196 void SetDeltaAODFileName(TString name ) {fDeltaAODFileName = name ; }
197 TString GetDeltaAODFileName() const {return fDeltaAODFileName ; }
72d2488e 198
199 void SetFiredTriggerClassName(TString name ) {fFiredTriggerClassName = name ; }
200 TString GetFiredTriggerClassName() const {return fFiredTriggerClassName ; }
201 virtual TString GetFiredTriggerClasses() {return "";}
0866d83a 202
c1ac3823 203 void AnalyzeOnlyLED() {fAnaLED = kTRUE;}
204 void AnalyzeOnlyPhysics() {fAnaLED = kFALSE;}
205
486258c9 206 TString GetTaskName() const {return fTaskName;}
207 void SetTaskName(TString name) {fTaskName = name;}
208
765d44e7 209 AliCalorimeterUtils * GetCaloUtils() const {return fCaloUtils ; }
210 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
c8fe2783 211
f8006433 212 virtual void GetVertex(Double_t v[3]) const ;
213 virtual Double_t* GetVertex(const Int_t evtIndex) const {return fVertex[evtIndex];}
214 virtual void GetVertex(Double_t vertex[3], const Int_t evtIndex) const ;
215 virtual void FillVertexArray();
216 // virtual void GetSecondInputAODVertex(Double_t *) const {;}
0b13c1f9 217 virtual Float_t GetZvertexCut() const {return fZvtxCut ;} //cut on vertex position
218 virtual void SetZvertexCut(Float_t zcut=10.){fZvtxCut=zcut ;} //cut on vertex position
219
f37fa8d2 220 void SwitchOnWriteDeltaAOD() {fWriteOutputDeltaAOD = kTRUE ; }
221 void SwitchOffWriteDeltaAOD() {fWriteOutputDeltaAOD = kFALSE ; }
222 Bool_t WriteDeltaAODToFile() const {return fWriteOutputDeltaAOD ; }
1e68a3f4 223
798a9b04 224 virtual void FillInputVZERO(){;}
225 Int_t GetV0Signal(Int_t i) const { return fV0ADC[i];}
226 Int_t GetV0Multiplicity(Int_t i) const { return fV0Mul[i];}
227
af7b3903 228 void SwitchOnCaloFilterPatch() {fCaloFilterPatch = kTRUE ; fFillCTS = kFALSE; }
229 void SwitchOffCaloFilterPatch() {fCaloFilterPatch = kFALSE ; }
230 Bool_t IsCaloFilterPatchOn() {if(fDataType == kAOD) { return fCaloFilterPatch ; }
231 else { return kFALSE ; } }
32fd29fe 232 //Centrality
233 virtual AliCentrality* GetCentrality() const {return 0x0;} //Actual method to recover the pointer is in the ESD/AODReader
234 void SetCentralityClass(TString name) { fCentralityClass = name ;}
235 void SetCentralityOpt(Int_t opt) { fCentralityOpt = opt ;}
236 TString GetCentralityClass() const { return fCentralityClass ;}
237 Int_t GetCentralityOpt() const { return fCentralityOpt ;}
238 Int_t GetEventCentrality() const ;
239 void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
240 {fCentralityBin[0]=min; fCentralityBin[1]=max; if(min>=0 && max > 0) fCentralityOpt = 100; }
241 Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return 0 ; else return fCentralityBin[i] ; }
eb3e2665 242
0ae57829 243 //MC reader methods:
244
245 virtual void AddNeutralParticlesArray(TArrayI & /*array*/) { ; }
246 virtual void AddChargedParticlesArray(TArrayI & /*array*/) { ; }
247 virtual void AddStatusArray(TArrayI & /*array*/) { ; }
248
249 virtual void SwitchOnPi0Decay() { ; }
250 virtual void SwitchOffPi0Decay() { ; }
251 virtual void SwitchOnStatusSelection() { ; }
252 virtual void SwitchOffStatusSelection() { ; }
253 virtual void SwitchOnOverlapCheck() { ; }
254 virtual void SwitchOffOverlapCheck() { ; }
255
256 virtual void SetEMCALOverlapAngle(Float_t /*angle*/) { ; }
257 virtual void SetPHOSOverlapAngle(Float_t /*angle*/) { ; }
af7b3903 258
0ae57829 259
1c5acb87 260 protected:
7e25653f 261 Int_t fEventNumber; // Event number
262 TString fCurrentFileName;// Current file name under analysis
263 Int_t fDataType ; // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
264 Int_t fDebug; // Debugging level
265 AliFiducialCut * fFiducialCut; //! Acceptance cuts
266 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
decca433 267
591cc579 268 Bool_t fComparePtHardAndJetPt; // In MonteCarlo, jet events, reject fake events with wrong jet energy.
269 Float_t fPtHardAndJetPtFactor; // Factor between ptHard and jet pT to reject/accept event.
270
7e25653f 271 Float_t fCTSPtMin; // pT Threshold on charged particles
272 Float_t fEMCALPtMin; // pT Threshold on emcal clusters
273 Float_t fPHOSPtMin; // pT Threshold on phos clusters
1c5acb87 274
7e25653f 275 TList * fAODBranchList ; //! List with AOD branches created and needed in analysis
276 TObjArray * fAODCTS ; //! temporal referenced array with tracks
277 TObjArray * fAODEMCAL ; //! temporal referenced array with EMCAL CaloClusters
278 TObjArray * fAODPHOS ; //! temporal referenced array with PHOS CaloClusters
279 AliVCaloCells * fEMCALCells ; //! temporal array with EMCAL CaloCells, ESD or AOD
280 AliVCaloCells * fPHOSCells ; //! temporal array with PHOS CaloCells, ESD or AOD
1c5acb87 281
7e25653f 282 AliVEvent * fInputEvent; //! pointer to esd or aod input
283 AliAODEvent * fOutputEvent; //! pointer to aod output
284 AliMCEvent * fMC; //! Monte Carlo Event Handler
1c5acb87 285
7e25653f 286 Bool_t fFillCTS; // use data from CTS
287 Bool_t fFillEMCAL; // use data from EMCAL
288 Bool_t fFillPHOS; // use data from PHOS
289 Bool_t fFillEMCALCells; // use data from EMCAL
290 Bool_t fFillPHOSCells; // use data from PHOS
1c5acb87 291
1e68a3f4 292// TTree * fSecondInputAODTree; // Tree with second input AOD, for mixing analysis.
293// AliAODEvent* fSecondInputAODEvent; //! pointer to second input AOD event.
294// TString fSecondInputFileName; // File with AOD data to mix with normal stream of data.
295// Int_t fSecondInputFirstEvent; // First event to be considered in the mixing.
296//
297// Int_t fAODCTSNormalInputEntries; // Number of entries in CTS in case of standard input, larger with mixing.
298// Int_t fAODEMCALNormalInputEntries; // Number of entries in EMCAL in case of standard input, larger with mixing.
299// Int_t fAODPHOSNormalInputEntries; // Number of entries in PHOS in case of standard input, larger with mixing.
591cc579 300
7e25653f 301 ULong_t fTrackStatus ; // Track selection bit, select tracks refitted in TPC, ITS ...
3a58eee6 302 AliESDtrackCuts *fESDtrackCuts ; // Track cut
303 Int_t fTrackMult ; // Track multiplicity
304 Float_t fTrackMultEtaCut ; // Track multiplicity eta cut
7e25653f 305 Bool_t fReadStack ; // Access kine information from stack
306 Bool_t fReadAODMCParticles ; // Access kine information from filtered AOD MC particles
591cc579 307
7e25653f 308 TString fDeltaAODFileName ; // Delta AOD file name
309 TString fFiredTriggerClassName; // Name of trigger event type used to do the analysis
afabc52f 310
7e25653f 311 Bool_t fAnaLED; // Analyze LED data only.
c1ac3823 312
7e25653f 313 TString fTaskName; // Name of task that executes the analysis
765d44e7 314
7e25653f 315 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
c8fe2783 316
7e25653f 317 AliMixedEvent * fMixedEvent ; //! mixed event object. This class is not the owner
318 Int_t fNMixedEvent ; // number of events in mixed event buffer
319 Double_t ** fVertex ; //! vertex array 3 dim for each mixed event buffer
c8fe2783 320
7e25653f 321 Bool_t fWriteOutputDeltaAOD;// Write the created delta AOD objects into file
322 Bool_t fOldAOD; // Old AODs, before revision 4.20
f37fa8d2 323
798a9b04 324 Int_t fV0ADC[2] ; // Integrated V0 signal
325 Int_t fV0Mul[2] ; // Integrated V0 Multiplicity
326
af7b3903 327 Bool_t fCaloFilterPatch; // CaloFilter patch
c4eec29f 328 TString fEMCALClustersListName; //Alternative list of clusters produced elsewhere and not from InputEvent
0b13c1f9 329 Float_t fZvtxCut ; // Cut on vertex position
32fd29fe 330
331 //Centrality
332 TString fCentralityClass; // Name of selected centrality class
333 Int_t fCentralityOpt; // Option for the returned value of the centrality, possible options 5, 10, 100
334 Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
335
336 ClassDef(AliCaloTrackReader,23)
1c5acb87 337} ;
338
339
340#endif //ALICALOTRACKREADER_H
341
342
343