]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALDigitizer.h
Fix coverity defect (Jochen)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigitizer.h
1 #ifndef ALIEMCALDIGITIZER_H
2 #define ALIEMCALDIGITIZER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 // Class that performs digitization of Summable digits from simulated data
10 //  
11 // In addition it performs mixing of summable digits from different events.
12 //
13 // For each event two branches are created in TreeD:
14 //   "EMCAL" - list of digits
15 //   "AliEMCALDigitizer" - AliEMCALDigitizer with all parameters used in digitization
16 //
17 // Note, that one cset title for new digits branch, and repeat digitization with
18 // another set of parameters.
19 //
20 //*-- Author: Sahal Yacoob (LBL)
21 // based on : AliPHOSDigit
22 // July     2003 Yves Schutz : NewIO 
23 // November 2003 Aleksei Pavlinov : Shish-Kebab geometry 
24 //_________________________________________________________________________ 
25
26
27 // --- ROOT system ---
28 class TClonesArray ; 
29 class TBrowser;
30
31 // --- Standard library ---
32
33 // --- AliRoot header files ---
34 #include "AliDigitizer.h"
35 #include "AliConfig.h"
36 class AliEMCALCalibData ;
37 class AliEMCALSDigitizer ;
38 class AliRunDigitizer ;
39
40 class AliEMCALDigitizer: public AliDigitizer {
41
42 public:
43   AliEMCALDigitizer() ;          // ctor
44   AliEMCALDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;  
45   AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ;
46   AliEMCALDigitizer(AliRunDigitizer * manager) ;
47   virtual ~AliEMCALDigitizer() ;       
48
49   void    Digitize(Int_t event);          // Make Digits from SDigits stored in fSDigits
50   void    Exec(Option_t *option);               // Supervising method
51
52   Int_t    GetDigitThreshold() const { return fDigitThreshold;}
53   Float_t  GetPinNoise()       const { return fPinNoise;}
54   Float_t GetTimeResolution(const Float_t energy) const;
55   Double_t GetTimeResolutionPar0() const { return fTimeResolutionPar0 ; }
56   Double_t GetTimeResolutionPar1() const { return fTimeResolutionPar1 ; }
57   Double_t GetTimeDelay()      const { return fTimeDelay ; }
58   Float_t  GetECAchannel()     const { return fADCchannelEC ; }
59   Float_t  GetECApedestal()    const { return fADCpedestalEC ; }
60   void     SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
61   void     SetDigitThreshold(Int_t EMCThreshold)  {fDigitThreshold = EMCThreshold;}
62   void     SetPinNoise(Float_t PinNoise )         {fPinNoise = PinNoise;}
63
64   //General
65   Int_t GetDigitsInRun()  const { return fDigitsInRun; } 
66   void  MixWith(TString alirunFileName, 
67                 TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; // Add another one file to mix
68   void  Print(Option_t* option="") const ;
69   void  Print1(Option_t * option); // *MENU*
70  
71   AliEMCALDigitizer & operator = (const AliEMCALDigitizer & /*rvalue*/)  {
72     // assignement operator requested by coding convention but not needed
73    Fatal("operator =", "not implemented") ;  
74    return *this ; 
75   }
76
77   virtual void Browse(TBrowser* b);
78
79 private:
80
81   Bool_t  Init();                   
82   void    InitParameters() ; 
83   void    PrintDigits(Option_t * option) ;
84   void    Unload() ; 
85   void    WriteDigits() ;         // Writes Digits the current event
86   void    WriteDigits(TClonesArray* digits, const char* branchName = "EMTRG"); //
87   Float_t TimeOfNoise(void) ;     // Calculate time signal generated by noise
88
89   //Calculate the time of crossing of the threshold by front edge
90   //Float_t FrontEdgeTime(TClonesArray * ticks) ;
91         
92   Float_t DigitizeEnergy(Float_t energy, Int_t AbsId) ;
93   void    Digits2FastOR(TClonesArray*digitsTMP, TClonesArray* digitsTRG);
94   void    DigitalFastOR(Double_t time, Double_t dE, Int_t timeSamples[], Int_t nSamples);
95         
96         
97 private:
98   
99   Bool_t  fDefaultInit;           //! Says if the task was created by defaut ctor (only parameters are initialized)
100   Int_t   fDigitsInRun ;          //! Total number of digits in one run
101   Bool_t  fInit ;                 //! To avoid overwriting existing files
102
103   Int_t   fInput ;                // Number of files to merge
104   TString * fInputFileNames ;     //[fInput] List of file names to merge 
105   TString * fEventNames ;         //[fInput] List of event names to merge
106
107   Int_t    fDigitThreshold  ;     // Threshold for storing digits in EMC, ACD units
108   Int_t    fMeanPhotonElectron ;  // number of photon electrons per GeV deposited energy 
109   Float_t  fPinNoise ;            // Electronics noise in EMC
110   Double_t fTimeDelay;            // Time delay to reproduce data delay
111   Double_t fTimeResolutionPar0 ;  // Time resolution of FEE electronics
112   Double_t fTimeResolutionPar1 ;  // Time resolution of FEE electronics
113   Float_t fADCchannelEC ;         // width of one ADC channel in EC section (GeV)
114   Float_t fADCpedestalEC ;        // pedestal for one ADC channel
115   Int_t   fNADCEC ;               // number of channels in EC section ADC
116
117   TString  fEventFolderName;      // skowron: name of EFN to read data from in stand alone mode
118   Int_t    fFirstEvent;           // first event to process
119   Int_t    fLastEvent;            // last  event to process
120         
121   AliEMCALCalibData * fCalibData; //Calibration data pointer
122
123   ClassDef(AliEMCALDigitizer,10)  // description 
124 };
125
126
127 #endif // AliEMCALDIGITIZER_H