]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALSDigitizer.h
Test beam raw data reading
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALSDigitizer.h
index 15211592a3b9479a11f6e46c21befdac42bbb097..3c6fd6d512180c0f6869693733a1888d7f26b6fe 100644 (file)
 //
 // Modif: 
 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
-//                           of new  IO (à la PHOS)
+//  July   2003 Yves Schutz: new  IO (à la PHOS)
  
 // --- ROOT system ---
 #include "TTask.h"
-#include "TString.h"
+class TFile ;
+class TList;
+class TBrowser;
+//class TBrowser;
+
 // --- Standard library ---
 
 // --- AliRoot header files ---
+#include "AliConfig.h"
 
 class AliEMCALSDigitizer: public TTask {
 
 public:
   AliEMCALSDigitizer() ;          // ctor
-  AliEMCALSDigitizer(const char* headerFile,const char* hdigitsTitle = "Default", const Bool_t toSplit = kFALSE) ; 
-  virtual ~AliEMCALSDigitizer() ; // dtor
+  AliEMCALSDigitizer(const char * alirunFileName, const char * eventFolderName = AliConfig::GetDefaultEventFolderName()) ; 
+  AliEMCALSDigitizer(const AliEMCALSDigitizer & sd) ;
+  virtual ~AliEMCALSDigitizer(); // dtor
 
-  Float_t  Calibrate(Int_t amp)const {return (amp - fA)/fB ; }
-  Int_t    Digitize(Float_t Energy)const { return (Int_t ) ( fA + Energy*fB); }
+  Float_t       Calibrate(Int_t amp)const {return (amp - fA)/fB ; }
+  Int_t         Digitize(Float_t energy)const;
   virtual void  Exec(Option_t *option); 
-  const char *  GetSDigitsBranch()const{return GetName();}  
-  const Int_t   GetSDigitsInRun() const {return fSDigitsInRun ;}  
-  const Float_t GetPedestalParameter()const {return fA;}
-  const Float_t GetCalibrationParameter()const{return fB;}
-  virtual void  Print(Option_t* option) const ;
-  void SetSDigitsBranch(const char * title ) ;
-  void SetPedestalParameter(Float_t A){fA = A ;}
-  void SetSlopeParameter(Float_t B){fB = B ;}
-  void UseHitsFrom(const char * filename) ;      
+  Int_t         GetSDigitsInRun() const {return fSDigitsInRun ;}  
+  virtual void  Print(Option_t *option="") const;
+  void          Print1(Option_t *option="all");  // *MENU*
+  void          SetEventFolderName(TString name) { fEventFolderName = name ; }
+  void          SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
+
   Bool_t operator == (const AliEMCALSDigitizer & sd) const ;
-  const Int_t Segment2TowerID(Int_t SegmentID){
-    return Layer2TowerID(SegmentID,kFALSE);
-}
+  const AliEMCALSDigitizer & operator = (const AliEMCALSDigitizer & /*sd*/) {return *this ;}
+
+  virtual void Browse(TBrowser* b);
+  // hists
+  void   SetControlHists(Int_t var=0) {fControlHists=var;}
+  Int_t  GetControlHist() const {return fControlHists;}
+  TList *GetListOfHists() {return fHists;}
+  TList* BookControlHists(int var=0);
+  void   SaveHists(const char* name="RF/TRD1/Digitizations/SDigiVar?", 
+  Bool_t kSingleKey=kTRUE, const char* opt="RECREATE"); // *MENU*
 
 private:
   void     Init() ;
   void     InitParameters() ; 
   void     PrintSDigits(Option_t * option) ;
-  const Int_t Layer2TowerID(Int_t,Bool_t) ;
+  void     Unload() const ;
 
 private:
   Float_t fA ;                     // Pedestal parameter
   Float_t fB ;                     // Slope Digitizition parameters
-  Float_t fPhotonElectronFactor ;  // number of photon electrons per GeV
-                                   // should be calculated independently for each layer as : 
-                                   // LightYield*LightCollectionEfficiency*LightAttenuation*APDPhotoElectronEfficiency*APDGain
-  Float_t fTowerPrimThreshold ;    // To store primary in Tower if Elos > threshold
-  Float_t fPreShowerPrimThreshold ;// To store primary if Pre Shower Elos > threshold
-   Bool_t  fDefaultInit;           //! Says if the task was created by defaut ctor (only parameters are initialized)
+  Float_t fECPrimThreshold ;       // To store primary if EC Shower Elos > threshold
+  Bool_t  fDefaultInit;            //! Says if the task was created by defaut ctor (only parameters are initialized)
+  TString fEventFolderName;        // event folder name
+  Bool_t  fInit ;                  //! tells if initialisation went OK, will revent exec if not
   Int_t   fSDigitsInRun ;          //! Total number of sdigits in one run
-  TFile * fSplitFile ;             //! file in which SDigits will eventually be stored
-  Bool_t  fToSplit ;               //! Says that sigits should be written into splip file
-
-  ClassDef(AliEMCALSDigitizer,2)  // description 
+  Int_t   fFirstEvent;             // first event to process
+  Int_t   fLastEvent;              // last  event to process
+  Float_t fSampling;               // See AliEMCALGeometry
+  // Control hists
+  Int_t   fControlHists;          //!
+  TList  *fHists;                 //!
 
+  ClassDef(AliEMCALSDigitizer,5)  // description 
 };
 
 #endif // AliEMCALSDigitizer_H