]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrBase/AliCaloTrackReader.h
correct the increment of the cycle during reconstruction
[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)
1c5acb87 14//
15// -- Author: Gustavo Conesa (INFN-LNF)
16
17// --- ROOT system ---
18#include "TObject.h"
591cc579 19class TObjArray ;
1c5acb87 20class TLorentzVector ;
a97cd470 21#include "TString.h"
8dacfd76 22#include "TObjArray.h"
477d6cee 23class TArrayF;
591cc579 24class TTree ;
c1ac3823 25#include "TH2I.h"
1c5acb87 26
27//--- ANALYSIS system ---
28class AliStack ;
29class AliHeader ;
30class AliGenEventHeader ;
477d6cee 31class AliVEvent;
8dacfd76 32class AliAODEvent;
477d6cee 33class AliMCEvent;
ff45398a 34class AliFiducialCut;
591cc579 35class AliAODMCHeader;
b05a14a3 36class AliAODPWG4Particle;
afabc52f 37#include "AliPHOSGeoUtils.h"
38#include "AliEMCALGeoUtils.h"
1c5acb87 39
40class AliCaloTrackReader : public TObject {
41
03190ad7 42public:
477d6cee 43
1c5acb87 44 AliCaloTrackReader() ; // ctor
45 AliCaloTrackReader(const AliCaloTrackReader & g) ; // cpy ctor
1c5acb87 46 virtual ~AliCaloTrackReader() ;//virtual dtor
47
03190ad7 48private:
49 AliCaloTrackReader & operator = (const AliCaloTrackReader & g) ;//cpy assignment
50
51public:
1c5acb87 52 enum inputDataType {kESD, kAOD, kMC};
53
591cc579 54 //Select generated events, depending on comparison of pT hard and jets.
55 virtual Bool_t ComparePtHardAndJetPt() ;
56 virtual Bool_t IsPtHardAndJetPtComparisonSet() const {return fComparePtHardAndJetPt ;}
57 virtual void SetPtHardAndJetPtComparison(Bool_t compare) { fComparePtHardAndJetPt = compare ;}
58 virtual Float_t GetPtHardAndJetFactor() const {return fPtHardAndJetPtFactor ;}
59 virtual void SetPtHardAndJetPtFactor(Float_t factor) { fPtHardAndJetPtFactor = factor ;}
60
1c5acb87 61 virtual void InitParameters();
62 virtual void Print(const Option_t * opt) const;
63
64 virtual Int_t GetDebug() const { return fDebug ; }
65 virtual void SetDebug(Int_t d) { fDebug = d ; }
66 virtual Int_t GetDataType() const { return fDataType ; }
67 virtual void SetDataType(Int_t data ) { fDataType = data ; }
68
a79a2424 69 virtual Int_t GetEventNumber() const {return fEventNumber ; }
70 virtual TString GetCurrentFileName() const {return fCurrentFileName ; }
71
1c5acb87 72 //Minimum pt setters and getters
73 virtual Float_t GetEMCALPtMin() const { return fEMCALPtMin ; }
74 virtual Float_t GetPHOSPtMin() const { return fPHOSPtMin ; }
75 virtual Float_t GetCTSPtMin() const { return fCTSPtMin ; }
76
77 virtual void SetEMCALPtMin(Float_t pt) { fEMCALPtMin = pt ; }
78 virtual void SetPHOSPtMin(Float_t pt) { fPHOSPtMin = pt ; }
79 virtual void SetCTSPtMin(Float_t pt) { fCTSPtMin = pt ; }
80
81 //Input setters and getters
82
83 Bool_t IsCTSSwitchedOn() const { return fFillCTS ; }
84 void SwitchOnCTS() {fFillCTS = kTRUE ; }
85 void SwitchOffCTS() {fFillCTS = kFALSE ; }
86
87 Bool_t IsEMCALSwitchedOn() const { return fFillEMCAL ; }
88 void SwitchOnEMCAL() {fFillEMCAL = kTRUE ; }
89 void SwitchOffEMCAL() {fFillEMCAL = kFALSE ; }
90
91 Bool_t IsPHOSSwitchedOn() const { return fFillPHOS ; }
92 void SwitchOnPHOS() {fFillPHOS = kTRUE ; }
93 void SwitchOffPHOS() {fFillPHOS = kFALSE ; }
94
95 Bool_t IsEMCALCellsSwitchedOn() const { return fFillEMCALCells ; }
96 void SwitchOnEMCALCells() {fFillEMCALCells = kTRUE ; }
97 void SwitchOffEMCALCells() {fFillEMCALCells = kFALSE ; }
98
99 Bool_t IsPHOSCellsSwitchedOn() const { return fFillPHOSCells ; }
100 void SwitchOnPHOSCells() {fFillPHOSCells = kTRUE ; }
101 void SwitchOffPHOSCells() {fFillPHOSCells = kFALSE ; }
102
29b2ceec 103 virtual Bool_t FillInputEvent(const Int_t iEntry, const char *currentFileName) ;
1c5acb87 104 virtual void FillInputCTS() {;}
105 virtual void FillInputEMCAL() {;}
106 virtual void FillInputPHOS() {;}
107 virtual void FillInputEMCALCells() {;}
108 virtual void FillInputPHOSCells() {;}
109
591cc579 110 virtual TObjArray* GetAODCTS() const {return fAODCTS ;}
111 virtual TObjArray* GetAODEMCAL() const {return fAODEMCAL ;}
112 virtual TObjArray* GetAODPHOS() const {return fAODPHOS ;}
477d6cee 113 virtual TNamed* GetEMCALCells() const {return fEMCALCells ;}
114 virtual TNamed* GetPHOSCells() const {return fPHOSCells ;}
1c5acb87 115
591cc579 116 //Get MC informatio
117 //Kinematics and galice.root available
477d6cee 118 virtual AliStack* GetStack() const ;
119 virtual AliHeader* GetHeader() const ;
1c5acb87 120 virtual AliGenEventHeader* GetGenEventHeader() const ;
591cc579 121 //Filtered kinematics in AOD
122 virtual TClonesArray* GetAODMCParticles(Int_t input = 0) const ;
123 virtual AliAODMCHeader* GetAODMCHeader(Int_t input = 0) const ;
124
477d6cee 125 virtual AliVEvent* GetInputEvent() const {return fInputEvent;}
126 virtual AliAODEvent* GetOutputEvent() const {return fOutputEvent;}
127 virtual AliMCEvent* GetMC() const {return fMC;}
233e0df8 128 virtual void GetVertex(Double_t *) const {;}
129 virtual void GetSecondInputAODVertex(Double_t *) const {;}
8dacfd76 130 virtual Double_t GetBField() const { return 0.;}
591cc579 131
132 virtual void Init();
133
8dacfd76 134 virtual void SetInputEvent(AliVEvent* const input) {fInputEvent = input;}
135 virtual void SetOutputEvent(AliAODEvent* const aod) {fOutputEvent = aod;}
136 virtual void SetMC(AliMCEvent* const mc) {fMC = mc;}
1c5acb87 137
138 virtual void ResetLists();
139
ff45398a 140 virtual AliFiducialCut * GetFiducialCut() const {return fFiducialCut ;}
141 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFiducialCut = fc ;}
29b2ceec 142
477d6cee 143 virtual void SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) {;}
591cc579 144
145 //Methods for mixing with external input file (AOD)
146 virtual TTree* GetSecondInputAODTree() const {return fSecondInputAODTree ; }
147 //virtual void SetSecondInputAODTree(TTree * tree) {fSecondInputAODTree = tree ;
148 // fSecondInputAODEvent->ReadFromTree(tree);}//Connect tree and AOD event.
149
150 virtual AliAODEvent* GetSecondInputAODEvent() const { return fSecondInputAODEvent ; }
151
152 TString GetSecondInputFileName() const {return fSecondInputFileName ; }
153 void SetSecondInputFileName(TString name) { fSecondInputFileName = name ; }
1c5acb87 154
591cc579 155 Int_t GetSecondInputFirstEvent() const {return fSecondInputFirstEvent ; }
156 void SetSecondInputFirstEvent(Int_t iEvent0) { fSecondInputFirstEvent = iEvent0 ; }
157
158 Int_t GetAODCTSNormalInputEntries() {if(!fSecondInputAODTree) { fAODCTSNormalInputEntries = fAODCTS->GetEntriesFast() ;}
159 return fAODCTSNormalInputEntries ; }
160 Int_t GetAODEMCALNormalInputEntries() {if(!fSecondInputAODTree) { fAODEMCALNormalInputEntries = fAODEMCAL->GetEntriesFast();}
161 return fAODEMCALNormalInputEntries ; }
162 Int_t GetAODPHOSNormalInputEntries() {if(!fSecondInputAODTree) { fAODPHOSNormalInputEntries = fAODPHOS->GetEntriesFast() ;}
163 return fAODPHOSNormalInputEntries ; }
164
165 ULong_t GetTrackStatus() const {return fTrackStatus ; }
166 void SetTrackStatus(ULong_t bit) { fTrackStatus = bit ; }
167
168 void SwitchOnStack() { fReadStack = kTRUE ; }
169 void SwitchOffStack() { fReadStack = kFALSE ; }
170 void SwitchOnAODMCParticles() { fReadAODMCParticles = kTRUE ; }
171 void SwitchOffAODMCParticles() { fReadAODMCParticles = kFALSE ; }
172 Bool_t ReadStack() const { return fReadStack ; }
173 Bool_t ReadAODMCParticles() const { return fReadAODMCParticles ; }
174
08a064bc 175 void SwitchOnCleanStdAOD() {fCleanOutputStdAOD = kTRUE;}
176 void SwitchOffCleanStdAOD() {fCleanOutputStdAOD = kFALSE;}
177
42dc8e7d 178 void SetDeltaAODFileName(TString name ) {fDeltaAODFileName = name ; }
179 TString GetDeltaAODFileName() const {return fDeltaAODFileName ; }
72d2488e 180
181 void SetFiredTriggerClassName(TString name ) {fFiredTriggerClassName = name ; }
182 TString GetFiredTriggerClassName() const {return fFiredTriggerClassName ; }
183 virtual TString GetFiredTriggerClasses() {return "";}
42dc8e7d 184
0866d83a 185 //Calorimeters Geometry Methods
afabc52f 186 void SetEMCALGeometryName(TString name) { fEMCALGeoName = name ; }
187 TString EMCALGeometryName() const { return fEMCALGeoName ; }
4e2b43d8 188 void InitEMCALGeometry() ;
afabc52f 189 AliEMCALGeoUtils * GetEMCALGeometry() const {return fEMCALGeo;}
0866d83a 190 Bool_t IsEMCALGeoMatrixSet() {return fEMCALGeoMatrixSet; }
191
afabc52f 192 void SetPHOSGeometryName(TString name) { fPHOSGeoName = name ; }
193 TString PHOSGeometryName() const { return fPHOSGeoName ; }
4e2b43d8 194 void InitPHOSGeometry() ;
0866d83a 195 AliPHOSGeoUtils * GetPHOSGeometry() const {return fPHOSGeo;}
196 Bool_t IsPHOSGeoMatrixSet() {return fPHOSGeoMatrixSet ; }
197
c1ac3823 198 void AnalyzeOnlyLED() {fAnaLED = kTRUE;}
199 void AnalyzeOnlyPhysics() {fAnaLED = kFALSE;}
200
201 // Bad channels
202
203 Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; }
204 void SwitchOnBadChannelsRemoval() {fRemoveBadChannels = kTRUE ; }
205 void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; }
206
486258c9 207 void InitEMCALBadChannelStatusMap() ;
208 void InitPHOSBadChannelStatusMap () ;
209
210 Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
211 if(fEMCALBadChannelMap->GetEntries()>0) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow);
212 else return -1;}
c1ac3823 213
486258c9 214 Int_t GetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow) const {
215 if(fPHOSBadChannelMap->GetEntries()>0)return (Int_t) ((TH2I*)fPHOSBadChannelMap->At(imod))->GetBinContent(iCol,iRow);
216 else return -1;}
217
218 void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
219 if(!fEMCALBadChannelMap->GetEntries())InitEMCALBadChannelStatusMap() ;
220 ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
221
222 void SetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) {
223 if(!fPHOSBadChannelMap->GetEntries()) InitPHOSBadChannelStatusMap() ;
224 ((TH2I*)fPHOSBadChannelMap->At(imod))->SetBinContent(iCol,iRow,c);}
225
226 TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
227 TH2I * GetPHOSChannelStatusMap(Int_t imod) const {return (TH2I*)fPHOSBadChannelMap->At(imod);}
228
229 void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
230 void SetPHOSChannelStatusMap (TObjArray *map) {fPHOSBadChannelMap = map;}
c1ac3823 231
232 Bool_t ClusterContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells);
afabc52f 233
486258c9 234 TString GetTaskName() const {return fTaskName;}
235 void SetTaskName(TString name) {fTaskName = name;}
236
e6e63685 237 //Calorimeter indexes information
b05a14a3 238 Int_t GetModuleNumber(AliAODPWG4Particle * particle) const;
e6e63685 239 Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const ;
240
1c5acb87 241 protected:
477d6cee 242 Int_t fEventNumber; // Event number
a79a2424 243 TString fCurrentFileName; // Current file name under analysis
1c5acb87 244 Int_t fDataType ; // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
245 Int_t fDebug; // Debugging level
614701c6 246 AliFiducialCut * fFiducialCut; //! Acceptance cuts
29b2ceec 247
591cc579 248 Bool_t fComparePtHardAndJetPt; // In MonteCarlo, jet events, reject fake events with wrong jet energy.
249 Float_t fPtHardAndJetPtFactor; // Factor between ptHard and jet pT to reject/accept event.
250
477d6cee 251 Float_t fCTSPtMin; // pT Threshold on charged particles
1c5acb87 252 Float_t fEMCALPtMin; // pT Threshold on emcal clusters
477d6cee 253 Float_t fPHOSPtMin; // pT Threshold on phos clusters
1c5acb87 254
591cc579 255 TObjArray * fAODCTS ; //! temporal referenced array with tracks
256 TObjArray * fAODEMCAL ; //! temporal referenced array with EMCAL CaloClusters
257 TObjArray * fAODPHOS ; //! temporal referenced array with PHOS CaloClusters
1c5acb87 258 TNamed * fEMCALCells ; //! temporal array with EMCAL CaloCells, ESD or AOD
259 TNamed * fPHOSCells ; //! temporal array with PHOS CaloCells, ESD or AOD
260
477d6cee 261 AliVEvent * fInputEvent; //! pointer to esd or aod input
262 AliAODEvent * fOutputEvent; //! pointer to aod output
1c5acb87 263 AliMCEvent * fMC; //! Monte Carlo Event Handler
264
265 Bool_t fFillCTS; // use data from CTS
266 Bool_t fFillEMCAL; // use data from EMCAL
267 Bool_t fFillPHOS; // use data from PHOS
268 Bool_t fFillEMCALCells; // use data from EMCAL
269 Bool_t fFillPHOSCells; // use data from PHOS
270
591cc579 271 TTree * fSecondInputAODTree; // Tree with second input AOD, for mixing analysis.
272 AliAODEvent* fSecondInputAODEvent; //! pointer to second input AOD event.
273 TString fSecondInputFileName; // File with AOD data to mix with normal stream of data.
274 Int_t fSecondInputFirstEvent; // First event to be considered in the mixing.
275
276 Int_t fAODCTSNormalInputEntries; // Number of entries in CTS in case of standard input, larger with mixing.
277 Int_t fAODEMCALNormalInputEntries; // Number of entries in EMCAL in case of standard input, larger with mixing.
278 Int_t fAODPHOSNormalInputEntries; // Number of entries in PHOS in case of standard input, larger with mixing.
279
280 ULong_t fTrackStatus ; // Track selection bit, select tracks refitted in TPC, ITS ...
281 Bool_t fReadStack ; // Access kine information from stack
282 Bool_t fReadAODMCParticles ; // Access kine information from filtered AOD MC particles
283
08a064bc 284 Bool_t fCleanOutputStdAOD; // clean the written standard tracks and caloclusters in output AOD
42dc8e7d 285 TString fDeltaAODFileName ; // Delta AOD file name
72d2488e 286 TString fFiredTriggerClassName ; // Name of trigger event type used to do the analysis
afabc52f 287
c1ac3823 288 TString fEMCALGeoName; // Name of geometry to use for EMCAL.
289 TString fPHOSGeoName; // Name of geometry to use for PHOS.
290 AliEMCALGeoUtils * fEMCALGeo ; //! EMCAL geometry pointer
291 AliPHOSGeoUtils * fPHOSGeo ; //! PHOS geometry pointer
292 Bool_t fEMCALGeoMatrixSet; // Check if the transformation matrix is set for EMCAL
293 Bool_t fPHOSGeoMatrixSet ; // Check if the transformation matrix is set for PHOS
294 Bool_t fAnaLED; // Analyze LED data only.
295 Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
486258c9 296 TObjArray *fEMCALBadChannelMap; //! Array of histograms with map of bad channels, EMCAL
297 TObjArray *fPHOSBadChannelMap; //! Array of histograms with map of bad channels, PHOS
298 TString fTaskName; // Name of task that executes the analysis
c1ac3823 299
486258c9 300 ClassDef(AliCaloTrackReader,13)
1c5acb87 301} ;
302
303
304#endif //ALICALOTRACKREADER_H
305
306
307