add some missing copy ctors and progress toward code convention compliance
[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();
0a4cb131 44 AliEMCALLoader(const AliEMCALLoader & 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
53
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(); }
62
63 // This does not work due to const
64 /*
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); }
69 */
70
71 // ************ TClonesArrays Access functions
72
73 TClonesArray* Hits(void) { return fHits;}
74
75 const AliEMCALHit* Hit(Int_t index) {
76 if (fHits)
77 return (const AliEMCALHit*) fHits->At(index);
78 return 0x0;
79 }
80
81 TClonesArray* SDigits() { return fSDigits;}
82 const AliEMCALDigit* SDigit(Int_t index) {
83 if (fSDigits)
84 return (const AliEMCALDigit*) fSDigits->At(index);
85 return 0x0;
86 }
87
88 TClonesArray* Digits() { return fDigits;}
89 const AliEMCALDigit * Digit(Int_t index) {
90 if (fDigits)
91 return (const AliEMCALDigit*) fDigits->At(index);
92 return 0x0;
93 }
94
95 TObjArray * RecPoints() { return fRecPoints;}
96 const AliEMCALRecPoint * RecPoint(Int_t index) {
97 if (fRecPoints)
98 return (const AliEMCALRecPoint*) fRecPoints->At(index);
99 return 0x0;
100 }
88cb7938 101
88cb7938 102 void SetDebug(Int_t level) {fDebug = level;} // Set debug level
88cb7938 103
f565d89d 104 //Calibration
105
106 Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients
bcdecbbe 107
14ce0a6e 108 void SetAlignData(AliEMCALAlignData* alignda) { fgAlignData = alignda; }
109 void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
bcdecbbe 110 AliEMCALAlignData * AlignData(); // to get the alignment CDB object
111 AliEMCALCalibData * CalibData(); // to get the calibration CDB object
f565d89d 112
88cb7938 113private:
f565d89d 114
5dee926e 115 static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
88cb7938 116
d64c959b 117 Int_t fDebug ; // Debug level
88cb7938 118
5dee926e 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)
bcdecbbe 125 TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
126
14ce0a6e 127 static AliEMCALAlignData * fgAlignData; // alignment data
128 static AliEMCALCalibData * fgCalibData; // calibration data
f565d89d 129
5dee926e 130 ClassDef(AliEMCALLoader,0) // Algorithm class that provides methods to retrieve objects from a list knowing the index
131
88cb7938 132};
133
88cb7938 134#endif // AliEMCALLOADER_H