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++)
66 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
67 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
69 //Init all SM equally, even the channels known to not exist.
71 for(Int_t column = 0; column<nCol; column++)
73 for(Int_t row = 0; row<nRow; row++)
75 SetADCchannel (supermodule,column,row, calibda.GetADCchannel (supermodule,column,row));
76 SetADCchannelOnline(supermodule,column,row, calibda.GetADCchannelOnline(supermodule,column,row));
77 SetADCchannelDecal (supermodule,column,row, calibda.GetADCchannelDecal (supermodule,column,row));
78 SetADCpedestal (supermodule,column,row, calibda.GetADCpedestal (supermodule,column,row));
79 SetTimeChannelDecal(supermodule,column,row, calibda.GetTimeChannelDecal(supermodule,column,row));
80 for(Int_t bc = 0; bc < 4; bc++)
81 SetTimeChannel(supermodule,column,row,bc,calibda.GetTimeChannel(supermodule,column,row,bc));
87 //________________________________________________________________
88 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
90 // assignment operator
91 SetName (calibda.GetName());
92 SetTitle(calibda.GetName());
95 fADCchannelRef = calibda.GetADCchannelRef() ;
97 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
98 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
99 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
101 for(Int_t supermodule = 0; supermodule < nSMod; supermodule++)
103 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
104 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
106 //Init all SM equally, even the channels known to not exist.
108 for(Int_t column = 0; column<nCol; column++)
110 for(Int_t row = 0; row<nRow; row++)
112 SetADCchannel (supermodule,column,row, calibda.GetADCchannel (supermodule,column,row));
113 SetADCchannelOnline(supermodule,column,row, calibda.GetADCchannelOnline(supermodule,column,row));
114 SetADCchannelDecal (supermodule,column,row, calibda.GetADCchannelDecal (supermodule,column,row));
115 SetADCpedestal (supermodule,column,row, calibda.GetADCpedestal (supermodule,column,row));
116 SetTimeChannelDecal(supermodule,column,row, calibda.GetTimeChannelDecal(supermodule,column,row));
117 for(Int_t bc = 0; bc < 4; bc++)
118 SetTimeChannel(supermodule,column,row,bc,calibda.GetTimeChannel(supermodule,column,row,bc));
126 //_____________________________
127 void AliEMCALCalibData::Reset()
129 // Set all pedestals to 0 and all ADC channels widths to 1
131 fADCchannelRef = 0.0162;
133 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
134 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
135 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
137 for (Int_t supermodule=0; supermodule<nSMod; supermodule++)
139 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
140 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
142 //Init all SM equally, even the channels known to not exist.
144 for (Int_t column=0; column < nCol; column++)
146 for (Int_t row = 0; row < nRow; row++)
149 SetADCchannel (supermodule,column,row, fADCchannelRef);
150 SetADCchannelOnline(supermodule,column,row, fADCchannelRef);
151 SetADCchannelDecal (supermodule,column,row, 1);
152 SetADCpedestal (supermodule,column,row, 0);
153 SetTimeChannelDecal(supermodule,column,row, 0);
154 for(Int_t bc = 0; bc < 4; bc++)
155 SetTimeChannel(supermodule,column,row, bc, 0);
162 //____________________________________________________
163 void AliEMCALCalibData::Print(Option_t *option) const
165 // Print tables of pedestals and ADC channels widths
166 // options are: "gain", "ped", "online", "decal", "time", "timdecal", "all"
168 Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
169 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
170 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
172 for (Int_t supermodule = 0; supermodule < nSMod; supermodule++)
174 nCol = AliEMCALGeoParams::fgkEMCALCols; //48
175 nRow = AliEMCALGeoParams::fgkEMCALRows; //24
177 //Init all SM equally, even the channels known to not exist.
179 printf("============== Supermodule %d\n",supermodule+1);
180 for (Int_t column = 0; column < nCol; column++)
182 for (Int_t row = 0; row < nRow; row++)
184 printf("[col %d,row %d] ",column, row);
185 if (strstr(option,"gain") || strstr(option,"all"))
186 printf("calib=%2.4f ",GetADCchannel(supermodule,column,row));
188 if (strstr(option,"online") || strstr(option,"all"))
189 printf("calib0=%2.4f ", GetADCchannelOnline(supermodule,column,row));
191 if (strstr(option,"decal") || strstr(option,"all"))
192 printf("calibDecal=%2.4f ",GetADCchannelDecal(supermodule,column,row));
194 if (strstr(option,"ped") || strstr(option,"all"))
195 printf("ped=%2.4f ", GetADCpedestal(supermodule,column,row));
197 if (strstr(option,"time") || strstr(option,"all"))
198 printf("time::bc0 =%2.4f, bc1=%2.4f, bc2=%2.4f, bc3=%2.4f ",
199 GetTimeChannel(supermodule,column,row,0), GetTimeChannel(supermodule,column,row,1), GetTimeChannel(supermodule,column,row,2), GetTimeChannel(supermodule,column,row,3));
201 if (strstr(option,"timdecal") || strstr(option,"all"))
202 printf("timeDecal=%2.4f ", GetTimeChannelDecal(supermodule,column,row));
204 if (strstr(option,"all") || (row%4==3) ) printf("\n");
210 //________________________________________________________________
211 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
213 // Set ADC channel witdth values
214 // All indexes start from 0!
215 // Supermodule, column,raw should follow the ALICE convention:
216 // supermodule 0:11, column 0:47, row 0:23
217 // DCal has its own array, starting from SM 12, index 0, same col-row size
219 if(supermodule < 12) return fADCchannel [supermodule] [column][row];
220 else return fADCchannelDCAL[supermodule-12][column][row];
223 //________________________________________________________________
224 Float_t AliEMCALCalibData::GetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row) const
226 // Set ADC channel witdth values, first online calibration parameter
227 // All indexes start from 0!
228 // Supermodule, column,raw should follow the ALICE convention:
229 // supermodule 0:11, column 0:47, row 0:23
230 // DCal has its own array, starting from SM 12, index 0, same col-row size
232 if(supermodule < 12) return fADCchannelOnline [supermodule] [column][row];
233 else return fADCchannelOnlineDCAL[supermodule-12][column][row];
236 //________________________________________________________________
237 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
239 // Set ADC channel decalibration witdth values
240 // All indexes start from 0!
241 // Supermodule, column,raw should follow the ALICE convention:
242 // supermodule 0:11, column 0:47, row 0:23
243 // DCal has its own array, starting from SM 12, index 0, same col-row size
245 if(supermodule < 12) return fADCchannelDecal [supermodule] [column][row];
246 else return fADCchannelDecalDCAL[supermodule-12][column][row];
249 //________________________________________________________________
250 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
252 // Get ADC pedestal values
253 // DCal has its own array, starting from SM 12, index 0, same col-row size
255 if(supermodule < 12) return fADCpedestal [supermodule] [column][row];
256 else return fADCpedestalDCAL[supermodule-12][column][row];
259 //________________________________________________________________
260 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
262 // Set channel time values
263 // DCal has its own array, starting from SM 12, index 0, same col-row size
265 if(supermodule < 12) return fTimeChannel [supermodule] [column][row][bc];
266 else return fTimeChannelDCAL[supermodule-12][column][row][bc];
269 //________________________________________________________________
270 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
272 // Set channel time decalibrated values
273 // DCal has its own array, starting from SM 12, index 0, same col-row size
275 if(supermodule < 12) return fTimeChannelDecal [supermodule] [column][row];
276 else return fTimeChannelDecalDCAL[supermodule-12][column][row];
279 //________________________________________________________________
280 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
282 // Set ADC channel width values
283 // DCal has its own array, starting from SM 12, index 0, same col-row size
285 if(supermodule < 12) fADCchannel [supermodule] [column][row] = value;
286 else fADCchannelDCAL[supermodule-12][column][row] = value;
289 //________________________________________________________________
290 void AliEMCALCalibData::SetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row, Float_t value)
292 // Set ADC channel online width values
293 // DCal has its own array, starting from SM 12, index 0, same col-row size
295 if(supermodule < 12) fADCchannelOnline [supermodule] [column][row] = value;
296 else fADCchannelOnlineDCAL[supermodule-12][column][row] = value;
299 //________________________________________________________________
300 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
302 // Set ADC channel width values, decalibration
303 // DCal has its own array, starting from SM 12, index 0, same col-row size
305 if(supermodule < 12) fADCchannelDecal [supermodule] [column][row] = value;
306 else fADCchannelDecalDCAL[supermodule-12][column][row] = value;
309 //________________________________________________________________
310 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
312 // Set ADC pedestal values
313 // DCal has its own array, starting from SM 12, index 0, same col-row size
315 if(supermodule < 12) fADCpedestal [supermodule] [column][row] = value;
316 else fADCpedestalDCAL[supermodule-12][column][row] = value;
319 //________________________________________________________________
320 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
322 // Set time per channel and bunch crossing values
323 // DCal has its own array, starting from SM 12, index 0, same col-row size
325 if(supermodule < 12) fTimeChannel [supermodule] [column][row][bc] = value;
326 else fTimeChannelDCAL[supermodule-12][column][row][bc] = value;
329 //________________________________________________________________
330 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
332 // Set decalibrated time per channel values
333 // DCal has its own array, starting from SM 12, index 0, same col-row size
335 if(supermodule < 12) fTimeChannelDecal [supermodule] [column][row] = value;
336 else fTimeChannelDecalDCAL[supermodule-12][column][row] = value;