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