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