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