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