]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALSDigitizer.h
Update of simple generator
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALSDigitizer.h
1 #ifndef ALIEMCALSDigitizer_H
2 #define ALIEMCALSDigitizer_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5 /* $Id$ */
6 //_________________________________________________________________________
7 //  Task Class for making SDigits in EMCAL      
8 //                  
9 //*-- Author: Sahal Yacoob (LBL)
10 // based on : AliPHOSSDigitizer
11 //_________________________________________________________________________
12 //
13 // Modif: 
14 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
15 //                           of new  IO (à la PHOS)
16  
17 // --- ROOT system ---
18 #include "TTask.h"
19 #include "TString.h"
20 // --- Standard library ---
21
22 // --- AliRoot header files ---
23
24 class AliEMCALSDigitizer: public TTask {
25
26 public:
27   AliEMCALSDigitizer() ;          // ctor
28   AliEMCALSDigitizer(const char* headerFile,const char* hdigitsTitle = "Default", const Bool_t toSplit = kFALSE) ; 
29   virtual ~AliEMCALSDigitizer() ; // dtor
30
31   Float_t  Calibrate(Int_t amp)const {return (amp - fA)/fB ; }
32   Int_t    Digitize(Float_t Energy)const { return (Int_t ) ( fA + Energy*fB); }
33   virtual void  Exec(Option_t *option); 
34   const char *  GetSDigitsBranch()const{return GetName();}  
35   const Int_t   GetSDigitsInRun() const {return fSDigitsInRun ;}  
36   const Float_t GetPedestalParameter()const {return fA;}
37   const Float_t GetCalibrationParameter()const{return fB;}
38   virtual void  Print(Option_t* option) const ;
39   void SetSDigitsBranch(const char * title ) ;
40   void SetPedestalParameter(Float_t A){fA = A ;}
41   void SetSlopeParameter(Float_t B){fB = B ;}
42   void UseHitsFrom(const char * filename) ;      
43   Bool_t operator == (const AliEMCALSDigitizer & sd) const ;
44 //   const Int_t Segment2TowerID(Int_t SegmentID){
45 //     return Layer2TowerID(SegmentID,0);
46 // }
47
48 private:
49   void     Init() ;
50   void     InitParameters() ; 
51   void     PrintSDigits(Option_t * option) ;
52
53 private:
54   Float_t fA ;                     // Pedestal parameter
55   Float_t fB ;                     // Slope Digitizition parameters
56   Float_t fPREPrimThreshold ;      // To store primary if Pre Shower Elos > threshold
57   Float_t fECPrimThreshold ;       // To store primary if EC Shower Elos > threshold
58   Float_t fHCPrimThreshold ;       // To store primary if HC Shower Elos > threshold
59   Bool_t  fDefaultInit;            //! Says if the task was created by defaut ctor (only parameters are initialized)
60   Int_t   fSDigitsInRun ;          //! Total number of sdigits in one run
61   TFile * fSplitFile ;             //! file in which SDigits will eventually be stored
62   Bool_t  fToSplit ;               //! Says that sigits should be written into splip file
63
64   ClassDef(AliEMCALSDigitizer,4)  // description 
65
66 };
67
68 #endif // AliEMCALSDigitizer_H
69