]>
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" |
30 | ||
d64c959b | 31 | class AliLoader ; |
32 | class AliEMCAL ; | |
33 | class AliEMCALHit ; | |
5dee926e | 34 | class AliEMCALDigit ; |
35 | class AliEMCALSDigit ; | |
36 | class AliEMCALRecPoint ; | |
88cb7938 | 37 | |
38 | class AliEMCALLoader : public AliLoader { | |
39 | ||
40 | public: | |
41 | ||
42 | AliEMCALLoader(); | |
39200c71 | 43 | AliEMCALLoader(const AliEMCALLoader & obj):AliLoader(obj){} |
88cb7938 | 44 | AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); |
45 | ||
46 | virtual ~AliEMCALLoader() ; | |
47 | ||
48 | // assignement operator requested by coding convention, but not needed | |
d64c959b | 49 | const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;} |
88cb7938 | 50 | |
5dee926e | 51 | virtual Int_t GetEvent(); // Overload to fill TClonesArray |
52 | ||
53 | virtual void CleanHits() const | |
54 | { if (fHits) fHits->Clear(); AliLoader::CleanHits(); } | |
55 | virtual void CleanSDigits() const | |
56 | { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); } | |
57 | virtual void CleanDigits() const | |
58 | { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); } | |
59 | virtual void CleanRecPoints() const | |
60 | { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); } | |
61 | ||
62 | // This does not work due to const | |
63 | /* | |
64 | virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); } | |
65 | virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); } | |
66 | virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); } | |
67 | virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); } | |
68 | */ | |
69 | ||
70 | // ************ TClonesArrays Access functions | |
71 | ||
72 | TClonesArray* Hits(void) { return fHits;} | |
73 | ||
74 | const AliEMCALHit* Hit(Int_t index) { | |
75 | if (fHits) | |
76 | return (const AliEMCALHit*) fHits->At(index); | |
77 | return 0x0; | |
78 | } | |
79 | ||
80 | TClonesArray* SDigits() { return fSDigits;} | |
81 | const AliEMCALDigit* SDigit(Int_t index) { | |
82 | if (fSDigits) | |
83 | return (const AliEMCALDigit*) fSDigits->At(index); | |
84 | return 0x0; | |
85 | } | |
86 | ||
87 | TClonesArray* Digits() { return fDigits;} | |
88 | const AliEMCALDigit * Digit(Int_t index) { | |
89 | if (fDigits) | |
90 | return (const AliEMCALDigit*) fDigits->At(index); | |
91 | return 0x0; | |
92 | } | |
93 | ||
94 | TObjArray * RecPoints() { return fRecPoints;} | |
95 | const AliEMCALRecPoint * RecPoint(Int_t index) { | |
96 | if (fRecPoints) | |
97 | return (const AliEMCALRecPoint*) fRecPoints->At(index); | |
98 | return 0x0; | |
99 | } | |
88cb7938 | 100 | |
88cb7938 | 101 | void SetDebug(Int_t level) {fDebug = level;} // Set debug level |
88cb7938 | 102 | |
f565d89d | 103 | //Calibration |
104 | ||
105 | Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients | |
106 | ||
107 | void SetCalibData(AliEMCALCalibData* calibda) { fCalibData = calibda; } | |
108 | ||
109 | AliEMCALCalibData * CalibData(); // to get the CDB object | |
110 | ||
88cb7938 | 111 | private: |
f565d89d | 112 | |
5dee926e | 113 | static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points |
88cb7938 | 114 | |
d64c959b | 115 | Int_t fDebug ; // Debug level |
88cb7938 | 116 | |
5dee926e | 117 | // All data are stored in TTrees on file. |
118 | // These TCLonesArrays are temporary storage for reading or writing | |
119 | // (connected to TTrees with SetBranchAddress) | |
120 | TClonesArray *fHits; //! TClonesArray of hits (for tree reading) | |
121 | TClonesArray *fDigits; //! TClonesArray of digits (for tree reading) | |
122 | TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading) | |
123 | TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading) | |
f565d89d | 124 | static AliEMCALCalibData * fCalibData; // calibration data |
125 | ||
5dee926e | 126 | ClassDef(AliEMCALLoader,0) // Algorithm class that provides methods to retrieve objects from a list knowing the index |
127 | ||
88cb7938 | 128 | }; |
129 | ||
88cb7938 | 130 | #endif // AliEMCALLOADER_H |