1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // class for PHOS EmCal calibration //
20 ///////////////////////////////////////////////////////////////////////////////
22 #include "AliPHOSEmcCalibData.h"
24 ClassImp(AliPHOSEmcCalibData)
26 //________________________________________________________________
27 AliPHOSEmcCalibData::AliPHOSEmcCalibData():
31 // Default constructor
35 //________________________________________________________________
36 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name):
41 TString namst = "Calib_";
43 SetName(namst.Data());
44 SetTitle(namst.Data());
48 //________________________________________________________________
49 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
51 fSampleTimeStep(calibda.fSampleTimeStep)
54 SetName(calibda.GetName());
55 SetTitle(calibda.GetName());
57 for(Int_t module=0; module<5; module++) {
58 for(Int_t column=0; column<56; column++) {
59 for(Int_t row=0; row<64; row++) {
60 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
61 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
62 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
63 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
64 fLGTimeShiftEmc[module][column][row] = calibda.fLGTimeShiftEmc[module][column][row];
65 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
66 fDecal[module][column][row] = calibda.fDecal[module][column][row];
72 //________________________________________________________________
73 AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
75 // assignment operator
77 if(this != &calibda) {
79 SetName(calibda.GetName());
80 SetTitle(calibda.GetName());
82 for(Int_t module=0; module<5; module++) {
83 for(Int_t column=0; column<56; column++) {
84 for(Int_t row=0; row<64; row++) {
85 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
86 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
87 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
88 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
89 fLGTimeShiftEmc[module][column][row] = calibda.fLGTimeShiftEmc[module][column][row];
90 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
91 fDecal[module][column][row] = calibda.fDecal[module][column][row];
100 //________________________________________________________________
101 AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
106 //________________________________________________________________
107 void AliPHOSEmcCalibData::Reset()
109 // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
111 for (Int_t module=0; module<5; module++){
112 for (Int_t column=0; column<56; column++){
113 for (Int_t row=0; row<64; row++){
114 fADCpedestalEmc[module][column][row] = 0.;
115 fADCchannelEmc[module][column][row] = 0.005;
116 fHighLowRatioEmc[module][column][row] = 16. ;
117 fTimeShiftEmc[module][column][row] = 0. ;
118 fLGTimeShiftEmc[module][column][row] = 0. ;
119 fAltroOffsets[module][column][row] = 0 ;
120 fDecal[module][column][row] = 1.;
124 fSampleTimeStep=100.e-9 ; //100 ns
127 //________________________________________________________________
128 void AliPHOSEmcCalibData::Print(Option_t *option) const
130 // Print tables of pedestals and ADC channels
132 if (strstr(option,"ped")) {
133 printf("\n ---- EMC Pedestal values ----\n\n");
134 for (Int_t module=0; module<5; module++){
135 printf("============== Module %d\n",module+1);
136 for (Int_t column=0; column<56; column++){
137 for (Int_t row=0; row<64; row++){
138 printf("%4.1f",fADCpedestalEmc[module][column][row]);
145 if (strstr(option,"gain")) {
146 printf("\n ---- EMC ADC channel values ----\n\n");
147 for (Int_t module=0; module<5; module++){
148 printf("============== Module %d\n",module+1);
149 for (Int_t column=0; column<56; column++){
150 for (Int_t row=0; row<64; row++){
151 printf("%4.1f",fADCchannelEmc[module][column][row]);
158 if (strstr(option,"hilo")) {
159 printf("\n ---- EMC High/Low ratio ----\n\n");
160 for (Int_t module=0; module<5; module++){
161 printf("============== Module %d\n",module+1);
162 for (Int_t column=0; column<56; column++){
163 for (Int_t row=0; row<64; row++){
164 printf("%4.1f",fHighLowRatioEmc[module][column][row]);
170 if (strstr(option,"time")) {
171 printf("\n ---- EMC t0 shifts ----\n\n");
172 for (Int_t module=0; module<5; module++){
173 printf("============== Module %d\n",module+1);
174 for (Int_t column=0; column<56; column++){
175 for (Int_t row=0; row<64; row++){
176 printf("%6.3e (%6.3e)",fTimeShiftEmc[module][column][row],fLGTimeShiftEmc[module][column][row]);
182 if (strstr(option,"altro")) {
183 printf("\n ---- EMC altro offsets ----\n\n");
184 for (Int_t module=0; module<5; module++){
185 printf("============== Module %d\n",module+1);
186 for (Int_t column=0; column<56; column++){
187 for (Int_t row=0; row<64; row++){
188 printf("%5d",fAltroOffsets[module][column][row]);
196 //________________________________________________________________
197 Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
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
203 return fADCchannelEmc[module-1][column-1][row-1];
206 //________________________________________________________________
207 Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
209 //Return EMC pedestal
210 //module, column,raw should follow the internal PHOS convention:
211 //module 1:5, column 1:56, row 1:64
213 return fADCpedestalEmc[module-1][column-1][row-1];
216 //________________________________________________________________
217 Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
219 //Return EMC pedestal
220 //module, column,raw should follow the internal PHOS convention:
221 //module 1:5, column 1:56, row 1:64
223 return fHighLowRatioEmc[module-1][column-1][row-1];
226 //________________________________________________________________
227 Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
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
233 return fTimeShiftEmc[module-1][column-1][row-1];
235 //________________________________________________________________
236 Float_t AliPHOSEmcCalibData::GetLGTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
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
242 return fLGTimeShiftEmc[module-1][column-1][row-1];
244 //________________________________________________________________
245 Float_t AliPHOSEmcCalibData::GetSampleTimeStep()const
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 return fSampleTimeStep ;
252 //________________________________________________________________
253 Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const
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
259 return fAltroOffsets[module-1][column-1][row-1];
261 //________________________________________________________________
262 void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
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
268 fADCchannelEmc[module-1][column-1][row-1] = value;
271 //________________________________________________________________
272 void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
275 //module, column,raw should follow the internal PHOS convention:
276 //module 1:5, column 1:56, row 1:64
277 fADCpedestalEmc[module-1][column-1][row-1] = value;
280 //________________________________________________________________
281 void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
284 //module, column,raw should follow the internal PHOS convention:
285 //module 1:5, column 1:56, row 1:64
286 fHighLowRatioEmc[module-1][column-1][row-1] = value;
288 //________________________________________________________________
289 void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
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 fTimeShiftEmc[module-1][column-1][row-1] = value;
296 //________________________________________________________________
297 void AliPHOSEmcCalibData::SetLGTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
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 fLGTimeShiftEmc[module-1][column-1][row-1] = value;
304 //________________________________________________________________
305 void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value)
308 //module, column,raw should follow the internal PHOS convention:
309 //module 1:5, column 1:56, row 1:64
310 fAltroOffsets[module-1][column-1][row-1] = value;
312 //________________________________________________________________
313 void AliPHOSEmcCalibData::SetSampleTimeStep(Float_t step)
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 fSampleTimeStep = step ;
321 //________________________________________________________________
322 Float_t AliPHOSEmcCalibData::GetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row) const
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
328 return fDecal[module-1][column-1][row-1];
331 void AliPHOSEmcCalibData::SetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row, Float_t value)
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
337 fDecal[module-1][column-1][row-1] = value;