]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALLoader.h
In case of unfolding, the splitted energy of the shared cells must not be lower than...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALLoader.h
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 //  The AliEMCALLoader gets the TClonesArray and TObjArray for reading
10 //  Hits, Dgits, SDigits and RecPoints. Filling is managed in the GetEvent()
11 //  method. The objects are retrived from  the corresponding folders.  
12 //
13 //  It also provides acces methods to the calibration and simulation OCDB parameters 
14 //
15
16 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
17 //    
18
19
20 // --- ROOT system ---
21 #include "TClonesArray.h"
22 #include "TFolder.h"  
23 #include "TTree.h"
24 class TString ;
25 class TParticle ;
26 class TTask ;
27
28 // --- AliRoot header files ---
29 #include "AliLoader.h"
30 #include "AliEMCALCalibData.h"
31 #include "AliCaloCalibPedestal.h"
32 #include "AliEMCALSimParam.h"
33 #include "AliEMCALRecParam.h"
34
35 class AliLoader ;
36 class AliEMCAL ; 
37 class AliEMCALDigit ;
38 class AliEMCALSDigit ;
39 class AliEMCALRecPoint ; 
40
41 class AliEMCALLoader : public AliLoader {
42   
43  public:
44
45   AliEMCALLoader();
46   AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); 
47   AliEMCALLoader(const Char_t *name,TFolder *topfolder);
48   
49   virtual ~AliEMCALLoader() ; 
50
51   virtual Int_t GetEvent();  // Overload to fill TClonesArray
52
53   //Clean arrays methods
54   virtual void    CleanHits() const {GetHitsDataLoader()->Clean();}       
55   virtual void    CleanSDigits() const {GetSDigitsDataLoader()->Clean();}  
56   virtual void    CleanDigits() const {GetDigitsDataLoader()->Clean();}  
57   virtual void    CleanRecPoints() const {GetRecPointsDataLoader()->Clean();}  
58   
59   // Initialize arrays methods
60   void MakeSDigitsArray() ;
61   void MakeDigitsArray() ;
62   void MakeRecPointsArray() ;
63   
64   // ************    TClonesArrays Access functions
65   
66   TClonesArray*  SDigits() {return (TClonesArray*)GetDetectorData(fgkECASDigitsBranchName);} //const { return fSDigits;}
67   const AliEMCALDigit*  SDigit(Int_t index)  {
68     if (SDigits())return (const AliEMCALDigit*) SDigits()->At(index);
69     return 0x0; 
70   }
71   
72   TClonesArray*   Digits() {return (TClonesArray*)GetDetectorData(fgkECADigitsBranchName);}//const { return fDigits;}
73   const AliEMCALDigit *  Digit(Int_t index)  {
74     if (Digits()) return (const AliEMCALDigit*) Digits()->At(index);
75     return 0x0; 
76   }
77   
78   TObjArray * RecPoints()  {return (TObjArray*)GetDetectorData(fgkECARecPointsBranchName);}//const { return fRecPoints;}
79   const AliEMCALRecPoint * RecPoint(Int_t index)  {
80     if (RecPoints())return (const AliEMCALRecPoint*) RecPoints()->At(index);
81     return 0x0; 
82   }
83   
84   void   SetDebug(Int_t level) {fDebug = level;} // Set debug level
85   
86   //OCDB access methods
87   
88   void  SetCalibData(AliEMCALCalibData* calibda)  { fgCalibData = calibda; }
89   AliEMCALCalibData * CalibData();              // to get the calibration CDB object
90   
91   void  SetPedestalData(AliCaloCalibPedestal* caloped)  { fgCaloPed = caloped; }
92   AliCaloCalibPedestal* PedestalData();         // to get the pedestal CDB object
93   
94   void  SetSimParam(AliEMCALSimParam* simparam)  { fgSimParam = simparam; }
95   AliEMCALSimParam* SimulationParameters();     // to get the simulation parameter CDB object
96   
97   void  SetRecParam(AliEMCALRecParam* recparam)  { fgRecParam = recparam; }
98   AliEMCALRecParam* ReconstructionParameters(Int_t eventType); // to get the reconstruction parameter CDB object
99
100  private:
101   
102   // assignement operator requested by coding convention, but not needed
103   AliEMCALLoader(const AliEMCALLoader &); //Not implemented
104   const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented
105   
106   static const TString fgkECASDigitsBranchName;   //! Name of branch with ECA SDigits
107   static const TString fgkECADigitsBranchName;    //! Name of branch with ECA Digits
108   static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
109   
110   Int_t  fDebug ;             // Debug level
111         
112   static AliEMCALCalibData    * fgCalibData;  //  calibration data 
113   static AliCaloCalibPedestal * fgCaloPed;    //  dead map
114   static AliEMCALSimParam     * fgSimParam;   //  sim param 
115   static AliEMCALRecParam     * fgRecParam;   //  rec param 
116
117   ClassDef(AliEMCALLoader,7)  // Algorithm class that provides methods to retrieve objects from a list knowing the index 
118     
119 };
120
121 #endif // AliEMCALLOADER_H