]>
Commit | Line | Data |
---|---|---|
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" | |
23 | class TString ; | |
24 | class TParticle ; | |
25 | class TTask ; | |
26 | ||
88cb7938 | 27 | // --- AliRoot header files --- |
5dee926e | 28 | #include "AliLoader.h" |
d64c959b | 29 | class AliLoader ; |
30 | class AliEMCAL ; | |
31 | class AliEMCALHit ; | |
5dee926e | 32 | class AliEMCALDigit ; |
33 | class AliEMCALSDigit ; | |
34 | class AliEMCALRecPoint ; | |
88cb7938 | 35 | |
36 | class AliEMCALLoader : public AliLoader { | |
37 | ||
38 | public: | |
39 | ||
40 | AliEMCALLoader(); | |
39200c71 | 41 | AliEMCALLoader(const AliEMCALLoader & obj):AliLoader(obj){} |
88cb7938 | 42 | AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); |
43 | ||
44 | virtual ~AliEMCALLoader() ; | |
45 | ||
46 | // assignement operator requested by coding convention, but not needed | |
d64c959b | 47 | const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;} |
88cb7938 | 48 | |
5dee926e | 49 | virtual Int_t GetEvent(); // Overload to fill TClonesArray |
50 | ||
51 | virtual void CleanHits() const | |
52 | { if (fHits) fHits->Clear(); AliLoader::CleanHits(); } | |
53 | virtual void CleanSDigits() const | |
54 | { if (fSDigits) fSDigits->Clear(); AliLoader::CleanSDigits(); } | |
55 | virtual void CleanDigits() const | |
56 | { if (fDigits) fDigits->Clear(); AliLoader::CleanDigits(); } | |
57 | virtual void CleanRecPoints() const | |
58 | { if (fRecPoints) fRecPoints->Clear(); AliLoader::CleanRecPoints(); } | |
59 | ||
60 | // This does not work due to const | |
61 | /* | |
62 | virtual void MakeHitsContainer() const { AliLoader::MakeHitsContainer(); TreeH()->Branch(fDetectorName,"TClonesArray",&fHits); } | |
63 | virtual void MakeSDigitsContainer() const { AliLoader::MakeSDigitsContainer(); TreeS()->SetBranchAddress(fDetectorName,&fSDigits); } | |
64 | virtual void MakeDigitsContainer() const { AliLoader::MakeDigitsContainer(); TreeD()->SetBranchAddress(fDetectorName,&fDigits); } | |
65 | virtual void MakeRecPointsContainer() const { AliLoader::MakeRecPointsContainer(); TreeR()->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints); } | |
66 | */ | |
67 | ||
68 | // ************ TClonesArrays Access functions | |
69 | ||
70 | TClonesArray* Hits(void) { return fHits;} | |
71 | ||
72 | const AliEMCALHit* Hit(Int_t index) { | |
73 | if (fHits) | |
74 | return (const AliEMCALHit*) fHits->At(index); | |
75 | return 0x0; | |
76 | } | |
77 | ||
78 | TClonesArray* SDigits() { return fSDigits;} | |
79 | const AliEMCALDigit* SDigit(Int_t index) { | |
80 | if (fSDigits) | |
81 | return (const AliEMCALDigit*) fSDigits->At(index); | |
82 | return 0x0; | |
83 | } | |
84 | ||
85 | TClonesArray* Digits() { return fDigits;} | |
86 | const AliEMCALDigit * Digit(Int_t index) { | |
87 | if (fDigits) | |
88 | return (const AliEMCALDigit*) fDigits->At(index); | |
89 | return 0x0; | |
90 | } | |
91 | ||
92 | TObjArray * RecPoints() { return fRecPoints;} | |
93 | const AliEMCALRecPoint * RecPoint(Int_t index) { | |
94 | if (fRecPoints) | |
95 | return (const AliEMCALRecPoint*) fRecPoints->At(index); | |
96 | return 0x0; | |
97 | } | |
88cb7938 | 98 | |
88cb7938 | 99 | void SetDebug(Int_t level) {fDebug = level;} // Set debug level |
88cb7938 | 100 | |
101 | private: | |
5dee926e | 102 | static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points |
88cb7938 | 103 | |
d64c959b | 104 | Int_t fDebug ; // Debug level |
88cb7938 | 105 | |
5dee926e | 106 | // All data are stored in TTrees on file. |
107 | // These TCLonesArrays are temporary storage for reading or writing | |
108 | // (connected to TTrees with SetBranchAddress) | |
109 | TClonesArray *fHits; //! TClonesArray of hits (for tree reading) | |
110 | TClonesArray *fDigits; //! TClonesArray of digits (for tree reading) | |
111 | TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading) | |
112 | TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading) | |
113 | ClassDef(AliEMCALLoader,0) // Algorithm class that provides methods to retrieve objects from a list knowing the index | |
114 | ||
88cb7938 | 115 | }; |
116 | ||
88cb7938 | 117 | #endif // AliEMCALLOADER_H |