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 **************************************************************************/
18 //_________________________________________________________________________
19 ///*-- Author: Yves Schutz (SUBATECH)
20 // : Aleksei Pavlinov (WSU); Jun 30, 2006 - ALICE numbering scheme
21 // : Add decalibration and time calibration arrays: Jul 21, 2011 (GCB)
22 // : adapted for DCAL by M.L. Wang CCNU & Subatech Oct-18-2012
23 ///////////////////////////////////////////////////////////////////////////////
25 // class for EMCAL calibration //
27 ///////////////////////////////////////////////////////////////////////////////
31 #include "AliEMCALCalibData.h"
33 ClassImp(AliEMCALCalibData)
35 //__________________________________________________________
36 AliEMCALCalibData::AliEMCALCalibData() :
37 TNamed(), fADCchannelRef(0)
39 // Default constructor
43 //________________________________________________________________________
44 AliEMCALCalibData::AliEMCALCalibData(const char* name) :
45 TNamed(name,name),fADCchannelRef(0)
51 //______________________________________________________________________
52 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
53 TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
56 SetName (calibda.GetName());
57 SetTitle(calibda.GetName());
60 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
61 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
62 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
64 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
65 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
66 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
67 // in reality they are 1/3 but leave them as 1/2
69 if(supermodule /2 == 5)
71 if(supermodule > 11 && supermodule < 18)
74 for(Int_t column = 0; column<nCol; column++) {
76 for(Int_t row = 0; row<nRow; row++) {
78 fADCchannel[supermodule][column][row] =
79 calibda.GetADCchannel(supermodule,column,row);
81 fADCchannelOnline[supermodule][column][row] =
82 calibda.GetADCchannelOnline(supermodule,column,row);
84 fADCchannelDecal[supermodule][column][row] =
85 calibda.GetADCchannelDecal(supermodule,column,row);
87 fADCpedestal[supermodule][column][row] =
88 calibda.GetADCpedestal(supermodule,column,row);
90 fTimeChannelDecal[supermodule][column][row] =
91 calibda.GetTimeChannelDecal(supermodule,column,row);
93 for(Int_t bc = 0; bc < 4; bc++)
94 fTimeChannel[supermodule][column][row][bc] =
95 calibda.GetTimeChannel(supermodule,column,row,bc);
102 //________________________________________________________________
103 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
105 // assignment operator
106 SetName (calibda.GetName());
107 SetTitle(calibda.GetName());
110 fADCchannelRef = calibda.GetADCchannelRef() ;
112 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
113 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
114 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
116 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
117 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
118 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
119 // in reality they are 1/3 but leave them as 1/2
121 if(supermodule /2 == 5)
123 if(supermodule > 11 && supermodule < 18)
126 for(Int_t column = 0; column<nCol; column++) {
128 for(Int_t row = 0; row<nRow; row++) {
130 fADCchannel[supermodule][column][row] =
131 calibda.GetADCchannel(supermodule,column,row);
133 fADCchannelOnline[supermodule][column][row] =
134 calibda.GetADCchannelOnline(supermodule,column,row);
136 fADCchannelDecal[supermodule][column][row] =
137 calibda.GetADCchannelDecal(supermodule,column,row);
139 fADCpedestal[supermodule][column][row] =
140 calibda.GetADCpedestal(supermodule,column,row);
142 fTimeChannelDecal[supermodule][column][row] =
143 calibda.GetTimeChannelDecal(supermodule,column,row);
145 for(Int_t bc = 0; bc < 4; bc++)
146 fTimeChannel[supermodule][column][row][bc] =
147 calibda.GetTimeChannel(supermodule,column,row,bc);
156 //_____________________________
157 void AliEMCALCalibData::Reset()
159 // Set all pedestals to 0 and all ADC channels widths to 1
161 fADCchannelRef = 0.0162;
163 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
164 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
165 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
167 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
168 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
169 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
170 // in reality they are 1/3 but leave them as 1/2
172 if(supermodule /2 == 5)
174 if(supermodule > 11 && supermodule < 18)
177 for (Int_t column=0; column < nCol; column++){
179 for (Int_t row = 0; row < nRow; row++){
181 fADCpedestal [supermodule][column][row]=0.;
183 fADCchannelDecal [supermodule][column][row]=1.;
184 fADCchannel [supermodule][column][row]=fADCchannelRef;
185 fADCchannelOnline[supermodule][column][row]=fADCchannelRef;
187 fTimeChannelDecal[supermodule][column][row]=0.;
189 for(Int_t bc = 0; bc < 4; bc++)
190 fTimeChannel[supermodule][column][row][bc]=0;
197 //____________________________________________________
198 void AliEMCALCalibData::Print(Option_t *option) const
200 // Print tables of pedestals and ADC channels widths
201 // options are: "gain", "ped", "decal", "time", "all"
203 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
204 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
205 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
207 if (strstr(option,"ped") || strstr(option,"all")) {
208 printf("\n ---- Pedestal values ----\n\n");
209 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
210 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
211 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
212 // in reality they are 1/3 but leave them as 1/2
213 if(supermodule /2 == 5)
215 if(supermodule > 11 && supermodule < 18)
217 printf("============== Supermodule %d\n",supermodule+1);
218 for (Int_t column=0; column<nCol; column++){
219 for (Int_t row=0; row<nRow; row++){
220 printf("[c%d,r%d] %2.4f ",column, row, fADCpedestal[supermodule][column][row]);
227 if (strstr(option,"gain") || strstr(option,"all")) {
228 printf("\n ---- ADC channel values ----\n\n");
229 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
230 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
231 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
233 // in reality they are 1/3 but leave them as 1/2
234 if(supermodule /2 == 5)
236 if(supermodule > 11 && supermodule < 18)
238 printf("============== Supermodule %d\n",supermodule+1);
239 for (Int_t column=0; column<nCol; column++){
240 for (Int_t row=0; row<nRow; row++){
241 printf("[c%d,r%d] %2.4f ",column, row, fADCchannel[supermodule][column][row]);
248 if (strstr(option,"adconline") || strstr(option,"all")) {
249 printf("\n ---- ADC online channel values ----\n\n");
250 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
251 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
252 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
253 // in reality they are 1/3 but leave them as 1/2
254 if(supermodule /2 == 5)
256 if(supermodule > 11 && supermodule < 18)
258 printf("============== Supermodule %d\n",supermodule+1);
259 for (Int_t column=0; column<nCol; column++){
260 for (Int_t row=0; row<nRow; row++){
261 printf("[c%d,r%d] %2.4f ",column, row,fADCchannelOnline[supermodule][column][row]);
268 if (strstr(option,"adcdecal") || strstr(option,"all")) {
269 printf("\n ---- ADC decalibration channel values ----\n\n");
270 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
271 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
272 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
273 // in reality they are 1/3 but leave them as 1/2
274 if(supermodule /2 == 5)
276 if(supermodule > 11 && supermodule < 18)
278 printf("============== Supermodule %d\n",supermodule+1);
279 for (Int_t column=0; column<nCol; column++){
280 for (Int_t row=0; row<nRow; row++){
281 printf("[c%d,r%d] %2.4f ",column, row,fADCchannelDecal[supermodule][column][row]);
288 if (strstr(option,"time") || strstr(option,"all")) {
289 printf("\n ---- time channel values ----\n\n");
290 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
291 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
292 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
293 // in reality they are 1/3 but leave them as 1/2
294 if(supermodule /2 == 5)
296 if(supermodule > 11 && supermodule < 18)
298 printf("============== Supermodule %d\n",supermodule+1);
299 for (Int_t column=0; column<nCol; column++){
300 for (Int_t row=0; row<nRow; row++){
301 for(Int_t bc = 0; bc < 4; bc++)
302 printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
309 if (strstr(option,"time") || strstr(option,"all")) {
310 printf("\n ---- time decalibration channel values ----\n\n");
311 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
312 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
313 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
314 // in reality they are 1/3 but leave them as 1/2
315 if(supermodule /2 == 5)
317 if(supermodule > 11 && supermodule < 18)
319 printf("============== Supermodule %d\n",supermodule+1);
320 for (Int_t column=0; column<nCol; column++){
321 for (Int_t row=0; row<nRow; row++){
322 printf(" %2.4f ",fTimeChannelDecal[supermodule][column][row]);
330 //________________________________________________________________
331 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
333 // Set ADC channel witdth values
334 // All indexes start from 0!
335 // Supermodule, column,raw should follow the ALICE convention:
336 // supermodule 0:11, column 0:47, row 0:23
338 return fADCchannel[supermodule][column][row];
341 //________________________________________________________________
342 Float_t AliEMCALCalibData::GetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row) const
344 // Set ADC channel witdth values, first online calibration parameter
345 // All indexes start from 0!
346 // Supermodule, column,raw should follow the ALICE convention:
347 // supermodule 0:11, column 0:47, row 0:23
349 return fADCchannelOnline[supermodule][column][row];
352 //________________________________________________________________
353 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
355 // Set ADC channel decalibration witdth values
356 // All indexes start from 0!
357 // Supermodule, column,raw should follow the ALICE convention:
358 // supermodule 0:11, column 0:47, row 0:23
360 return fADCchannelDecal[supermodule][column][row];
363 //________________________________________________________________
364 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
366 // Get ADC pedestal values
367 return fADCpedestal[supermodule][column][row];
370 //________________________________________________________________
371 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
373 // Set channel time witdth values
374 return fTimeChannel[supermodule][column][row][bc];
377 //________________________________________________________________
378 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
380 // Set channel time witdth values
381 return fTimeChannelDecal[supermodule][column][row];
384 //________________________________________________________________
385 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
387 // Set ADC channel width values
388 fADCchannel[supermodule][column][row] = value;
391 //________________________________________________________________
392 void AliEMCALCalibData::SetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row, Float_t value)
394 // Set ADC channel online width values
395 fADCchannelOnline[supermodule][column][row] = value;
398 //________________________________________________________________
399 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
401 // Set ADC channel width values, decalibration
402 fADCchannelDecal[supermodule][column][row] = value;
405 //________________________________________________________________
406 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
408 // Set ADC pedestal values
409 fADCpedestal[supermodule][column][row] = value;
412 //________________________________________________________________
413 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
415 // Set ADC pedestal values
416 fTimeChannel[supermodule][column][row][bc] = value;
419 //________________________________________________________________
420 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
422 // Set ADC pedestal values
423 fTimeChannelDecal[supermodule][column][row] = value;