]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALDigitizer.h
Update to FindFASTJET.cmake; now accepts also for -DFASTJET= option
[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 //   "EMCALTRG" - list of trigger digits
16 //   "AliEMCALDigitizer" - AliEMCALDigitizer with all parameters used in digitization
17 //
18 //*-- Author: Sahal Yacoob (LBL)
19 // based on : AliPHOSDigit
20 // July     2003 Yves Schutz : NewIO 
21 // November 2003 Aleksei Pavlinov : Shish-Kebab geometry 
22 //
23 // July 2011 GCB: Digitizer modified to accomodate embedding. 
24 //                Time calibration added. Decalibration possibility of energy and time added
25 //_________________________________________________________________________ 
26
27
28 // --- ROOT system ---
29 class TClonesArray ; 
30 class TBrowser;
31
32 // --- Standard library ---
33
34 // --- AliRoot header files ---
35 #include "AliDigitizer.h"
36 #include "AliConfig.h"
37 class AliEMCALCalibData ;
38 class AliEMCALSDigitizer ;
39 class AliDigitizationInput ;
40
41 class AliEMCALDigitizer: public AliDigitizer {
42
43 public:
44   AliEMCALDigitizer() ;            // ctor
45   AliEMCALDigitizer(TString alirunFileNameFile, 
46                     TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;  
47   AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ;
48   AliEMCALDigitizer(AliDigitizationInput * manager) ;
49   virtual ~AliEMCALDigitizer() ;       
50
51   void     Digitize(Int_t event);   // Make Digits from SDigits stored in fSDigits
52   void     Digitize(Option_t *option);  // Supervising method
53
54   Int_t    GetDigitThreshold()     const { return fDigitThreshold     ; }
55   Float_t  GetPinNoise()           const { return fPinNoise           ; }
56   Float_t  GetTimeNoise()          const { return fTimeNoise          ; }  
57   Float_t  GetTimeResolution(const Float_t energy) const;
58   Double_t GetTimeResolutionPar0() const { return fTimeResolutionPar0 ; }
59   Double_t GetTimeResolutionPar1() const { return fTimeResolutionPar1 ; }
60   Double_t GetTimeDelay()          const { return fTimeDelay          ; }
61   Float_t  GetECAchannel()         const { return fADCchannelEC       ; }
62   Float_t  GetECApedestal()        const { return fADCpedestalEC      ; }
63   
64   void     SetEventRange(Int_t first=0, Int_t last=-1) { fFirstEvent     = first ; 
65                                                          fLastEvent      = last             ; }
66   void     SetDigitThreshold(Int_t EMCThreshold)       { fDigitThreshold = EMCThreshold     ; }
67   void     SetPinNoise(Float_t pinNoise )              { fPinNoise       = pinNoise         ; }
68   void     SetTimeNoise(Float_t timeNoise )            { fTimeNoise      = timeNoise        ; }
69
70   //General
71   Int_t    GetDigitsInRun()  const { return fDigitsInRun; } 
72   void     Print (Option_t * option = "") const ;
73   void     Print1(Option_t * option)            ; // *MENU*
74                    
75
76   AliEMCALDigitizer & operator = (const AliEMCALDigitizer & /*rvalue*/)  {
77     // assignement operator requested by coding convention but not needed
78    Fatal("operator =", "not implemented") ;  
79    return *this ; 
80   }
81
82 private:
83
84   Bool_t   Init();                   
85   void     InitParameters() ; 
86   void     PrintDigits(Option_t * option) ;
87   void     Unload() ; 
88   void     WriteDigits() ;         // Writes Digits the current event
89   void     WriteDigits(TClonesArray* digits, const char* branchName = "EMTRG"); //
90   Float_t  TimeOfNoise(void) ;     // Calculate time signal generated by noise
91   
92   void     CalibrateADCTime  (Float_t & adc ,   Float_t & time, const Int_t AbsId) ;
93   void     DigitizeEnergyTime(Float_t & energy, Float_t & time, const Int_t AbsId) ;
94
95   void     Digits2FastOR(TClonesArray*digitsTMP, TClonesArray* digitsTRG);
96   void     DigitalFastOR(Double_t time, Double_t dE, Int_t timeSamples[], Int_t nSamples);      
97   void     Decalibrate(AliEMCALDigit *digit);
98   Bool_t   IsDead(AliEMCALDigit *digit);
99   Bool_t   IsDead(Int_t absId);
100         
101 private:
102   
103   Bool_t   fDefaultInit;           //! Says if the task was created by defaut ctor (only parameters are initialized)
104   Int_t    fDigitsInRun ;          //! Total number of digits in one run
105   Bool_t   fInit ;                 //! To avoid overwriting existing files
106
107   Int_t    fInput ;                // Number of files to merge
108   TString *fInputFileNames ;       //[fInput] List of file names to merge 
109   TString *fEventNames ;           //[fInput] List of event names to merge
110
111   Int_t    fDigitThreshold  ;      // Threshold for storing digits in EMC, ACD units
112   Int_t    fMeanPhotonElectron ;   // number of photon electrons per GeV deposited energy 
113   Float_t  fGainFluctuations ;     // correct fMeanPhotonElectron by the gain fluctuations
114   Float_t  fPinNoise ;             // Electronics noise in EMC, APD
115   Double_t fTimeNoise;             // Electronics noise in EMC, time
116   Double_t fTimeDelay;             // Time delay to reproduce data delay
117   Double_t fTimeResolutionPar0 ;   // Time resolution of FEE electronics
118   Double_t fTimeResolutionPar1 ;   // Time resolution of FEE electronics
119   Float_t  fADCchannelEC ;         // calibration width of one ADC channel in EC section (GeV)
120   Float_t  fADCpedestalEC ;        // calibration pedestal for one ADC channel
121   Float_t  fADCchannelECDecal ;    // decalibration width of one ADC channel in EC section (GeV)
122   Float_t  fTimeChannel ;          // calibration time width for one channel  
123   Float_t  fTimeChannelDecal ;     // calibration time width for one channel  
124   Int_t    fNADCEC ;               // number of channels in EC section ADC
125
126   TString  fEventFolderName;       // skowron: name of EFN to read data from in stand alone mode
127   Int_t    fFirstEvent;            // first event to process
128   Int_t    fLastEvent;             // last  event to process
129         
130   AliEMCALCalibData * fCalibData;  // Calibration data pointer
131   AliEMCALSDigitizer* fSDigitizer; // SDigitization object
132   
133   ClassDef(AliEMCALDigitizer,13)  
134 };
135
136
137 #endif // AliEMCALDIGITIZER_H