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 */
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.
14 // The objects are retrived from folders.
15 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
19 // --- ROOT system ---
20 #include "TClonesArray.h"
27 // --- AliRoot header files ---
28 #include "AliLoader.h"
29 #include "AliEMCALCalibData.h"
30 #include "AliCaloCalibPedestal.h"
36 class AliEMCALSDigit ;
37 class AliEMCALRecPoint ;
39 class AliEMCALLoader : public AliLoader {
44 AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername);
45 AliEMCALLoader(const Char_t *name,TFolder *topfolder);
47 virtual ~AliEMCALLoader() ;
49 virtual Int_t GetEvent(); // Overload to fill TClonesArray
51 virtual void CleanHits() const
52 { if (fHits) fHits->Clear(); AliLoader::CleanHits(); }
53 virtual void CleanSDigits() const
54 { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); }
55 virtual void CleanDigits() const
56 { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); }
57 virtual void CleanRecPoints() const
58 { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); }
60 // This does not work due to const
62 virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); }
63 virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); }
64 virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); }
65 virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); }
68 // ************ TClonesArrays Access functions
70 TClonesArray* Hits(void) const { return fHits;}
72 const AliEMCALHit* Hit(Int_t index) {
74 return (const AliEMCALHit*) fHits->At(index);
78 TClonesArray* SDigits() const { return fSDigits;}
79 const AliEMCALDigit* SDigit(Int_t index) {
81 return (const AliEMCALDigit*) fSDigits->At(index);
85 TClonesArray* Digits() const { return fDigits;}
86 const AliEMCALDigit * Digit(Int_t index) {
88 return (const AliEMCALDigit*) fDigits->At(index);
92 TObjArray * RecPoints() const { return fRecPoints;}
93 const AliEMCALRecPoint * RecPoint(Int_t index) {
95 return (const AliEMCALRecPoint*) fRecPoints->At(index);
99 void SetDebug(Int_t level) {fDebug = level;} // Set debug level
103 Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients
105 void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
106 AliEMCALCalibData * CalibData(); // to get the calibration CDB object
108 void SetPedestalData(AliCaloCalibPedestal* caloped) { fgCaloPed = caloped; }
109 AliCaloCalibPedestal* PedestalData(); // to get the pedestal CDB object
114 // assignement operator requested by coding convention, but not needed
115 AliEMCALLoader(const AliEMCALLoader &); //Not implemented
116 const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented
118 static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
120 Int_t fDebug ; // Debug level
122 // All data are stored in TTrees on file.
123 // These TCLonesArrays are temporary storage for reading or writing
124 // (connected to TTrees with SetBranchAddress)
125 TClonesArray *fHits; //! TClonesArray of hits (for tree reading)
126 TClonesArray *fDigits; //! TClonesArray of digits (for tree reading)
127 TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading)
128 TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
130 static AliEMCALCalibData * fgCalibData; // calibration data
131 static AliCaloCalibPedestal * fgCaloPed; // dead map
133 ClassDef(AliEMCALLoader,3) // Algorithm class that provides methods to retrieve objects from a list knowing the index
137 #endif // AliEMCALLOADER_H