BunchCrossing-based L1phase time offset correction added
[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 ;
39class AliRunDigitizer ;
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) ;
48 AliEMCALDigitizer(AliRunDigitizer * manager) ;
61e0abb5 49 virtual ~AliEMCALDigitizer() ;
50
6cc75819 51 void Digitize(Int_t event); // Make Digits from SDigits stored in fSDigits
52 void Exec(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);
916f1e76 97
61e0abb5 98private:
814ad4bf 99
6cc75819 100 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
101 Int_t fDigitsInRun ; //! Total number of digits in one run
102 Bool_t fInit ; //! To avoid overwriting existing files
88cb7938 103
6cc75819 104 Int_t fInput ; // Number of files to merge
105 TString *fInputFileNames ; //[fInput] List of file names to merge
106 TString *fEventNames ; //[fInput] List of event names to merge
88cb7938 107
f0a6dc6f 108 Int_t fDigitThreshold ; // Threshold for storing digits in EMC, ACD units
109 Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy
6cc75819 110 Float_t fPinNoise ; // Electronics noise in EMC, APD
111 Double_t fTimeNoise; // Electronics noise in EMC, time
f0a6dc6f 112 Double_t fTimeDelay; // Time delay to reproduce data delay
a2f8e711 113 Double_t fTimeResolutionPar0 ; // Time resolution of FEE electronics
114 Double_t fTimeResolutionPar1 ; // Time resolution of FEE electronics
6cc75819 115 Float_t fADCchannelEC ; // calibration width of one ADC channel in EC section (GeV)
116 Float_t fADCpedestalEC ; // calibration pedestal for one ADC channel
117 Float_t fADCchannelECDecal ; // decalibration width of one ADC channel in EC section (GeV)
118 Float_t fTimeChannel ; // calibration time width for one channel
119 Float_t fTimeChannelDecal ; // calibration time width for one channel
120 Int_t fNADCEC ; // number of channels in EC section ADC
a9485c37 121
f0a6dc6f 122 TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
123 Int_t fFirstEvent; // first event to process
124 Int_t fLastEvent; // last event to process
125
53f1c378 126 AliEMCALCalibData * fCalibData; //Calibration data pointer
88cb7938 127
6cc75819 128 ClassDef(AliEMCALDigitizer,11) // description
61e0abb5 129};
130
131
a435f763 132#endif // AliEMCALDIGITIZER_H