990119d6 |
1 | #ifndef ALIPHOSDigitizer_H |
2 | #define ALIPHOSDigitizer_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 | |
702ab87e |
8 | /* History of cvs commits: |
9 | * |
10 | * $Log$ |
877695e7 |
11 | * Revision 1.33 2005/05/28 14:19:04 schutz |
12 | * Compilation warnings fixed by T.P. |
13 | * |
702ab87e |
14 | */ |
15 | |
990119d6 |
16 | //_________________________________________________________________________ |
17 | // Task Class for making SDigits in PHOS |
baef0810 |
18 | // Class performs digitization of Summable digits (in the PHOS case this is just |
19 | // sum of contributions of all primary particles into given cell). |
20 | // In addition it performs mixing of summable digits from different events. |
990119d6 |
21 | // |
22 | //*-- Author: Dmitri Peressounko(SUBATECH & KI) |
23 | |
24 | |
25 | // --- ROOT system --- |
e957fea8 |
26 | //#include "TObjString.h" |
8cb3533f |
27 | class TArrayI ; |
fb43c866 |
28 | class TClonesArray ; |
29 | |
990119d6 |
30 | // --- Standard library --- |
31 | |
32 | // --- AliRoot header files --- |
3f81a70b |
33 | #include "AliDigitizer.h" |
990119d6 |
34 | class AliPHOSSDigitizer ; |
3f81a70b |
35 | class AliRunDigitizer ; |
8cb3533f |
36 | |
93aeb834 |
37 | class AliPHOSDigitizer: public AliDigitizer { |
990119d6 |
38 | |
39 | public: |
40 | AliPHOSDigitizer() ; // ctor |
e191bb57 |
41 | AliPHOSDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; |
88cb7938 |
42 | AliPHOSDigitizer(const AliPHOSDigitizer & dtizer) ; |
43 | AliPHOSDigitizer(AliRunDigitizer * manager) ; |
990119d6 |
44 | virtual ~AliPHOSDigitizer() ; |
8cb3533f |
45 | |
fc7e2f43 |
46 | void Digitize(Int_t event) ; // Make Digits from SDigits |
3758d9fc |
47 | void Exec(Option_t *option); // Supervising method |
8cb3533f |
48 | |
3758d9fc |
49 | //CPV parameters |
fc7e2f43 |
50 | Float_t GetCPVNoise() const { return fCPVNoise ;} |
51 | Float_t GetCPVThreshold() const { return fCPVDigitThreshold ;} |
52 | Float_t GetCPVchannel() const { return fADCchanelCpv; } |
53 | Float_t GetCPVpedestal() const { return fADCpedestalCpv; } |
3758d9fc |
54 | |
55 | void SetCPVNoise(Float_t CPVNoise) {fCPVNoise = CPVNoise;} |
56 | void SetCPVThreshold(Float_t CPVThreshold) {fCPVDigitThreshold= CPVThreshold;} |
57 | void SetNCPVchannels(Int_t n) { fNADCcpv = n; } |
58 | void SetCPVchannel(Float_t width) { fADCchanelCpv = width; } |
59 | void SetCPVpedestal(Float_t ped) { fADCpedestalCpv = ped; } |
60 | |
61 | |
62 | //EMC parameters |
fc7e2f43 |
63 | Float_t GetEMCThreshold() const { return fEMCDigitThreshold;} |
64 | Float_t GetEMCchannel() const { return fADCchanelEmc; } |
65 | Float_t GetEMCpedestal() const { return fADCpedestalEmc; } |
66 | Float_t GetPinNoise() const { return fPinNoise;} |
67 | Float_t GetTimeResolution() const { return fTimeResolution ; } |
7b7c1533 |
68 | |
3758d9fc |
69 | void SetEMCThreshold(Float_t EMCThreshold) {fEMCDigitThreshold = EMCThreshold;} |
70 | void SetPinNoise(Float_t PinNoise ) {fPinNoise = PinNoise;} |
71 | void SetNEMCchannels(Int_t n) { fNADCemc = n; } |
72 | void SetEMCchannel(Float_t width) { fADCchanelEmc = width; } |
73 | void SetEMCpedestal(Float_t ped) { fADCpedestalEmc = ped ; } |
88cb7938 |
74 | void SetEventFolderName(TString name) { fEventFolderName = name ; } |
fbf811ec |
75 | void SetTimeResolution(Float_t res){ fTimeResolution = res ; } |
212d1c0f |
76 | void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; } |
3758d9fc |
77 | |
78 | //General |
fc7e2f43 |
79 | Int_t GetDigitsInRun() const { return fDigitsInRun ;} |
80 | void MixWith(TString alirunFileName, |
e191bb57 |
81 | TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; // Add another one file to mix |
702ab87e |
82 | |
83 | void Print(const Option_t * = "")const ; |
548f0134 |
84 | |
8c140292 |
85 | AliPHOSDigitizer & operator = (const AliPHOSDigitizer & /*rvalue*/) { |
baef0810 |
86 | // assignement operator requested by coding convention but not needed |
f1611b7c |
87 | Fatal("operator =", "not implemented") ; |
baef0810 |
88 | return *this ; |
89 | } |
90 | |
990119d6 |
91 | private: |
3758d9fc |
92 | |
88cb7938 |
93 | virtual Bool_t Init() ; |
8d0f3f77 |
94 | void InitParameters() ; |
8cb3533f |
95 | void PrintDigits(Option_t * option) ; |
88cb7938 |
96 | void Unload() ; |
90cceaf6 |
97 | void WriteDigits() ; // Writes Digits for the current event |
0bc3b8ed |
98 | Float_t TimeOfNoise(void) const; // Calculate time signal generated by noise |
88cb7938 |
99 | |
9688c1dd |
100 | //Calculate the time of crossing of the threshold by front edge |
0bc3b8ed |
101 | Float_t FrontEdgeTime(TClonesArray * ticks) const ; |
3758d9fc |
102 | //Calculate digitized signal with gived ADC parameters |
877695e7 |
103 | void DecalibrateEMC(AliPHOSDigit * digit); |
104 | Int_t DigitizeCPV(Float_t charge, Int_t absId) ; |
990119d6 |
105 | |
3758d9fc |
106 | private: |
8cb3533f |
107 | |
92f521a9 |
108 | Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) |
88cb7938 |
109 | Int_t fDigitsInRun ; //! Total number of digits in one run |
110 | Bool_t fInit ; //! To avoid overwriting existing files |
111 | |
112 | Int_t fInput ; // Number of files to merge |
113 | TString * fInputFileNames ; //[fInput] List of file names to merge |
114 | TString * fEventNames ; //[fInput] List of event names to merge |
548f0134 |
115 | |
9688c1dd |
116 | Int_t fEmcCrystals ; // Number of EMC crystalls in the given geometry |
3758d9fc |
117 | |
990119d6 |
118 | Float_t fPinNoise ; // Electronics noise in EMC |
119 | Float_t fEMCDigitThreshold ; // Threshold for storing digits in EMC |
3758d9fc |
120 | |
990119d6 |
121 | Float_t fCPVNoise ; // Noise in CPV |
122 | Float_t fCPVDigitThreshold ; // Threshold for storing digits in CPV |
3758d9fc |
123 | |
990119d6 |
124 | |
9688c1dd |
125 | Float_t fTimeResolution ; // Time resolution of FEE electronics |
9688c1dd |
126 | Float_t fTimeThreshold ; // Threshold to start timing for given crystall |
127 | Float_t fTimeSignalLength ; // Length of the timing signal |
128 | |
3758d9fc |
129 | Float_t fADCchanelEmc ; // width of one ADC channel in GeV |
0bc3b8ed |
130 | Float_t fADCpedestalEmc ; // value of the EMC ADC pedestal |
3758d9fc |
131 | Int_t fNADCemc ; // number of channels in EMC ADC |
132 | |
0bc3b8ed |
133 | Float_t fADCchanelCpv ; // width of one ADC channel in CPV units |
134 | Float_t fADCpedestalCpv ; // value of the CPV ADC pedestal in CPV units |
3758d9fc |
135 | Int_t fNADCcpv ; // number of channels in CPV ADC |
fbf811ec |
136 | |
88cb7938 |
137 | TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode |
212d1c0f |
138 | Int_t fFirstEvent; // first event to process |
139 | Int_t fLastEvent; // last event to process |
140 | |
141 | ClassDef(AliPHOSDigitizer,3) // description |
990119d6 |
142 | |
143 | }; |
144 | |
145 | |
146 | #endif // AliPHOSDigitizer_H |