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