]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGetter.h
Adding a missing include (Laurent)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGetter.h
index 8a93d8052b68084d5cc819a4b9d060c9f4229928..030b7cb79ba12398faf1b7a1ceee05c67e620203 100644 (file)
@@ -20,6 +20,8 @@
 #include "TObject.h"  
 class TParticle ;
 class TTree ; 
+class TGraph ; 
+class TF1 ; 
 
 // --- Standard library ---
 
@@ -34,6 +36,8 @@ class TTree ;
 #include "AliPHOSRecParticle.h" 
 #include "AliPHOSDigitizer.h"
 #include "AliPHOSSDigitizer.h"
+#include "AliPHOSCalibData.h"
+
 class AliPHOS ;  
 class AliPHOSGeometry ;
 class AliPHOSClusterizer ;
@@ -41,28 +45,16 @@ class AliPHOSTrackSegmentMaker ;
 class AliPHOSPID ; 
 class AliPHOSBeamTestEvent ;
 class AliESD ; 
+class AliRawReader ;
 
 class AliPHOSGetter : public TObject {
   
 public:  
-  AliPHOSGetter(){    // ctor: this is a singleton, the ctor should never be called but cint needs it as public
-    Fatal("ctor", "AliPHOSGetter is a singleton default ctor not callable") ;
-  } 
-protected :
-  AliPHOSGetter(Int_t /*i*/){    // special constructor for onflight 
-
-  } 
-private:
-  AliPHOSGetter(const char* headerFile,
-               const char* version = AliConfig::GetDefaultEventFolderName(),
-               Option_t * openingOption = "READ") ;
+  // ctor: this is a singleton, the ctor should never be called but cint needs it as public
+  AliPHOSGetter() ;
 
 public:
-  AliPHOSGetter(const AliPHOSGetter & obj) : TObject(obj) {
-    // cpy ctor requested by Coding Convention 
-    Fatal("cpy ctor", "not implemented") ;
-  } 
-  
+  AliPHOSGetter(const AliPHOSGetter & obj) ;
   AliPHOSGetter & operator = (const AliPHOSGetter & ) {
     // assignement operator requested by coding convention, but not needed
     Fatal("operator =", "not implemented") ;
@@ -76,6 +68,7 @@ public:
                                  Option_t * openingOption = "READ" ) ; 
   static AliPHOSGetter * Instance() ; 
   
+  void Print(const Option_t *)const{}
   static void Print() ; 
   
   //=========== General information about run ==============
@@ -94,13 +87,18 @@ public:
   
   //========== Methods to read something from file ==========
   virtual void   Event(Int_t event, const char * opt = "HSDRTP") ;    
+  void   Event(AliRawReader *rawReader, const char * opt = "W",Bool_t isOldRCUFormat = kFALSE) ;    
   virtual void   Track(Int_t itrack) ;
  
   
   //-----------------now getter's data--------------------------------------
-  virtual AliPHOSCalibrationDB * CalibrationDB(){return  fcdb; }
-  virtual void ReadCalibrationDB(const char * /*name*/, const char * /*filename*/){ ;}
+  AliPHOSCalibrationDB * CalibrationDB(){return  fcdb; }
+  void ReadCalibrationDB(const char * /*name*/, const char * /*filename*/){ ;}
+  void SetCalibrationDB(AliPHOSCalibrationDB * cdb) {fcdb = cdb ;}
   
+  void SetCalibData(AliPHOSCalibData* calibda) { fgCalibData = calibda; }
+  AliPHOSCalibData * CalibData();
+
   //=========== Primaries ============
   virtual TClonesArray *    Primaries(void) ;
   virtual TParticle * Primary(Int_t index) const ;
@@ -108,13 +106,13 @@ public:
   virtual TParticle * Secondary(const TParticle * p, Int_t index=1) const ;  
   
   //=========== Hits =================
-  virtual TClonesArray *  Hits(void)  ; 
-  virtual AliPHOSHit *    Hit(Int_t index) { return dynamic_cast<AliPHOSHit*>(Hits()->At(index) );}
+  virtual TClonesArray *  Hits(void) const ; 
+  virtual AliPHOSHit *    Hit(Int_t index) const { return dynamic_cast<AliPHOSHit*>(Hits()->At(index) );}
   virtual TTree *         TreeH() const ; 
   
   //=========== SDigits ==============
-  virtual TClonesArray *      SDigits() ;  
-  virtual AliPHOSDigit *      SDigit(Int_t index) { return static_cast<AliPHOSDigit *>(SDigits()->At(index)) ;} 
+  virtual TClonesArray *      SDigits() const ;  
+  virtual AliPHOSDigit *      SDigit(Int_t index) const { return static_cast<AliPHOSDigit *>(SDigits()->At(index)) ;} 
   virtual TTree *             TreeS() const ; 
   virtual AliPHOSSDigitizer * SDigitizer() ;  
   
@@ -126,8 +124,8 @@ public:
     return  PhosLoader()->WriteSDigitizer(opt) ; }
   
   //========== Digits ================
-  virtual TClonesArray * Digits() ;
-  virtual AliPHOSDigit * Digit(Int_t index) { return static_cast<AliPHOSDigit *>(Digits()->At(index)) ;} 
+  virtual TClonesArray * Digits() const ;
+  virtual AliPHOSDigit * Digit(Int_t index) const { return static_cast<AliPHOSDigit *>(Digits()->At(index)) ;} 
   virtual TTree *        TreeD() const ; 
   virtual AliPHOSDigitizer * Digitizer() ;
   virtual TString             GetDigitsFileName() const { return PhosLoader()->GetDigitsFileName() ; }  
@@ -143,10 +141,10 @@ public:
   virtual void                SetRawDigits(Bool_t isRaw = kTRUE){fRawDigits = isRaw;}
   
   //========== RecPoints =============
-  virtual TObjArray *           EmcRecPoints() ;
-  virtual AliPHOSEmcRecPoint *  EmcRecPoint(Int_t index) { return static_cast<AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} 
-  virtual TObjArray *           CpvRecPoints() ; 
-  virtual AliPHOSCpvRecPoint *  CpvRecPoint(Int_t index) { return static_cast<AliPHOSCpvRecPoint *>(CpvRecPoints()->At(index)) ;} 
+  virtual TObjArray *           EmcRecPoints() const;
+  virtual AliPHOSEmcRecPoint *  EmcRecPoint(Int_t index) const { return static_cast<AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} 
+  virtual TObjArray *           CpvRecPoints() const 
+  virtual AliPHOSCpvRecPoint *  CpvRecPoint(Int_t index) const { return static_cast<AliPHOSCpvRecPoint *>(CpvRecPoints()->At(index)) ;} 
   virtual TTree *               TreeR() const ;
   virtual AliPHOSClusterizer * Clusterizer() ;
   virtual TString               GetRecPointsFileName() const { return PhosLoader()->GetRecPointsFileName() ; } 
@@ -158,8 +156,8 @@ public:
     return  PhosLoader()->WriteClusterizer(opt) ; }
   
   //========== TrackSegments   TClonesArray * TrackSegments(const char * name = 0) { 
-  virtual TClonesArray *           TrackSegments() ;
-  virtual AliPHOSTrackSegment *  TrackSegment(Int_t index) { return static_cast<AliPHOSTrackSegment *>(TrackSegments()->At(index)) ;} 
+  virtual TClonesArray *           TrackSegments() const;
+  virtual AliPHOSTrackSegment *  TrackSegment(Int_t index) const { return static_cast<AliPHOSTrackSegment *>(TrackSegments()->At(index)) ;} 
   virtual TTree *               TreeT() const ;
   virtual AliPHOSTrackSegmentMaker * TrackSegmentMaker() ;
   virtual TString               GetTracksFileName() const { return PhosLoader()->GetTracksFileName() ; } 
@@ -171,8 +169,8 @@ public:
     return  PhosLoader()->WriteTracker(opt) ; }
   
   //========== RecParticles ===========
-  virtual TClonesArray *         RecParticles() ;
-  virtual AliPHOSRecParticle *   RecParticle(Int_t index) { return static_cast<AliPHOSRecParticle *>(RecParticles()->At(index)) ;} 
+  virtual TClonesArray *         RecParticles() const;
+  virtual AliPHOSRecParticle *   RecParticle(Int_t index) const { return static_cast<AliPHOSRecParticle *>(RecParticles()->At(index)) ;} 
   virtual TTree *               TreeP() const ;
   virtual AliPHOSPID * PID() ;
   virtual TString               GetRecParticlesFileName() const { return PhosLoader()->GetRecParticlesFileName() ; } 
@@ -184,9 +182,9 @@ public:
     return  PhosLoader()->WritePID(opt) ; }
 
   //========== Raw ===========
-  virtual Int_t ReadRaw(Int_t event) ; 
+  virtual Int_t ReadRaw(AliRawReader *rawReader,Bool_t isOldRCUFormat) ; 
 
-  virtual void SetDebug(Int_t level) {fgDebug = level;} // Set debug level 
+  void SetDebug(Int_t level) {fgDebug = level;} // Set debug level 
   virtual void PostClusterizer(AliPHOSClusterizer * clu) 
     const{PhosLoader()->PostClusterizer(clu) ; }
   virtual void PostPID(AliPHOSPID * pid) 
@@ -196,7 +194,7 @@ public:
   virtual void PostSDigitizer (AliPHOSSDigitizer * sdigitizer) 
     const {PhosLoader()->PostSDigitizer(sdigitizer);}    
   virtual void PostDigitizer (AliPHOSDigitizer * digitizer)    
-    const {PhosLoader()->PostDigitizer(dynamic_cast<AliDigitizer *>(digitizer));}
+    const {PhosLoader()->PostDigitizer(digitizer);}
   
   virtual TString Version() const  { return PhosLoader()->GetTitle() ; } 
   virtual AliPHOSLoader * PhosLoader() const { return  fgPhosLoader ; }
@@ -204,19 +202,32 @@ public:
   
   virtual AliESD * ESD() const { return fESD ; }
   
+protected :
+  AliPHOSGetter(Int_t /*i*/) ;
+  
+protected:
+  static AliPHOSGetter * fgObjGetter; // pointer to the unique instance of the singleton 
+  
+private:
+  AliPHOSGetter(const char* headerFile,
+               const char* version = AliConfig::GetDefaultEventFolderName(),
+               Option_t * openingOption = "READ") ;
 private:
   
-  Int_t ReadTreeD(void) ;
-  Int_t ReadTreeH(void) ;
-  Int_t ReadTreeR(void) ;
-  Int_t ReadTreeT(void) ;
-  Int_t ReadTreeS(void) ;
-  Int_t ReadTreeP(void) ;
+  Int_t ReadTreeD(void) const ;
+  Int_t ReadTreeH(void) const ;
+  Int_t ReadTreeR(void) const ;
+  Int_t ReadTreeT(void) const ;
+  Int_t ReadTreeS(void) const ;
+  Int_t ReadTreeP(void) const ;
 
   Int_t ReadTreeE(Int_t event) ;    
   Bool_t OpenESDFile() ;
   void ReadPrimaries(void) ;
 
+  void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Double_t & energy, Double_t & time) const; 
+
+  Int_t CalibrateRaw (Double_t energy, Int_t *relId);
 
 private:
   
@@ -231,19 +242,17 @@ private:
   AliESD *          fESD ;               //! ESD object
   TTree *           fESDTree ;           //! ESD Tree
   
-  Bool_t            fRawDigits ;         //!
+  Bool_t            fRawDigits ;         //! true is raw data
+
+  AliPHOSCalibrationDB * fcdb ;          //! Calibration DB for beam test run 2004
+  static AliPHOSCalibData * fgCalibData; //! instance of AliPHOSCalibData
 
-  AliPHOSCalibrationDB * fcdb ;       //!
-  
   static AliPHOSLoader * fgPhosLoader ; // the loader for the NewIO
   
   enum EDataTypes{kHits,kSDigits,kDigits,kRecPoints,kTracks,kNDataTypes};
 
- protected:
-  static AliPHOSGetter * fgObjGetter; // pointer to the unique instance of the singleton 
-  
   
-  ClassDef(AliPHOSGetter,1)  // Algorithm class that provides methods to retrieve objects from a list knowing the index 
+  ClassDef(AliPHOSGetter,2)  // Algorithm class that provides methods to retrieve objects from a list knowing the index 
     
     };