Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 :
16 : ///////////////////////////////////////////////////////////////////////////////
17 : // //
18 : // class for PHOS EmCal calibration //
19 : // //
20 : ///////////////////////////////////////////////////////////////////////////////
21 :
22 : #include "AliPHOSEmcCalibData.h"
23 :
24 22 : ClassImp(AliPHOSEmcCalibData)
25 :
26 : //________________________________________________________________
27 : AliPHOSEmcCalibData::AliPHOSEmcCalibData():
28 3 : TNamed(),
29 3 : fSampleTimeStep(0)
30 15 : {
31 : // Default constructor
32 3 : Reset();
33 6 : }
34 :
35 : //________________________________________________________________
36 : AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name):
37 0 : TNamed(),
38 0 : fSampleTimeStep(0)
39 0 : {
40 : // Constructor
41 0 : TString namst = "Calib_";
42 0 : namst += name;
43 0 : SetName(namst.Data());
44 0 : SetTitle(namst.Data());
45 0 : Reset();
46 0 : }
47 :
48 : //________________________________________________________________
49 : AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
50 0 : TNamed(calibda),
51 0 : fSampleTimeStep(calibda.fSampleTimeStep)
52 0 : {
53 : // copy constructor
54 0 : SetName(calibda.GetName());
55 0 : SetTitle(calibda.GetName());
56 :
57 0 : for(Int_t module=0; module<5; module++) {
58 0 : for(Int_t column=0; column<56; column++) {
59 0 : for(Int_t row=0; row<64; row++) {
60 0 : fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
61 0 : fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
62 0 : fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
63 0 : fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
64 0 : fLGTimeShiftEmc[module][column][row] = calibda.fLGTimeShiftEmc[module][column][row];
65 0 : fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
66 0 : fDecal[module][column][row] = calibda.fDecal[module][column][row];
67 : }
68 : }
69 : }
70 0 : }
71 :
72 : //________________________________________________________________
73 : AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
74 : {
75 : // assignment operator
76 :
77 0 : if(this != &calibda) {
78 :
79 0 : SetName(calibda.GetName());
80 0 : SetTitle(calibda.GetName());
81 :
82 0 : for(Int_t module=0; module<5; module++) {
83 0 : for(Int_t column=0; column<56; column++) {
84 0 : for(Int_t row=0; row<64; row++) {
85 0 : fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
86 0 : fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
87 0 : fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
88 0 : fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
89 0 : fLGTimeShiftEmc[module][column][row] = calibda.fLGTimeShiftEmc[module][column][row];
90 0 : fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
91 0 : fDecal[module][column][row] = calibda.fDecal[module][column][row];
92 : }
93 : }
94 : }
95 0 : }
96 :
97 0 : return *this;
98 : }
99 :
100 : //________________________________________________________________
101 : AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
102 0 : {
103 : // Destructor
104 0 : }
105 :
106 : //________________________________________________________________
107 : void AliPHOSEmcCalibData::Reset()
108 : {
109 : // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
110 :
111 39 : for (Int_t module=0; module<5; module++){
112 1710 : for (Int_t column=0; column<56; column++){
113 109200 : for (Int_t row=0; row<64; row++){
114 53760 : fADCpedestalEmc[module][column][row] = 0.;
115 53760 : fADCchannelEmc[module][column][row] = 0.005;
116 53760 : fHighLowRatioEmc[module][column][row] = 16. ;
117 53760 : fTimeShiftEmc[module][column][row] = 0. ;
118 53760 : fLGTimeShiftEmc[module][column][row] = 0. ;
119 53760 : fAltroOffsets[module][column][row] = 0 ;
120 53760 : fDecal[module][column][row] = 1.;
121 : }
122 : }
123 : }
124 3 : fSampleTimeStep=100.e-9 ; //100 ns
125 3 : }
126 :
127 : //________________________________________________________________
128 : void AliPHOSEmcCalibData::Print(Option_t *option) const
129 : {
130 : // Print tables of pedestals and ADC channels
131 :
132 0 : if (strstr(option,"ped")) {
133 0 : printf("\n ---- EMC Pedestal values ----\n\n");
134 0 : for (Int_t module=0; module<5; module++){
135 0 : printf("============== Module %d\n",module+1);
136 0 : for (Int_t column=0; column<56; column++){
137 0 : for (Int_t row=0; row<64; row++){
138 0 : printf("%4.1f",fADCpedestalEmc[module][column][row]);
139 : }
140 0 : printf("\n");
141 : }
142 : }
143 0 : }
144 :
145 0 : if (strstr(option,"gain")) {
146 0 : printf("\n ---- EMC ADC channel values ----\n\n");
147 0 : for (Int_t module=0; module<5; module++){
148 0 : printf("============== Module %d\n",module+1);
149 0 : for (Int_t column=0; column<56; column++){
150 0 : for (Int_t row=0; row<64; row++){
151 0 : printf("%4.1f",fADCchannelEmc[module][column][row]);
152 : }
153 0 : printf("\n");
154 : }
155 : }
156 0 : }
157 :
158 0 : if (strstr(option,"hilo")) {
159 0 : printf("\n ---- EMC High/Low ratio ----\n\n");
160 0 : for (Int_t module=0; module<5; module++){
161 0 : printf("============== Module %d\n",module+1);
162 0 : for (Int_t column=0; column<56; column++){
163 0 : for (Int_t row=0; row<64; row++){
164 0 : printf("%4.1f",fHighLowRatioEmc[module][column][row]);
165 : }
166 0 : printf("\n");
167 : }
168 : }
169 0 : }
170 0 : if (strstr(option,"time")) {
171 0 : printf("\n ---- EMC t0 shifts ----\n\n");
172 0 : for (Int_t module=0; module<5; module++){
173 0 : printf("============== Module %d\n",module+1);
174 0 : for (Int_t column=0; column<56; column++){
175 0 : for (Int_t row=0; row<64; row++){
176 0 : printf("%6.3e (%6.3e)",fTimeShiftEmc[module][column][row],fLGTimeShiftEmc[module][column][row]);
177 : }
178 0 : printf("\n");
179 : }
180 : }
181 0 : }
182 0 : if (strstr(option,"altro")) {
183 0 : printf("\n ---- EMC altro offsets ----\n\n");
184 0 : for (Int_t module=0; module<5; module++){
185 0 : printf("============== Module %d\n",module+1);
186 0 : for (Int_t column=0; column<56; column++){
187 0 : for (Int_t row=0; row<64; row++){
188 0 : printf("%5d",fAltroOffsets[module][column][row]);
189 : }
190 0 : printf("\n");
191 : }
192 : }
193 0 : }
194 0 : }
195 :
196 : //________________________________________________________________
197 : Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
198 : {
199 : //Return EMC calibration coefficient
200 : //module, column,raw should follow the internal PHOS convention:
201 : //module 1:5, column 1:56, row 1:64
202 :
203 88080 : return fADCchannelEmc[module-1][column-1][row-1];
204 : }
205 :
206 : //________________________________________________________________
207 : Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
208 : {
209 : //Return EMC pedestal
210 : //module, column,raw should follow the internal PHOS convention:
211 : //module 1:5, column 1:56, row 1:64
212 :
213 308 : return fADCpedestalEmc[module-1][column-1][row-1];
214 : }
215 :
216 : //________________________________________________________________
217 : Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
218 : {
219 : //Return EMC pedestal
220 : //module, column,raw should follow the internal PHOS convention:
221 : //module 1:5, column 1:56, row 1:64
222 :
223 254 : return fHighLowRatioEmc[module-1][column-1][row-1];
224 : }
225 :
226 : //________________________________________________________________
227 : Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
228 : {
229 : //Return EMC time offset for high gain channel
230 : //module, column,raw should follow the internal PHOS convention:
231 : //module 1:5, column 1:56, row 1:64
232 :
233 86740 : return fTimeShiftEmc[module-1][column-1][row-1];
234 : }
235 : //________________________________________________________________
236 : Float_t AliPHOSEmcCalibData::GetLGTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
237 : {
238 : //Return EMC time offset for LowGain channel
239 : //module, column,raw should follow the internal PHOS convention:
240 : //module 1:5, column 1:56, row 1:64
241 :
242 40 : return fLGTimeShiftEmc[module-1][column-1][row-1];
243 : }
244 : //________________________________________________________________
245 : Float_t AliPHOSEmcCalibData::GetSampleTimeStep()const
246 : {
247 : //Returns conversion coefficient from ALTRO smaple time step and secods
248 : //Negative value not used in reconstruction (conversion taken from TRU trailer)
249 : //and only in raw simulation
250 24 : return fSampleTimeStep ;
251 : }
252 : //________________________________________________________________
253 : Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const
254 : {
255 : //Return EMC altro offsets
256 : //module, column,raw should follow the internal PHOS convention:
257 : //module 1:5, column 1:56, row 1:64
258 :
259 308 : return fAltroOffsets[module-1][column-1][row-1];
260 : }
261 : //________________________________________________________________
262 : void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
263 : {
264 : //Set EMC calibration coefficient
265 : //module, column,raw should follow the internal PHOS convention:
266 : //module 1:5, column 1:56, row 1:64
267 :
268 0 : fADCchannelEmc[module-1][column-1][row-1] = value;
269 0 : }
270 :
271 : //________________________________________________________________
272 : void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
273 : {
274 : //Set EMC pedestal
275 : //module, column,raw should follow the internal PHOS convention:
276 : //module 1:5, column 1:56, row 1:64
277 0 : fADCpedestalEmc[module-1][column-1][row-1] = value;
278 0 : }
279 :
280 : //________________________________________________________________
281 : void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
282 : {
283 : //Set EMC pedestal
284 : //module, column,raw should follow the internal PHOS convention:
285 : //module 1:5, column 1:56, row 1:64
286 0 : fHighLowRatioEmc[module-1][column-1][row-1] = value;
287 0 : }
288 : //________________________________________________________________
289 : void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
290 : {
291 : //Set EMC time offset for high gain channel
292 : //module, column,raw should follow the internal PHOS convention:
293 : //module 1:5, column 1:56, row 1:64
294 0 : fTimeShiftEmc[module-1][column-1][row-1] = value;
295 0 : }
296 : //________________________________________________________________
297 : void AliPHOSEmcCalibData::SetLGTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
298 : {
299 : //Set EMC time offset for low gain channel
300 : //module, column,raw should follow the internal PHOS convention:
301 : //module 1:5, column 1:56, row 1:64
302 0 : fLGTimeShiftEmc[module-1][column-1][row-1] = value;
303 0 : }
304 : //________________________________________________________________
305 : void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value)
306 : {
307 : //Set EMC pedestal
308 : //module, column,raw should follow the internal PHOS convention:
309 : //module 1:5, column 1:56, row 1:64
310 0 : fAltroOffsets[module-1][column-1][row-1] = value;
311 0 : }
312 : //________________________________________________________________
313 : void AliPHOSEmcCalibData::SetSampleTimeStep(Float_t step)
314 : {
315 : //Sets conversion coefficient from ALTRO smaple time step and secods
316 : //Negative value not used in reconstruction (conversion taken from TRU trailer)
317 : //and only in raw simulation
318 0 : fSampleTimeStep = step ;
319 0 : }
320 :
321 : //________________________________________________________________
322 : Float_t AliPHOSEmcCalibData::GetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row) const
323 : {
324 : //Return EMC random (de)calibration coefficient O(1). Used in simulation.
325 : //module, column,raw should follow the internal PHOS convention:
326 : //module 1:5, column 1:56, row 1:64
327 :
328 86016 : return fDecal[module-1][column-1][row-1];
329 : }
330 :
331 : void AliPHOSEmcCalibData::SetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row, Float_t value)
332 : {
333 : //Set EMC (de)calibration coefficient O(1). Used in simulation.
334 : //module, column,raw should follow the internal PHOS convention:
335 : //module 1:5, column 1:56, row 1:64
336 :
337 0 : fDecal[module-1][column-1][row-1] = value;
338 0 : }
|