]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGetter.h
Inserting TMath.h where required by the new version of ROOT
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGetter.h
index 675706e1d5d813874d46eb8eefcd8623dd26ef6a..030b7cb79ba12398faf1b7a1ceee05c67e620203 100644 (file)
@@ -50,24 +50,11 @@ 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") ;
@@ -100,7 +87,7 @@ 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") ;    
+  void   Event(AliRawReader *rawReader, const char * opt = "W",Bool_t isOldRCUFormat = kFALSE) ;    
   virtual void   Track(Int_t itrack) ;
  
   
@@ -109,7 +96,7 @@ public:
   void ReadCalibrationDB(const char * /*name*/, const char * /*filename*/){ ;}
   void SetCalibrationDB(AliPHOSCalibrationDB * cdb) {fcdb = cdb ;}
   
-  void SetCalibData(AliPHOSCalibData* calibda) { fCalibData = calibda; }
+  void SetCalibData(AliPHOSCalibData* calibda) { fgCalibData = calibda; }
   AliPHOSCalibData * CalibData();
 
   //=========== Primaries ============
@@ -119,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() ;  
   
@@ -137,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() ; }  
@@ -154,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() ; } 
@@ -169,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() ; } 
@@ -182,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() ; } 
@@ -195,7 +182,7 @@ public:
     return  PhosLoader()->WritePID(opt) ; }
 
   //========== Raw ===========
-  virtual Int_t ReadRaw(AliRawReader *rawReader) ; 
+  virtual Int_t ReadRaw(AliRawReader *rawReader,Bool_t isOldRCUFormat) ; 
 
   void SetDebug(Int_t level) {fgDebug = level;} // Set debug level 
   virtual void PostClusterizer(AliPHOSClusterizer * clu) 
@@ -215,20 +202,30 @@ 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) ; 
+  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);
 
@@ -247,18 +244,15 @@ private:
   
   Bool_t            fRawDigits ;         //! true is raw data
 
-  AliPHOSCalibrationDB * fcdb ;       //!
-  static AliPHOSCalibData * fCalibData;
+  AliPHOSCalibrationDB * fcdb ;          //! Calibration DB for beam test run 2004
+  static AliPHOSCalibData * fgCalibData; //! instance of AliPHOSCalibData
 
   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 
     
     };