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 fADCchannelDecal[supermodule][column][row] =
82 calibda.GetADCchannelDecal(supermodule,column,row);
84 fADCpedestal[supermodule][column][row] =
85 calibda.GetADCpedestal(supermodule,column,row);
87 fTimeChannelDecal[supermodule][column][row] =
88 calibda.GetTimeChannelDecal(supermodule,column,row);
90 for(Int_t bc = 0; bc < 4; bc++)
91 fTimeChannel[supermodule][column][row][bc] =
92 calibda.GetTimeChannel(supermodule,column,row,bc);
99 //________________________________________________________________
100 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
102 // assignment operator
103 SetName (calibda.GetName());
104 SetTitle(calibda.GetName());
107 fADCchannelRef = calibda.GetADCchannelRef() ;
109 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
110 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
111 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
113 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
114 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
115 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
116 // in reality they are 1/3 but leave them as 1/2
118 if(supermodule /2 == 5)
120 if(supermodule > 11 && supermodule < 18)
123 for(Int_t column = 0; column<nCol; column++) {
125 for(Int_t row = 0; row<nRow; row++) {
127 fADCchannel[supermodule][column][row] =
128 calibda.GetADCchannel(supermodule,column,row);
130 fADCchannelDecal[supermodule][column][row] =
131 calibda.GetADCchannelDecal(supermodule,column,row);
133 fADCpedestal[supermodule][column][row] =
134 calibda.GetADCpedestal(supermodule,column,row);
136 fTimeChannelDecal[supermodule][column][row] =
137 calibda.GetTimeChannelDecal(supermodule,column,row);
139 for(Int_t bc = 0; bc < 4; bc++)
140 fTimeChannel[supermodule][column][row][bc] =
141 calibda.GetTimeChannel(supermodule,column,row,bc);
150 //_____________________________
151 void AliEMCALCalibData::Reset()
153 // Set all pedestals to 0 and all ADC channels widths to 1
155 fADCchannelRef = 0.0162;
157 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
158 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
159 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
161 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
162 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
163 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
164 // in reality they are 1/3 but leave them as 1/2
166 if(supermodule /2 == 5)
168 if(supermodule > 11 && supermodule < 18)
171 for (Int_t column=0; column < nCol; column++){
173 for (Int_t row = 0; row < nRow; row++){
175 fADCpedestal [supermodule][column][row]=0.;
177 fADCchannelDecal [supermodule][column][row]=1.;
178 fADCchannel [supermodule][column][row]=1.;
180 fTimeChannelDecal[supermodule][column][row]=0.;
182 for(Int_t bc = 0; bc < 4; bc++)
183 fTimeChannel[supermodule][column][row][bc]=0;
190 //____________________________________________________
191 void AliEMCALCalibData::Print(Option_t *option) const
193 // Print tables of pedestals and ADC channels widths
194 // options are: "gain", "ped", "decal", "time", "all"
196 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
197 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
198 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
200 if (strstr(option,"ped") || strstr(option,"all")) {
201 printf("\n ---- Pedestal values ----\n\n");
202 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
203 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
204 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
205 // in reality they are 1/3 but leave them as 1/2
206 if(supermodule /2 == 5)
208 if(supermodule > 11 && supermodule < 18)
210 printf("============== Supermodule %d\n",supermodule+1);
211 for (Int_t column=0; column<nCol; column++){
212 for (Int_t row=0; row<nRow; row++){
213 printf(" %2.4f ",fADCpedestal[supermodule][column][row]);
220 if (strstr(option,"gain") || strstr(option,"all")) {
221 printf("\n ---- ADC channel values ----\n\n");
222 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
223 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
224 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
226 // in reality they are 1/3 but leave them as 1/2
227 if(supermodule /2 == 5)
229 if(supermodule > 11 && supermodule < 18)
231 printf("============== Supermodule %d\n",supermodule+1);
232 for (Int_t column=0; column<nCol; column++){
233 for (Int_t row=0; row<nRow; row++){
234 printf(" %2.4f ",fADCchannel[supermodule][column][row]);
241 if (strstr(option,"adcdecal") || strstr(option,"all")) {
242 printf("\n ---- ADC decalibration channel values ----\n\n");
243 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
244 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
245 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
246 // in reality they are 1/3 but leave them as 1/2
247 if(supermodule /2 == 5)
249 if(supermodule > 11 && supermodule < 18)
251 printf("============== Supermodule %d\n",supermodule+1);
252 for (Int_t column=0; column<nCol; column++){
253 for (Int_t row=0; row<nRow; row++){
254 printf(" %2.4f ",fADCchannelDecal[supermodule][column][row]);
261 if (strstr(option,"time") || strstr(option,"all")) {
262 printf("\n ---- time channel values ----\n\n");
263 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
264 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
265 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
266 // in reality they are 1/3 but leave them as 1/2
267 if(supermodule /2 == 5)
269 if(supermodule > 11 && supermodule < 18)
271 printf("============== Supermodule %d\n",supermodule+1);
272 for (Int_t column=0; column<nCol; column++){
273 for (Int_t row=0; row<nRow; row++){
274 for(Int_t bc = 0; bc < 4; bc++)
275 printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
282 if (strstr(option,"time") || strstr(option,"all")) {
283 printf("\n ---- time decalibration channel values ----\n\n");
284 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
285 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
286 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
287 // in reality they are 1/3 but leave them as 1/2
288 if(supermodule /2 == 5)
290 if(supermodule > 11 && supermodule < 18)
292 printf("============== Supermodule %d\n",supermodule+1);
293 for (Int_t column=0; column<nCol; column++){
294 for (Int_t row=0; row<nRow; row++){
295 printf(" %2.4f ",fTimeChannelDecal[supermodule][column][row]);
303 //________________________________________________________________
304 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
306 // Set ADC channel witdth values
307 // All indexes start from 0!
308 // Supermodule, column,raw should follow the ALICE convention:
309 // supermodule 0:11, column 0:47, row 0:23
311 return fADCchannel[supermodule][column][row];
314 //________________________________________________________________
315 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
317 // Set ADC channel decalibration witdth values
318 // All indexes start from 0!
319 // Supermodule, column,raw should follow the ALICE convention:
320 // supermodule 0:11, column 0:47, row 0:23
322 return fADCchannelDecal[supermodule][column][row];
325 //________________________________________________________________
326 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
328 // Get ADC pedestal values
329 return fADCpedestal[supermodule][column][row];
332 //________________________________________________________________
333 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
335 // Set channel time witdth values
336 return fTimeChannel[supermodule][column][row][bc];
339 //________________________________________________________________
340 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
342 // Set channel time witdth values
343 return fTimeChannelDecal[supermodule][column][row];
346 //________________________________________________________________
347 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
349 // Set ADC channel width values
350 fADCchannel[supermodule][column][row] = value;
353 //________________________________________________________________
354 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
356 // Set ADC channel width values
357 fADCchannelDecal[supermodule][column][row] = value;
360 //________________________________________________________________
361 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
363 // Set ADC pedestal values
364 fADCpedestal[supermodule][column][row] = value;
367 //________________________________________________________________
368 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
370 // Set ADC pedestal values
371 fTimeChannel[supermodule][column][row][bc] = value;
374 //________________________________________________________________
375 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
377 // Set ADC pedestal values
378 fTimeChannelDecal[supermodule][column][row] = value;