Line data Source code
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 : //_________________________________________________________________________
7 : // The AliEMCALLoader gets the TClonesArray and TObjArray for reading
8 : // Hits, Dgits, SDigits and RecPoints. Filling is managed in the GetEvent()
9 : // method. The objects are retrived from the corresponding folders.
10 : //
11 : // It also provides acces methods to the calibration and simulation OCDB parameters
12 : //
13 :
14 : //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
15 : //
16 :
17 :
18 : // --- ROOT system ---
19 : #include "TClonesArray.h"
20 : #include "TFolder.h"
21 : #include "TTree.h"
22 : class TString ;
23 : class TParticle ;
24 :
25 : // --- AliRoot header files ---
26 : #include "AliLoader.h"
27 : #include "AliEMCALCalibData.h"
28 : #include "AliEMCALCalibTime.h"
29 : #include "AliCaloCalibPedestal.h"
30 : #include "AliEMCALSimParam.h"
31 : #include "AliEMCALRecParam.h"
32 :
33 : class AliLoader ;
34 : class AliEMCAL ;
35 : class AliEMCALDigit ;
36 : class AliEMCALSDigit ;
37 : class AliEMCALRecPoint ;
38 :
39 : class AliEMCALLoader : public AliLoader {
40 :
41 : public:
42 :
43 : AliEMCALLoader();
44 : AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername);
45 : AliEMCALLoader(const Char_t *name,TFolder *topfolder);
46 :
47 : virtual ~AliEMCALLoader() ;
48 :
49 : virtual Int_t GetEvent(); // Overload to fill TClonesArray
50 :
51 : //Clean arrays methods
52 0 : virtual void CleanHits() const {GetHitsDataLoader()->Clean();}
53 0 : virtual void CleanSDigits() const {GetSDigitsDataLoader()->Clean();}
54 8 : virtual void CleanDigits() const {GetDigitsDataLoader()->Clean();}
55 16 : virtual void CleanRecPoints() const {GetRecPointsDataLoader()->Clean();}
56 :
57 : // Initialize arrays methods
58 : void MakeSDigitsArray() ;
59 : void MakeDigitsArray() ;
60 : void MakeRecPointsArray() ;
61 :
62 : // ************ TClonesArrays Access functions
63 :
64 282 : TClonesArray* SDigits() {return (TClonesArray*)GetDetectorData(fgkECASDigitsBranchName);} //const { return fSDigits;}
65 : const AliEMCALDigit* SDigit(Int_t index) {
66 0 : if (SDigits())return (const AliEMCALDigit*) SDigits()->At(index);
67 0 : return 0x0;
68 0 : }
69 :
70 262 : TClonesArray* Digits() {return (TClonesArray*)GetDetectorData(fgkECADigitsBranchName);}//const { return fDigits;}
71 : const AliEMCALDigit * Digit(Int_t index) {
72 0 : if (Digits()) return (const AliEMCALDigit*) Digits()->At(index);
73 0 : return 0x0;
74 0 : }
75 :
76 216 : TObjArray * RecPoints() {return (TObjArray*)GetDetectorData(fgkECARecPointsBranchName);}//const { return fRecPoints;}
77 : const AliEMCALRecPoint * RecPoint(Int_t index) {
78 0 : if (RecPoints())return (const AliEMCALRecPoint*) RecPoints()->At(index);
79 0 : return 0x0;
80 0 : }
81 :
82 0 : void SetDebug(Int_t level) {fDebug = level;} // Set debug level
83 :
84 : //OCDB access methods
85 :
86 0 : void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
87 : AliEMCALCalibData * CalibData(); // to get the energy calibration CDB object
88 :
89 0 : void SetCalibTime(AliEMCALCalibTime* calibti) { fgCalibTime = calibti; }
90 : AliEMCALCalibTime * CalibTime(); // to get the time calibration CDB object
91 :
92 0 : void SetPedestalData(AliCaloCalibPedestal* caloped) { fgCaloPed = caloped; }
93 : AliCaloCalibPedestal* PedestalData(); // to get the pedestal CDB object
94 :
95 0 : void SetSimParam(AliEMCALSimParam* simparam) { fgSimParam = simparam; }
96 : AliEMCALSimParam* SimulationParameters(); // to get the simulation parameter CDB object
97 :
98 0 : void SetRecParam(AliEMCALRecParam* recparam) { fgRecParam = recparam; }
99 : AliEMCALRecParam* ReconstructionParameters(Int_t eventType); // to get the reconstruction parameter CDB object
100 :
101 : private:
102 :
103 : // assignement operator requested by coding convention, but not needed
104 : AliEMCALLoader(const AliEMCALLoader &); //Not implemented
105 : const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented
106 :
107 : static const TString fgkECASDigitsBranchName; //! Name of branch with ECA SDigits
108 : static const TString fgkECADigitsBranchName; //! Name of branch with ECA Digits
109 : static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
110 :
111 : Int_t fDebug ; // Debug level
112 :
113 : static AliEMCALCalibData * fgCalibData; // energy calibration data
114 : static AliEMCALCalibTime * fgCalibTime; // time calibration data
115 : static AliCaloCalibPedestal * fgCaloPed; // dead map
116 : static AliEMCALSimParam * fgSimParam; // sim param
117 : static AliEMCALRecParam * fgRecParam; // rec param
118 :
119 374 : ClassDef(AliEMCALLoader,8) // Algorithm class that provides methods to retrieve objects from a list knowing the index
120 :
121 : };
122 :
123 : #endif // AliEMCALLOADER_H
|