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 ///////////////////////////////////////////////////////////////////////////////
24 // class for EMCAL calibration //
26 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliEMCALCalibData.h"
32 ClassImp(AliEMCALCalibData)
34 //__________________________________________________________
35 AliEMCALCalibData::AliEMCALCalibData() : fADCchannelRef(0)
37 // Default constructor
41 //________________________________________________________________________
42 AliEMCALCalibData::AliEMCALCalibData(const char* name) : fADCchannelRef(0)
45 TString namst = "Calib_";
47 SetName (namst.Data());
48 SetTitle(namst.Data());
52 //______________________________________________________________________
53 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
54 TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
57 SetName (calibda.GetName());
58 SetTitle(calibda.GetName());
61 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
62 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
63 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
64 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows; //12 - Modules 11 and 12 are half modules
66 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
71 for(Int_t column = 0; column<nCol; column++) {
73 for(Int_t row = 0; row<nRow; row++) {
75 fADCchannel[supermodule][column][row] =
76 calibda.GetADCchannel(supermodule,column,row);
78 fADCchannelDecal[supermodule][column][row] =
79 calibda.GetADCchannelDecal(supermodule,column,row);
81 fADCpedestal[supermodule][column][row] =
82 calibda.GetADCpedestal(supermodule,column,row);
84 fTimeChannelDecal[supermodule][column][row] =
85 calibda.GetTimeChannelDecal(supermodule,column,row);
87 for(Int_t bc = 0; bc < 4; bc++)
88 fTimeChannel[supermodule][column][row][bc] =
89 calibda.GetTimeChannel(supermodule,column,row,bc);
97 //________________________________________________________________
98 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
100 // assignment operator
101 SetName (calibda.GetName());
102 SetTitle(calibda.GetName());
105 fADCchannelRef = calibda.fADCchannelRef ;
107 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
108 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
109 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
110 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
112 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
114 if(supermodule >= 10)
117 for(Int_t column = 0; column<nCol; column++) {
119 for(Int_t row = 0; row<nRow; row++) {
121 fADCchannel[supermodule][column][row] =
122 calibda.GetADCchannel(supermodule,column,row);
124 fADCchannelDecal[supermodule][column][row] =
125 calibda.GetADCchannelDecal(supermodule,column,row);
127 fADCpedestal[supermodule][column][row] =
128 calibda.GetADCpedestal(supermodule,column,row);
130 fTimeChannelDecal[supermodule][column][row] =
131 calibda.GetTimeChannelDecal(supermodule,column,row);
133 for(Int_t bc = 0; bc < 4; bc++)
134 fTimeChannel[supermodule][column][row][bc] =
135 calibda.GetTimeChannel(supermodule,column,row,bc);
144 //_____________________________
145 void AliEMCALCalibData::Reset()
147 // Set all pedestals to 0 and all ADC channels widths to 1
149 fADCchannelRef = 0.0162;
151 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
152 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
153 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
154 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
156 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
157 if(supermodule >= 10)
159 for (Int_t column=0; column < nCol; column++){
161 for (Int_t row = 0; row < nRow; row++){
163 fADCpedestal [supermodule][column][row]=0.;
165 fADCchannelDecal [supermodule][column][row]=1.;
166 fADCchannel [supermodule][column][row]=1.;
168 fTimeChannelDecal[supermodule][column][row]=0.;
170 for(Int_t bc = 0; bc < 4; bc++)
171 fTimeChannel[supermodule][column][row][bc]=0;
178 //________________________________________________________________
179 void AliEMCALCalibData::Print(Option_t *option) const
181 // Print tables of pedestals and ADC channels widths
182 // options are: "gain", "ped", "decal", "time", "all"
184 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
185 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
186 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
187 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
189 if (strstr(option,"ped") || strstr(option,"all")) {
190 printf("\n ---- Pedestal values ----\n\n");
191 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
192 if(supermodule >= 10)
194 printf("============== Supermodule %d\n",supermodule+1);
195 for (Int_t column=0; column<nCol; column++){
196 for (Int_t row=0; row<nRow; row++){
197 printf(" %2.4f ",fADCpedestal[supermodule][column][row]);
204 if (strstr(option,"gain") || strstr(option,"all")) {
205 printf("\n ---- ADC channel values ----\n\n");
206 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
207 if(supermodule >= 10)
209 printf("============== Supermodule %d\n",supermodule+1);
210 for (Int_t column=0; column<nCol; column++){
211 for (Int_t row=0; row<nRow; row++){
212 printf(" %2.4f ",fADCchannel[supermodule][column][row]);
219 if (strstr(option,"adcdecal") || strstr(option,"all")) {
220 printf("\n ---- ADC decalibration channel values ----\n\n");
221 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
222 if(supermodule >= 10)
224 printf("============== Supermodule %d\n",supermodule+1);
225 for (Int_t column=0; column<nCol; column++){
226 for (Int_t row=0; row<nRow; row++){
227 printf(" %2.4f ",fADCchannelDecal[supermodule][column][row]);
234 if (strstr(option,"time") || strstr(option,"all")) {
235 printf("\n ---- time channel values ----\n\n");
236 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
237 if(supermodule >= 10)
239 printf("============== Supermodule %d\n",supermodule+1);
240 for (Int_t column=0; column<nCol; column++){
241 for (Int_t row=0; row<nRow; row++){
242 for(Int_t bc = 0; bc < 4; bc++)
243 printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
250 if (strstr(option,"time") || strstr(option,"all")) {
251 printf("\n ---- time decalibration channel values ----\n\n");
252 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
253 if(supermodule >= 10)
255 printf("============== Supermodule %d\n",supermodule+1);
256 for (Int_t column=0; column<nCol; column++){
257 for (Int_t row=0; row<nRow; row++){
258 printf(" %2.4f ",fTimeChannelDecal[supermodule][column][row]);
266 //________________________________________________________________
267 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
269 // Set ADC channel witdth values
270 // All indexes start from 0!
271 // Supermodule, column,raw should follow the ALICE convention:
272 // supermodule 0:11, column 0:47, row 0:23
274 return fADCchannel[supermodule][column][row];
277 //________________________________________________________________
278 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
280 // Set ADC channel decalibration witdth values
281 // All indexes start from 0!
282 // Supermodule, column,raw should follow the ALICE convention:
283 // supermodule 0:11, column 0:47, row 0:23
285 return fADCchannelDecal[supermodule][column][row];
288 //________________________________________________________________
289 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
291 // Get ADC pedestal values
292 return fADCpedestal[supermodule][column][row];
295 //________________________________________________________________
296 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
298 // Set channel time witdth values
299 return fTimeChannel[supermodule][column][row][bc];
302 //________________________________________________________________
303 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
305 // Set channel time witdth values
306 return fTimeChannelDecal[supermodule][column][row];
309 //________________________________________________________________
310 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
312 // Set ADC channel width values
313 fADCchannel[supermodule][column][row] = value;
316 //________________________________________________________________
317 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
319 // Set ADC channel width values
320 fADCchannelDecal[supermodule][column][row] = value;
323 //________________________________________________________________
324 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
326 // Set ADC pedestal values
327 fADCpedestal[supermodule][column][row] = value;
330 //________________________________________________________________
331 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
333 // Set ADC pedestal values
334 fTimeChannel[supermodule][column][row][bc] = value;
337 //________________________________________________________________
338 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
340 // Set ADC pedestal values
341 fTimeChannelDecal[supermodule][column][row] = value;