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