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() :
36 TNamed(), fADCchannelRef(0)
38 // Default constructor
42 //________________________________________________________________________
43 AliEMCALCalibData::AliEMCALCalibData(const char* name) :
44 TNamed(name,name),fADCchannelRef(0)
50 //______________________________________________________________________
51 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
52 TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
55 SetName (calibda.GetName());
56 SetTitle(calibda.GetName());
59 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
60 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
61 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
62 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows; //12 - Modules 11 and 12 are half modules
63 // in reality they are 1/3 but leave them as 1/2
65 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
70 for(Int_t column = 0; column<nCol; column++) {
72 for(Int_t row = 0; row<nRow; row++) {
74 fADCchannel[supermodule][column][row] =
75 calibda.GetADCchannel(supermodule,column,row);
77 fADCchannelDecal[supermodule][column][row] =
78 calibda.GetADCchannelDecal(supermodule,column,row);
80 fADCpedestal[supermodule][column][row] =
81 calibda.GetADCpedestal(supermodule,column,row);
83 fTimeChannelDecal[supermodule][column][row] =
84 calibda.GetTimeChannelDecal(supermodule,column,row);
86 for(Int_t bc = 0; bc < 4; bc++)
87 fTimeChannel[supermodule][column][row][bc] =
88 calibda.GetTimeChannel(supermodule,column,row,bc);
95 //________________________________________________________________
96 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
98 // assignment operator
99 SetName (calibda.GetName());
100 SetTitle(calibda.GetName());
103 fADCchannelRef = calibda.GetADCchannelRef() ;
105 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
106 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
107 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
108 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
109 // in reality they are 1/3 but leave them as 1/2
111 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
113 if(supermodule >= 10)
116 for(Int_t column = 0; column<nCol; column++) {
118 for(Int_t row = 0; row<nRow; row++) {
120 fADCchannel[supermodule][column][row] =
121 calibda.GetADCchannel(supermodule,column,row);
123 fADCchannelDecal[supermodule][column][row] =
124 calibda.GetADCchannelDecal(supermodule,column,row);
126 fADCpedestal[supermodule][column][row] =
127 calibda.GetADCpedestal(supermodule,column,row);
129 fTimeChannelDecal[supermodule][column][row] =
130 calibda.GetTimeChannelDecal(supermodule,column,row);
132 for(Int_t bc = 0; bc < 4; bc++)
133 fTimeChannel[supermodule][column][row][bc] =
134 calibda.GetTimeChannel(supermodule,column,row,bc);
143 //_____________________________
144 void AliEMCALCalibData::Reset()
146 // Set all pedestals to 0 and all ADC channels widths to 1
148 fADCchannelRef = 0.0162;
150 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
151 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
152 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
153 Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
154 // in reality they are 1/3 but leave them as 1/2
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
188 // in reality they are 1/3 but leave them as 1/2
190 if (strstr(option,"ped") || strstr(option,"all")) {
191 printf("\n ---- Pedestal values ----\n\n");
192 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
193 if(supermodule >= 10)
195 printf("============== Supermodule %d\n",supermodule+1);
196 for (Int_t column=0; column<nCol; column++){
197 for (Int_t row=0; row<nRow; row++){
198 printf(" %2.4f ",fADCpedestal[supermodule][column][row]);
205 if (strstr(option,"gain") || strstr(option,"all")) {
206 printf("\n ---- ADC channel values ----\n\n");
207 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
208 if(supermodule >= 10)
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 ",fADCchannel[supermodule][column][row]);
220 if (strstr(option,"adcdecal") || strstr(option,"all")) {
221 printf("\n ---- ADC decalibration channel values ----\n\n");
222 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
223 if(supermodule >= 10)
225 printf("============== Supermodule %d\n",supermodule+1);
226 for (Int_t column=0; column<nCol; column++){
227 for (Int_t row=0; row<nRow; row++){
228 printf(" %2.4f ",fADCchannelDecal[supermodule][column][row]);
235 if (strstr(option,"time") || strstr(option,"all")) {
236 printf("\n ---- time channel values ----\n\n");
237 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
238 if(supermodule >= 10)
240 printf("============== Supermodule %d\n",supermodule+1);
241 for (Int_t column=0; column<nCol; column++){
242 for (Int_t row=0; row<nRow; row++){
243 for(Int_t bc = 0; bc < 4; bc++)
244 printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
251 if (strstr(option,"time") || strstr(option,"all")) {
252 printf("\n ---- time decalibration channel values ----\n\n");
253 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
254 if(supermodule >= 10)
256 printf("============== Supermodule %d\n",supermodule+1);
257 for (Int_t column=0; column<nCol; column++){
258 for (Int_t row=0; row<nRow; row++){
259 printf(" %2.4f ",fTimeChannelDecal[supermodule][column][row]);
267 //________________________________________________________________
268 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
270 // Set ADC channel witdth values
271 // All indexes start from 0!
272 // Supermodule, column,raw should follow the ALICE convention:
273 // supermodule 0:11, column 0:47, row 0:23
275 return fADCchannel[supermodule][column][row];
278 //________________________________________________________________
279 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
281 // Set ADC channel decalibration witdth values
282 // All indexes start from 0!
283 // Supermodule, column,raw should follow the ALICE convention:
284 // supermodule 0:11, column 0:47, row 0:23
286 return fADCchannelDecal[supermodule][column][row];
289 //________________________________________________________________
290 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
292 // Get ADC pedestal values
293 return fADCpedestal[supermodule][column][row];
296 //________________________________________________________________
297 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
299 // Set channel time witdth values
300 return fTimeChannel[supermodule][column][row][bc];
303 //________________________________________________________________
304 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
306 // Set channel time witdth values
307 return fTimeChannelDecal[supermodule][column][row];
310 //________________________________________________________________
311 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
313 // Set ADC channel width values
314 fADCchannel[supermodule][column][row] = value;
317 //________________________________________________________________
318 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
320 // Set ADC channel width values
321 fADCchannelDecal[supermodule][column][row] = value;
324 //________________________________________________________________
325 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
327 // Set ADC pedestal values
328 fADCpedestal[supermodule][column][row] = value;
331 //________________________________________________________________
332 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
334 // Set ADC pedestal values
335 fTimeChannel[supermodule][column][row][bc] = value;
338 //________________________________________________________________
339 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
341 // Set ADC pedestal values
342 fTimeChannelDecal[supermodule][column][row] = value;