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 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
65 fDecal[module][column][row] = calibda.fDecal[module][column][row];
71 //________________________________________________________________
72 AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
74 // assignment operator
76 if(this != &calibda) {
78 SetName(calibda.GetName());
79 SetTitle(calibda.GetName());
81 for(Int_t module=0; module<5; module++) {
82 for(Int_t column=0; column<56; column++) {
83 for(Int_t row=0; row<64; row++) {
84 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
85 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
86 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
87 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
88 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
89 fDecal[module][column][row] = calibda.fDecal[module][column][row];
98 //________________________________________________________________
99 AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
104 //________________________________________________________________
105 void AliPHOSEmcCalibData::Reset()
107 // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
109 for (Int_t module=0; module<5; module++){
110 for (Int_t column=0; column<56; column++){
111 for (Int_t row=0; row<64; row++){
112 fADCpedestalEmc[module][column][row] = 0.;
113 fADCchannelEmc[module][column][row] = 0.005;
114 fHighLowRatioEmc[module][column][row] = 16. ;
115 fTimeShiftEmc[module][column][row] = 0. ;
116 fAltroOffsets[module][column][row] = 0 ;
117 fDecal[module][column][row] = 1.;
121 fSampleTimeStep=100.e-9 ; //100 ns
124 //________________________________________________________________
125 void AliPHOSEmcCalibData::Print(Option_t *option) const
127 // Print tables of pedestals and ADC channels
129 if (strstr(option,"ped")) {
130 printf("\n ---- EMC Pedestal values ----\n\n");
131 for (Int_t module=0; module<5; module++){
132 printf("============== Module %d\n",module+1);
133 for (Int_t column=0; column<56; column++){
134 for (Int_t row=0; row<64; row++){
135 printf("%4.1f",fADCpedestalEmc[module][column][row]);
142 if (strstr(option,"gain")) {
143 printf("\n ---- EMC ADC channel values ----\n\n");
144 for (Int_t module=0; module<5; module++){
145 printf("============== Module %d\n",module+1);
146 for (Int_t column=0; column<56; column++){
147 for (Int_t row=0; row<64; row++){
148 printf("%4.1f",fADCchannelEmc[module][column][row]);
155 if (strstr(option,"hilo")) {
156 printf("\n ---- EMC High/Low ratio ----\n\n");
157 for (Int_t module=0; module<5; module++){
158 printf("============== Module %d\n",module+1);
159 for (Int_t column=0; column<56; column++){
160 for (Int_t row=0; row<64; row++){
161 printf("%4.1f",fHighLowRatioEmc[module][column][row]);
167 if (strstr(option,"time")) {
168 printf("\n ---- EMC t0 shifts ----\n\n");
169 for (Int_t module=0; module<5; module++){
170 printf("============== Module %d\n",module+1);
171 for (Int_t column=0; column<56; column++){
172 for (Int_t row=0; row<64; row++){
173 printf("%6.3e",fTimeShiftEmc[module][column][row]);
179 if (strstr(option,"altro")) {
180 printf("\n ---- EMC altro offsets ----\n\n");
181 for (Int_t module=0; module<5; module++){
182 printf("============== Module %d\n",module+1);
183 for (Int_t column=0; column<56; column++){
184 for (Int_t row=0; row<64; row++){
185 printf("%5d",fAltroOffsets[module][column][row]);
193 //________________________________________________________________
194 Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
196 //Return EMC calibration coefficient
197 //module, column,raw should follow the internal PHOS convention:
198 //module 1:5, column 1:56, row 1:64
200 return fADCchannelEmc[module-1][column-1][row-1];
203 //________________________________________________________________
204 Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
206 //Return EMC pedestal
207 //module, column,raw should follow the internal PHOS convention:
208 //module 1:5, column 1:56, row 1:64
210 return fADCpedestalEmc[module-1][column-1][row-1];
213 //________________________________________________________________
214 Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
216 //Return EMC pedestal
217 //module, column,raw should follow the internal PHOS convention:
218 //module 1:5, column 1:56, row 1:64
220 return fHighLowRatioEmc[module-1][column-1][row-1];
223 //________________________________________________________________
224 Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
226 //Return EMC pedestal
227 //module, column,raw should follow the internal PHOS convention:
228 //module 1:5, column 1:56, row 1:64
230 return fTimeShiftEmc[module-1][column-1][row-1];
232 //________________________________________________________________
233 Float_t AliPHOSEmcCalibData::GetSampleTimeStep()const
235 //Returns conversion coefficient from ALTRO smaple time step and secods
236 //Negative value not used in reconstruction (conversion taken from TRU trailer)
237 //and only in raw simulation
238 return fSampleTimeStep ;
240 //________________________________________________________________
241 Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const
243 //Return EMC altro offsets
244 //module, column,raw should follow the internal PHOS convention:
245 //module 1:5, column 1:56, row 1:64
247 return fAltroOffsets[module-1][column-1][row-1];
249 //________________________________________________________________
250 void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
252 //Set EMC calibration coefficient
253 //module, column,raw should follow the internal PHOS convention:
254 //module 1:5, column 1:56, row 1:64
256 fADCchannelEmc[module-1][column-1][row-1] = value;
259 //________________________________________________________________
260 void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
263 //module, column,raw should follow the internal PHOS convention:
264 //module 1:5, column 1:56, row 1:64
265 fADCpedestalEmc[module-1][column-1][row-1] = value;
268 //________________________________________________________________
269 void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
272 //module, column,raw should follow the internal PHOS convention:
273 //module 1:5, column 1:56, row 1:64
274 fHighLowRatioEmc[module-1][column-1][row-1] = value;
276 //________________________________________________________________
277 void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
280 //module, column,raw should follow the internal PHOS convention:
281 //module 1:5, column 1:56, row 1:64
282 fTimeShiftEmc[module-1][column-1][row-1] = value;
284 //________________________________________________________________
285 void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value)
288 //module, column,raw should follow the internal PHOS convention:
289 //module 1:5, column 1:56, row 1:64
290 fAltroOffsets[module-1][column-1][row-1] = value;
292 //________________________________________________________________
293 void AliPHOSEmcCalibData::SetSampleTimeStep(Float_t step)
295 //Sets conversion coefficient from ALTRO smaple time step and secods
296 //Negative value not used in reconstruction (conversion taken from TRU trailer)
297 //and only in raw simulation
298 fSampleTimeStep = step ;
301 //________________________________________________________________
302 Float_t AliPHOSEmcCalibData::GetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row) const
304 //Return EMC random (de)calibration coefficient O(1). Used in simulation.
305 //module, column,raw should follow the internal PHOS convention:
306 //module 1:5, column 1:56, row 1:64
308 return fDecal[module-1][column-1][row-1];
311 void AliPHOSEmcCalibData::SetADCchannelEmcDecalib(Int_t module, Int_t column, Int_t row, Float_t value)
313 //Set EMC (de)calibration coefficient O(1). Used in simulation.
314 //module, column,raw should follow the internal PHOS convention:
315 //module 1:5, column 1:56, row 1:64
317 fDecal[module-1][column-1][row-1] = value;