]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSGetterLight.h
528be5b845454bed226c48d282051cb641a67da5
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGetterLight.h
1 #ifndef ALIPHOSGETTERLIGHT_H
2 #define ALIPHOSGETTERLIGHT_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 //  Class to substitute AliPHOSGetter in "on flight" reconstruction (i.e. without 
10 //  writing to file and creation full ALICE data structure)      
11 //                  
12 //*-- Author: D.Peressounko (RRC KI)
13
14
15 // --- ROOT system ---
16 class TClonesArray ;
17 class TObjArray ;
18
19 // --- Standard library ---
20  
21 // --- AliRoot header files ---
22 #include "AliPHOSGetter.h" 
23 #include "AliPHOSGeometry.h"
24 class AliPHOSClusterizer ;
25 class AliPHOSTrackSegmentMaker ;
26 class AliPHOSPID ;
27
28 class AliPHOSGetterLight : public AliPHOSGetter {
29
30 public:
31   AliPHOSGetterLight() ;          // ctor
32   AliPHOSGetterLight(const AliPHOSGetterLight & obj) : AliPHOSGetter(obj) {
33     // cpy ctor requested by Coding Convention 
34     Fatal("cpy ctor", "not implemented") ;
35   } 
36   
37   AliPHOSGetterLight & operator = (const AliPHOSGetterLight & ) {
38     // assignement operator requested by coding convention, but not needed
39     Fatal("operator =", "not implemented") ;
40     return *this ; 
41   }
42
43   virtual ~AliPHOSGetterLight() ; // dtor
44
45   //method normally used for creation of this class
46   static AliPHOSGetterLight * Instance(const char* /*headerFile*/,
47                                   const char* version = AliConfig::GetDefaultEventFolderName(),
48                                   Option_t * openingOption = "READ" ) ; 
49   static AliPHOSGetterLight * Instance() ; 
50
51   //=========== General information about run ==============
52   
53   virtual Int_t  MaxEvent() const {return 1 ;} //always "read" event 1 
54   virtual Int_t  EventNumber() const {return 0; }  //always the same event 
55   virtual Bool_t VersionExists(TString & /*opt*/) const {return kFALSE;} 
56   virtual UShort_t EventPattern(void) const {return 0;}  //not needed in on-flight reconstruction
57   virtual Float_t  BeamEnergy(void) const {return 10.;} //not needed in on-flight reconstruction
58   
59   //========== PHOSGeometry and PHOS ============= 
60   //Dummy function not necessary for on-flight reconstruction, but has to be overloaded
61   virtual AliPHOSGeometry * PHOSGeometry() const {return AliPHOSGeometry::GetInstance("IHEP","IHEP") ; } //Create if necessary geom
62   
63   //========== Methods to read something from file ==========
64   virtual void   Event(Int_t /*event*/, const char * /*opt = "HSDRTP"*/){} //Use data already in memory    
65  
66   
67   //-----------------now getter's data--------------------------------------
68   
69   //========== Digits ================
70   virtual TClonesArray * Digits() const {return fDigits ; }
71   virtual AliPHOSDigit * Digit(Int_t index) const { return static_cast<AliPHOSDigit *>(fDigits->At(index)) ;} 
72   //  virtual AliPHOSDigitizer * Digitizer(){Error("Digitizer","Method not defined") ; return 0;}
73   
74   //========== RecPoints =============
75   virtual TObjArray *           EmcRecPoints() const {return fEmcRecPoints ;}
76   virtual AliPHOSEmcRecPoint *  EmcRecPoint(Int_t index) const { return static_cast<AliPHOSEmcRecPoint *>(fEmcRecPoints->At(index)) ;} 
77   virtual TObjArray *           CpvRecPoints() const {return fCpvRecPoints ;} 
78   virtual AliPHOSCpvRecPoint *  CpvRecPoint(Int_t index) const { return static_cast<AliPHOSCpvRecPoint *>(fCpvRecPoints->At(index)) ;} 
79   virtual AliPHOSClusterizer * Clusterizer() { return fClusterizer;}
80   
81   //========== TrackSegments   TClonesArray * TrackSegments(const char * name = 0) { 
82   virtual TClonesArray *        TrackSegments() const {return fTS ;} ;
83   virtual AliPHOSTrackSegment * TrackSegment(Int_t index) const { return static_cast<AliPHOSTrackSegment *>(fTS->At(index)) ;} 
84   virtual AliPHOSTrackSegmentMaker * TrackSegmentMaker(){ return fTSM ;}
85   
86   //========== RecParticles ===========
87   virtual TClonesArray *        RecParticles() const { return fRP;} 
88   virtual AliPHOSRecParticle *  RecParticle(Int_t index) const { return static_cast<AliPHOSRecParticle *>(fRP->At(index)) ;} 
89   virtual AliPHOSPID *          PID(){return fPID ;} 
90
91   //========== Raw ===========
92   //  virtual Int_t ReadRaw(Int_t event) ; 
93
94   virtual void PostClusterizer(AliPHOSClusterizer * clu)const{((AliPHOSGetterLight*)fgObjGetter)->fClusterizer = clu;} 
95   virtual void PostPID(AliPHOSPID * pid)const{((AliPHOSGetterLight*)fgObjGetter)->fPID = pid ;} 
96   virtual void PostTrackSegmentMaker(AliPHOSTrackSegmentMaker * tr)const{((AliPHOSGetterLight*)fgObjGetter)->fTSM = tr ;} 
97   virtual TString Version() const  { return "OnFlight" ; } 
98   virtual void Reset(){} 
99   
100   virtual AliESD * ESD() const { return 0 ; }
101
102 private:
103   
104   AliPHOSGetterLight(const char* headerFile,
105                 const char* version = AliConfig::GetDefaultEventFolderName(),
106                 Option_t * openingOption = "READ") ;
107
108 private :
109
110   TClonesArray * fDigits ;        //Digits container for current event
111   TObjArray    * fEmcRecPoints ;  //EmcRecPoints container for current event
112   TObjArray    * fCpvRecPoints ;  //CPV RecPoints container for current event
113   TClonesArray * fTS ;            //TrackSegments container for currect event
114   TClonesArray * fRP ;            //Rec Particles conatiner for currect event
115
116   //  AliPHOSCalibrationDB * fcdb ;   //Pointer to calibration database
117
118   AliPHOSClusterizer       * fClusterizer ; //Pointer to clusterizer 
119   AliPHOSTrackSegmentMaker * fTSM ;         //Pointer to TrackSegmentMaker
120   AliPHOSPID               * fPID ;         //Pointer to PIDMaker
121
122   //  Bool_t         fRawDigits ;    //Do we reconstruct raw digits
123
124   ClassDef(AliPHOSGetterLight,1)  // Getter for \"on flyght\" reconstruction 
125
126 };
127
128 #endif // AliPHOSGETTERLIGHT_H