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 */
6 //_________________________________________________________________________
7 // Task Class for making SDigits in EMCAL
9 //*-- Author: Sahal Yacoob (LBL)
10 // based on : AliPHOSSDigitizer
11 //_________________________________________________________________________
14 // August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
15 // of new IO (à la PHOS)
17 // --- ROOT system ---
20 // --- Standard library ---
22 // --- AliRoot header files ---
24 class AliEMCALSDigitizer: public TTask {
27 AliEMCALSDigitizer() ; // ctor
28 AliEMCALSDigitizer(const char* headerFile,const char* hdigitsTitle = "Default", const Bool_t toSplit = kFALSE) ;
29 virtual ~AliEMCALSDigitizer() ; // dtor
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,kFALSE);
50 void InitParameters() ;
51 void PrintSDigits(Option_t * option) ;
52 const Int_t Layer2TowerID(Int_t,Bool_t) ;
55 Float_t fA ; // Pedestal parameter
56 Float_t fB ; // Slope Digitizition parameters
57 Float_t fPhotonElectronFactor ; // number of photon electrons per GeV
58 // should be calculated independently for each layer as :
59 // LightYield*LightCollectionEfficiency*LightAttenuation*APDPhotoElectronEfficiency*APDGain
60 Float_t fTowerPrimThreshold ; // To store primary in Tower if Elos > threshold
61 Float_t fPreShowerPrimThreshold ;// To store primary if Pre Shower Elos > threshold
62 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
63 Int_t fSDigitsInRun ; //! Total number of sdigits in one run
64 TFile * fSplitFile ; //! file in which SDigits will eventually be stored
65 Bool_t fToSplit ; //! Says that sigits should be written into splip file
67 ClassDef(AliEMCALSDigitizer,3) // description
71 #endif // AliEMCALSDigitizer_H