88cb7938 |
1 | #ifndef ALIEMCALLOADER_H |
2 | #define ALIEMCALLOADER_H |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ |
5 | |
6 | /* $Id$ */ |
7 | |
8 | //_________________________________________________________________________ |
64c98165 |
9 | // The AliEMCALLoader gets the TClonesArray and TObjArray for reading |
10 | // Hits, Dgits, SDigits and RecPoints. Filling is managed in the GetEvent() |
11 | // method. The objects are retrived from the corresponding folders. |
12 | // |
13 | // It also provides acces methods to the calibration and simulation OCDB parameters |
14 | // |
15 | |
88cb7938 |
16 | //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH) |
17 | // |
18 | |
19 | |
20 | // --- ROOT system --- |
21 | #include "TClonesArray.h" |
22 | #include "TFolder.h" |
23 | #include "TTree.h" |
24 | class TString ; |
25 | class TParticle ; |
26 | class TTask ; |
27 | |
88cb7938 |
28 | // --- AliRoot header files --- |
5dee926e |
29 | #include "AliLoader.h" |
f565d89d |
30 | #include "AliEMCALCalibData.h" |
64c98165 |
31 | //#include "AliCaloCalibPedestal.h" |
6569f329 |
32 | #include "AliEMCALSimParam.h" |
f565d89d |
33 | |
d64c959b |
34 | class AliLoader ; |
35 | class AliEMCAL ; |
36 | class AliEMCALHit ; |
5dee926e |
37 | class AliEMCALDigit ; |
38 | class AliEMCALSDigit ; |
39 | class AliEMCALRecPoint ; |
88cb7938 |
40 | |
41 | class AliEMCALLoader : public AliLoader { |
42 | |
43 | public: |
44 | |
45 | AliEMCALLoader(); |
88cb7938 |
46 | AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); |
6b299d9e |
47 | AliEMCALLoader(const Char_t *name,TFolder *topfolder); |
88cb7938 |
48 | |
49 | virtual ~AliEMCALLoader() ; |
50 | |
5dee926e |
51 | virtual Int_t GetEvent(); // Overload to fill TClonesArray |
52 | |
64c98165 |
53 | //Clean arrays methods |
54 | virtual void CleanHits() const {GetHitsDataLoader()->Clean();} |
55 | virtual void CleanSDigits() const {GetSDigitsDataLoader()->Clean();} |
56 | virtual void CleanDigits() const {GetDigitsDataLoader()->Clean();} |
57 | virtual void CleanRecPoints() const {GetRecPointsDataLoader()->Clean();} |
58 | |
59 | // Initialize arrays methods |
60 | void MakeSDigitsArray() ; |
61 | void MakeHitsArray() ; |
62 | void MakeDigitsArray() ; |
63 | void MakeRecPointsArray() ; |
64 | |
5dee926e |
65 | // ************ TClonesArrays Access functions |
64c98165 |
66 | |
67 | TClonesArray* Hits(void) {return (TClonesArray*)GetDetectorData(fgkECAHitsBranchName);} //{ return fHits;} |
5dee926e |
68 | const AliEMCALHit* Hit(Int_t index) { |
64c98165 |
69 | if (Hits()) return (const AliEMCALHit*) Hits()->At(index); |
5dee926e |
70 | return 0x0; |
71 | } |
64c98165 |
72 | |
73 | TClonesArray* SDigits() {return (TClonesArray*)GetDetectorData(fgkECASDigitsBranchName);} //const { return fSDigits;} |
5dee926e |
74 | const AliEMCALDigit* SDigit(Int_t index) { |
64c98165 |
75 | if (SDigits())return (const AliEMCALDigit*) SDigits()->At(index); |
5dee926e |
76 | return 0x0; |
77 | } |
64c98165 |
78 | |
79 | TClonesArray* Digits() {return (TClonesArray*)GetDetectorData(fgkECADigitsBranchName);}//const { return fDigits;} |
5dee926e |
80 | const AliEMCALDigit * Digit(Int_t index) { |
64c98165 |
81 | if (Digits()) return (const AliEMCALDigit*) Digits()->At(index); |
5dee926e |
82 | return 0x0; |
83 | } |
64c98165 |
84 | |
85 | TObjArray * RecPoints() {return (TObjArray*)GetDetectorData(fgkECARecPointsBranchName);}//const { return fRecPoints;} |
5dee926e |
86 | const AliEMCALRecPoint * RecPoint(Int_t index) { |
64c98165 |
87 | if (RecPoints())return (const AliEMCALRecPoint*) RecPoints()->At(index); |
5dee926e |
88 | return 0x0; |
89 | } |
64c98165 |
90 | |
88cb7938 |
91 | void SetDebug(Int_t level) {fDebug = level;} // Set debug level |
64c98165 |
92 | |
93 | //OCDB access methods |
94 | |
14ce0a6e |
95 | void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; } |
bcdecbbe |
96 | AliEMCALCalibData * CalibData(); // to get the calibration CDB object |
64c98165 |
97 | |
98 | // void SetPedestalData(AliCaloCalibPedestal* caloped) { fgCaloPed = caloped; } |
99 | // AliCaloCalibPedestal* PedestalData(); // to get the pedestal CDB object |
100 | |
6569f329 |
101 | void SetSimParam(AliEMCALSimParam* simparam) { fgSimParam = simparam; } |
102 | AliEMCALSimParam* SimulationParameters(); // to get the simulation parameter CDB object |
64c98165 |
103 | |
104 | |
105 | private: |
106 | |
dc86eb51 |
107 | // assignement operator requested by coding convention, but not needed |
108 | AliEMCALLoader(const AliEMCALLoader &); //Not implemented |
109 | const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented |
64c98165 |
110 | |
111 | static const TString fgkECAHitsBranchName; //! Name of branch with ECA Hits |
112 | static const TString fgkECASDigitsBranchName; //! Name of branch with ECA SDigits |
113 | static const TString fgkECADigitsBranchName; //! Name of branch with ECA Digits |
5dee926e |
114 | static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points |
64c98165 |
115 | |
d64c959b |
116 | Int_t fDebug ; // Debug level |
0c978ad5 |
117 | TClonesArray *fTempArr; //! Temporary array for hits |
118 | |
40164976 |
119 | static AliEMCALCalibData * fgCalibData; // calibration data |
64c98165 |
120 | // static AliCaloCalibPedestal * fgCaloPed; // dead map |
6569f329 |
121 | static AliEMCALSimParam * fgSimParam; // sim param |
64c98165 |
122 | |
0c978ad5 |
123 | ClassDef(AliEMCALLoader,6) // Algorithm class that provides methods to retrieve objects from a list knowing the index |
64c98165 |
124 | |
88cb7938 |
125 | }; |
126 | |
88cb7938 |
127 | #endif // AliEMCALLOADER_H |