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 */
8 //_________________________________________________________________________
9 // Task Class for making SDigits in EMCAL
11 //*-- Author: Sahal Yacoob (LBL)
12 // based on : AliPHOSSDigitizer
13 //_________________________________________________________________________
16 // August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
17 // of new IO (à la PHOS)
19 // --- ROOT system ---
22 // --- Standard library ---
24 // --- AliRoot header files ---
26 class AliEMCALSDigitizer: public TTask {
29 AliEMCALSDigitizer() ; // ctor
30 AliEMCALSDigitizer(const char* headerFile,const char* hdigitsTitle = "Default", const Bool_t toSplit = kFALSE) ;
31 virtual ~AliEMCALSDigitizer() ; // dtor
33 Float_t Calibrate(Int_t amp)const {return (amp - fA)/fB ; }
34 Int_t Digitize(Float_t Energy)const { return (Int_t ) ( fA + Energy*fB); }
35 virtual void Exec(Option_t *option);
36 const char * GetSDigitsBranch()const{return GetName();}
37 const Int_t GetSDigitsInRun() const {return fSDigitsInRun ;}
38 const Float_t GetPedestalParameter()const {return fA;}
39 const Float_t GetCalibrationParameter()const{return fB;}
40 virtual void Print(Option_t* option) const ;
41 void SetSDigitsBranch(const char * title ) ;
42 void SetPedestalParameter(Float_t A){fA = A ;}
43 void SetSlopeParameter(Float_t B){fB = B ;}
44 void UseHitsFrom(const char * filename) ;
45 Bool_t operator == (const AliEMCALSDigitizer & sd) const ;
46 const Int_t Segment2TowerID(Int_t SegmentID){
47 return Layer2TowerID(SegmentID,kFALSE);
52 void InitParameters() ;
53 void PrintSDigits(Option_t * option) ;
54 const Int_t Layer2TowerID(Int_t,Bool_t) ;
57 Float_t fA ; // Pedestal parameter
58 Float_t fB ; // Slope Digitizition parameters
59 Float_t fPhotonElectronFactor ; // number of photon electrons per GeV
60 // should be calculated independently for each layer as :
61 // LightYield*LightCollectionEfficiency*LightAttenuation*APDPhotoElectronEfficiency*APDGain
62 Float_t fTowerPrimThreshold ; // To store primary in Tower if Elos > threshold
63 Float_t fPreShowerPrimThreshold ;// To store primary if Pre Shower Elos > threshold
64 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
65 Int_t fSDigitsInRun ; //! Total number of sdigits in one run
66 TFile * fSplitFile ; //! file in which SDigits will eventually be stored
67 Bool_t fToSplit ; //! Says that sigits should be written into splip file
69 ClassDef(AliEMCALSDigitizer,2) // description
73 #endif // AliEMCALSDigitizer_H