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 "AliEMCALAlignData.h"
36 class AliEMCALSDigit ;
37 class AliEMCALRecPoint ;
39 class AliEMCALLoader : public AliLoader {
44 AliEMCALLoader(const AliEMCALLoader & obj):AliLoader(obj){}
45 AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername);
47 virtual ~AliEMCALLoader() ;
49 // assignement operator requested by coding convention, but not needed
50 const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;}
52 virtual Int_t GetEvent(); // Overload to fill TClonesArray
54 virtual void CleanHits() const
55 { if (fHits) fHits->Clear(); AliLoader::CleanHits(); }
56 virtual void CleanSDigits() const
57 { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); }
58 virtual void CleanDigits() const
59 { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); }
60 virtual void CleanRecPoints() const
61 { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); }
63 // This does not work due to const
65 virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); }
66 virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); }
67 virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); }
68 virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); }
71 // ************ TClonesArrays Access functions
73 TClonesArray* Hits(void) { return fHits;}
75 const AliEMCALHit* Hit(Int_t index) {
77 return (const AliEMCALHit*) fHits->At(index);
81 TClonesArray* SDigits() { return fSDigits;}
82 const AliEMCALDigit* SDigit(Int_t index) {
84 return (const AliEMCALDigit*) fSDigits->At(index);
88 TClonesArray* Digits() { return fDigits;}
89 const AliEMCALDigit * Digit(Int_t index) {
91 return (const AliEMCALDigit*) fDigits->At(index);
95 TObjArray * RecPoints() { return fRecPoints;}
96 const AliEMCALRecPoint * RecPoint(Int_t index) {
98 return (const AliEMCALRecPoint*) fRecPoints->At(index);
102 void SetDebug(Int_t level) {fDebug = level;} // Set debug level
106 Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients
108 void SetAlignData(AliEMCALAlignData* alignda) { fgAlignData = alignda; }
109 void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
110 AliEMCALAlignData * AlignData(); // to get the alignment CDB object
111 AliEMCALCalibData * CalibData(); // to get the calibration CDB object
115 static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
117 Int_t fDebug ; // Debug level
119 // All data are stored in TTrees on file.
120 // These TCLonesArrays are temporary storage for reading or writing
121 // (connected to TTrees with SetBranchAddress)
122 TClonesArray *fHits; //! TClonesArray of hits (for tree reading)
123 TClonesArray *fDigits; //! TClonesArray of digits (for tree reading)
124 TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading)
125 TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
127 static AliEMCALAlignData * fgAlignData; // alignment data
128 static AliEMCALCalibData * fgCalibData; // calibration data
130 ClassDef(AliEMCALLoader,0) // Algorithm class that provides methods to retrieve objects from a list knowing the index
134 #endif // AliEMCALLOADER_H