Adaption to new fluka common blocks (E. Futo)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALSDigitizer.h
CommitLineData
61e0abb5 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 */
61e0abb5 5/* $Id$ */
61e0abb5 6//_________________________________________________________________________
7// Task Class for making SDigits in EMCAL
8//
ffa6d63b 9//*-- Author: Sahal Yacoob (LBL)
10// based on : AliPHOSSDigitizer
11//_________________________________________________________________________
05a92d59 12//
13// Modif:
14// August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
15// of new IO (à la PHOS)
16
61e0abb5 17// --- ROOT system ---
18#include "TTask.h"
19#include "TString.h"
20// --- Standard library ---
21
22// --- AliRoot header files ---
23
24class AliEMCALSDigitizer: public TTask {
25
26public:
27 AliEMCALSDigitizer() ; // ctor
05a92d59 28 AliEMCALSDigitizer(const char* headerFile,const char* hdigitsTitle = "Default", const Bool_t toSplit = kFALSE) ;
61e0abb5 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); }
61e0abb5 33 virtual void Exec(Option_t *option);
05a92d59 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 ;
62741b41 44// const Int_t Segment2TowerID(Int_t SegmentID){
45// return Layer2TowerID(SegmentID,0);
46// }
61e0abb5 47
48private:
49 void Init() ;
839828a6 50 void InitParameters() ;
61e0abb5 51 void PrintSDigits(Option_t * option) ;
106fc2fa 52
61e0abb5 53private:
05a92d59 54 Float_t fA ; // Pedestal parameter
55 Float_t fB ; // Slope Digitizition parameters
62741b41 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)
05a92d59 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
61e0abb5 63
62741b41 64 ClassDef(AliEMCALSDigitizer,4) // description
61e0abb5 65
66};
67
68#endif // AliEMCALSDigitizer_H
173558f2 69