]>
Commit | Line | Data |
---|---|---|
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 | //_________________________________________________________________________ | |
9 | // A singleton that returns various objects | |
10 | // Should be used on the analysis stage to avoid confusing between different | |
11 | // branches of reconstruction tree: e.g. reading RecPoints and TS made from | |
12 | // another set of RecPoints. | |
13 | // | |
14 | // The objects are retrived from folders. | |
15 | //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH) | |
16 | // | |
17 | ||
18 | ||
19 | // --- ROOT system --- | |
20 | #include "TClonesArray.h" | |
21 | #include "TFolder.h" | |
22 | #include "TTree.h" | |
23 | class TString ; | |
24 | class TParticle ; | |
25 | class TTask ; | |
26 | ||
88cb7938 | 27 | // --- AliRoot header files --- |
5dee926e | 28 | #include "AliLoader.h" |
f565d89d | 29 | #include "AliEMCALCalibData.h" |
40164976 | 30 | #include "AliCaloCalibPedestal.h" |
6569f329 | 31 | #include "AliEMCALSimParam.h" |
f565d89d | 32 | |
d64c959b | 33 | class AliLoader ; |
34 | class AliEMCAL ; | |
35 | class AliEMCALHit ; | |
5dee926e | 36 | class AliEMCALDigit ; |
37 | class AliEMCALSDigit ; | |
38 | class AliEMCALRecPoint ; | |
88cb7938 | 39 | |
40 | class AliEMCALLoader : public AliLoader { | |
41 | ||
42 | public: | |
43 | ||
44 | AliEMCALLoader(); | |
88cb7938 | 45 | AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); |
6b299d9e | 46 | AliEMCALLoader(const Char_t *name,TFolder *topfolder); |
88cb7938 | 47 | |
48 | virtual ~AliEMCALLoader() ; | |
49 | ||
5dee926e | 50 | virtual Int_t GetEvent(); // Overload to fill TClonesArray |
51 | ||
52 | virtual void CleanHits() const | |
53 | { if (fHits) fHits->Clear(); AliLoader::CleanHits(); } | |
54 | virtual void CleanSDigits() const | |
55 | { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); } | |
56 | virtual void CleanDigits() const | |
57 | { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); } | |
58 | virtual void CleanRecPoints() const | |
59 | { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); } | |
60 | ||
61 | // This does not work due to const | |
62 | /* | |
63 | virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); } | |
64 | virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); } | |
65 | virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); } | |
66 | virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); } | |
67 | */ | |
68 | ||
69 | // ************ TClonesArrays Access functions | |
70 | ||
40164976 | 71 | TClonesArray* Hits(void) const { return fHits;} |
5dee926e | 72 | |
73 | const AliEMCALHit* Hit(Int_t index) { | |
74 | if (fHits) | |
75 | return (const AliEMCALHit*) fHits->At(index); | |
76 | return 0x0; | |
77 | } | |
78 | ||
40164976 | 79 | TClonesArray* SDigits() const { return fSDigits;} |
5dee926e | 80 | const AliEMCALDigit* SDigit(Int_t index) { |
81 | if (fSDigits) | |
82 | return (const AliEMCALDigit*) fSDigits->At(index); | |
83 | return 0x0; | |
84 | } | |
85 | ||
40164976 | 86 | TClonesArray* Digits() const { return fDigits;} |
5dee926e | 87 | const AliEMCALDigit * Digit(Int_t index) { |
88 | if (fDigits) | |
89 | return (const AliEMCALDigit*) fDigits->At(index); | |
90 | return 0x0; | |
91 | } | |
92 | ||
40164976 | 93 | TObjArray * RecPoints() const { return fRecPoints;} |
5dee926e | 94 | const AliEMCALRecPoint * RecPoint(Int_t index) { |
95 | if (fRecPoints) | |
96 | return (const AliEMCALRecPoint*) fRecPoints->At(index); | |
97 | return 0x0; | |
98 | } | |
88cb7938 | 99 | |
88cb7938 | 100 | void SetDebug(Int_t level) {fDebug = level;} // Set debug level |
88cb7938 | 101 | |
f565d89d | 102 | //Calibration |
f565d89d | 103 | Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients |
6569f329 | 104 | |
14ce0a6e | 105 | void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; } |
bcdecbbe | 106 | AliEMCALCalibData * CalibData(); // to get the calibration CDB object |
6569f329 | 107 | |
40164976 | 108 | void SetPedestalData(AliCaloCalibPedestal* caloped) { fgCaloPed = caloped; } |
109 | AliCaloCalibPedestal* PedestalData(); // to get the pedestal CDB object | |
110 | ||
6569f329 | 111 | void SetSimParam(AliEMCALSimParam* simparam) { fgSimParam = simparam; } |
112 | AliEMCALSimParam* SimulationParameters(); // to get the simulation parameter CDB object | |
113 | ||
40164976 | 114 | |
88cb7938 | 115 | private: |
f565d89d | 116 | |
dc86eb51 | 117 | // assignement operator requested by coding convention, but not needed |
118 | AliEMCALLoader(const AliEMCALLoader &); //Not implemented | |
119 | const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented | |
120 | ||
5dee926e | 121 | static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points |
88cb7938 | 122 | |
d64c959b | 123 | Int_t fDebug ; // Debug level |
88cb7938 | 124 | |
5dee926e | 125 | // All data are stored in TTrees on file. |
126 | // These TCLonesArrays are temporary storage for reading or writing | |
127 | // (connected to TTrees with SetBranchAddress) | |
128 | TClonesArray *fHits; //! TClonesArray of hits (for tree reading) | |
129 | TClonesArray *fDigits; //! TClonesArray of digits (for tree reading) | |
130 | TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading) | |
bcdecbbe | 131 | TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading) |
132 | ||
40164976 | 133 | static AliEMCALCalibData * fgCalibData; // calibration data |
6569f329 | 134 | static AliCaloCalibPedestal * fgCaloPed; // dead map |
135 | static AliEMCALSimParam * fgSimParam; // sim param | |
f565d89d | 136 | |
6569f329 | 137 | ClassDef(AliEMCALLoader,4) // Algorithm class that provides methods to retrieve objects from a list knowing the index |
5dee926e | 138 | |
88cb7938 | 139 | }; |
140 | ||
88cb7938 | 141 | #endif // AliEMCALLOADER_H |