SensorThickness was defined twice. Set inner chip thickness to 250mum to bypass bug...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigitizer.h
CommitLineData
a435f763 1#ifndef ALIEMCALDIGITIZER_H
2#define ALIEMCALDIGITIZER_H
61e0abb5 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//_________________________________________________________________________
a435f763 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
61d80ce0 15// "EMCALTRG" - list of trigger digits
a435f763 16// "AliEMCALDigitizer" - AliEMCALDigitizer with all parameters used in digitization
17//
ffa6d63b 18//*-- Author: Sahal Yacoob (LBL)
19// based on : AliPHOSDigit
1963b290 20// July 2003 Yves Schutz : NewIO
21// November 2003 Aleksei Pavlinov : Shish-Kebab geometry
61d80ce0 22//
23// July 2011 GCB: Digitizer modified to accomodate embedding.
24// Time calibration added. Decalibration possibility of energy and time added
ffa6d63b 25//_________________________________________________________________________
61e0abb5 26
27
28// --- ROOT system ---
05a92d59 29class TClonesArray ;
1963b290 30class TBrowser;
05a92d59 31
61e0abb5 32// --- Standard library ---
33
34// --- AliRoot header files ---
814ad4bf 35#include "AliDigitizer.h"
88cb7938 36#include "AliConfig.h"
a435f763 37class AliEMCALCalibData ;
05a92d59 38class AliEMCALSDigitizer ;
f21fc003 39class AliDigitizationInput ;
61e0abb5 40
814ad4bf 41class AliEMCALDigitizer: public AliDigitizer {
61e0abb5 42
43public:
6cc75819 44 AliEMCALDigitizer() ; // ctor
45 AliEMCALDigitizer(TString alirunFileNameFile,
46 TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
88cb7938 47 AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ;
f21fc003 48 AliEMCALDigitizer(AliDigitizationInput * manager) ;
61e0abb5 49 virtual ~AliEMCALDigitizer() ;
50
6cc75819 51 void Digitize(Int_t event); // Make Digits from SDigits stored in fSDigits
f21fc003 52 void Digitize(Option_t *option); // Supervising method
61e0abb5 53
6cc75819 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;
a2f8e711 58 Double_t GetTimeResolutionPar0() const { return fTimeResolutionPar0 ; }
59 Double_t GetTimeResolutionPar1() const { return fTimeResolutionPar1 ; }
6cc75819 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 ; }
61e0abb5 69
05a92d59 70 //General
6cc75819 71 Int_t GetDigitsInRun() const { return fDigitsInRun; }
72 void Print (Option_t * option = "") const ;
73 void Print1(Option_t * option) ; // *MENU*
74
75
9c0a4862 76 AliEMCALDigitizer & operator = (const AliEMCALDigitizer & /*rvalue*/) {
814ad4bf 77 // assignement operator requested by coding convention but not needed
9859bfc0 78 Fatal("operator =", "not implemented") ;
79 return *this ;
814ad4bf 80 }
81
61e0abb5 82private:
814ad4bf 83
6cc75819 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
6cc75819 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);
6337857a 97 void DecalibrateTrigger(AliEMCALDigit *digit);
6995e8b7 98 Bool_t IsDead(AliEMCALDigit *digit);
99 Bool_t IsDead(Int_t absId);
916f1e76 100
61e0abb5 101private:
814ad4bf 102
5fb45456 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
f0a6dc6f 129
5fb45456 130 AliEMCALCalibData * fCalibData; // Calibration data pointer
f21fc003 131 AliEMCALSDigitizer* fSDigitizer; // SDigitization object
5fb45456 132
133 ClassDef(AliEMCALDigitizer,13)
61e0abb5 134};
135
136
a435f763 137#endif // AliEMCALDIGITIZER_H