]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALLoader.h
minor corrections for calibration staff
[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"
3a8be91c 30#include "AliEMCALRecParam.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);
6b299d9e 46 AliEMCALLoader(const Char_t *name,TFolder *topfolder);
88cb7938 47
48 virtual ~AliEMCALLoader() ;
49
50 // assignement operator requested by coding convention, but not needed
d64c959b 51 const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;}
88cb7938 52
5dee926e 53 virtual Int_t GetEvent(); // Overload to fill TClonesArray
54
55 virtual void CleanHits() const
56 { if (fHits) fHits->Clear(); AliLoader::CleanHits(); }
57 virtual void CleanSDigits() const
58 { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); }
59 virtual void CleanDigits() const
60 { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); }
61 virtual void CleanRecPoints() const
62 { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); }
63
64 // This does not work due to const
65 /*
66 virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); }
67 virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); }
68 virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); }
69 virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); }
70 */
71
72 // ************ TClonesArrays Access functions
73
74 TClonesArray* Hits(void) { return fHits;}
75
76 const AliEMCALHit* Hit(Int_t index) {
77 if (fHits)
78 return (const AliEMCALHit*) fHits->At(index);
79 return 0x0;
80 }
81
82 TClonesArray* SDigits() { return fSDigits;}
83 const AliEMCALDigit* SDigit(Int_t index) {
84 if (fSDigits)
85 return (const AliEMCALDigit*) fSDigits->At(index);
86 return 0x0;
87 }
88
89 TClonesArray* Digits() { return fDigits;}
90 const AliEMCALDigit * Digit(Int_t index) {
91 if (fDigits)
92 return (const AliEMCALDigit*) fDigits->At(index);
93 return 0x0;
94 }
95
96 TObjArray * RecPoints() { return fRecPoints;}
97 const AliEMCALRecPoint * RecPoint(Int_t index) {
98 if (fRecPoints)
99 return (const AliEMCALRecPoint*) fRecPoints->At(index);
100 return 0x0;
101 }
88cb7938 102
88cb7938 103 void SetDebug(Int_t level) {fDebug = level;} // Set debug level
88cb7938 104
f565d89d 105 //Calibration
106
107 Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients
bcdecbbe 108
14ce0a6e 109 void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
bcdecbbe 110 AliEMCALCalibData * CalibData(); // to get the calibration CDB object
f565d89d 111
3a8be91c 112 AliEMCALRecParam * RecParam(); // to get rec.parameters from CDB
113
88cb7938 114private:
f565d89d 115
5dee926e 116 static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
88cb7938 117
d64c959b 118 Int_t fDebug ; // Debug level
88cb7938 119
5dee926e 120 // All data are stored in TTrees on file.
121 // These TCLonesArrays are temporary storage for reading or writing
122 // (connected to TTrees with SetBranchAddress)
123 TClonesArray *fHits; //! TClonesArray of hits (for tree reading)
124 TClonesArray *fDigits; //! TClonesArray of digits (for tree reading)
125 TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading)
bcdecbbe 126 TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
127
14ce0a6e 128 static AliEMCALCalibData * fgCalibData; // calibration data
3a8be91c 129 static AliEMCALRecParam * fgRecParam ; // reconstruction parameters
f565d89d 130
3a8be91c 131 ClassDef(AliEMCALLoader,1) // Algorithm class that provides methods to retrieve objects from a list knowing the index
5dee926e 132
88cb7938 133};
134
88cb7938 135#endif // AliEMCALLOADER_H