AliRoot Core  ee782a0 (ee782a0)
AliEMCALCalibData.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 #include "AliEMCALCalibData.h"
17 
19 ClassImp(AliEMCALCalibData) ;
21 
24 //____________________________________
26 TNamed(), fADCchannelRef(0)
27 {
28  Reset();
29 }
30 
33 //____________________________________________________
35 TNamed(name,name),fADCchannelRef(0)
36 {
37  Reset();
38 }
39 
42 //____________________________________________________________________
44 TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
45 {
46  SetName (calibda.GetName());
47  SetTitle(calibda.GetName());
48  Reset();
49 
51  Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
52  Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
53 
54  for(Int_t supermodule = 0; supermodule < nSMod; supermodule++)
55  {
56  // Init all SM equally, even the channels known to not exist.
57 
58  for(Int_t column = 0; column<nCol; column++)
59  {
60  for(Int_t row = 0; row<nRow; row++)
61  {
62  SetADCchannel (supermodule,column,row, calibda.GetADCchannel (supermodule,column,row));
63  SetADCchannelOnline(supermodule,column,row, calibda.GetADCchannelOnline(supermodule,column,row));
64  SetADCchannelDecal (supermodule,column,row, calibda.GetADCchannelDecal (supermodule,column,row));
65  SetADCpedestal (supermodule,column,row, calibda.GetADCpedestal (supermodule,column,row));
66  SetTimeChannelDecal(supermodule,column,row, calibda.GetTimeChannelDecal(supermodule,column,row));
67  for(Int_t bc = 0; bc < 4; bc++)
68  SetTimeChannel(supermodule,column,row,bc,calibda.GetTimeChannel(supermodule,column,row,bc));
69  } // col
70  } // row
71  } // SM
72 }
73 
76 //________________________________________________________________________________
78 {
79  SetName (calibda.GetName());
80  SetTitle(calibda.GetName());
81  Reset();
82 
83  fADCchannelRef = calibda.GetADCchannelRef() ;
84 
86  Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
87  Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
88 
89  for(Int_t supermodule = 0; supermodule < nSMod; supermodule++)
90  {
91  // Init all SM equally, even the channels known to not exist.
92 
93  for(Int_t column = 0; column<nCol; column++)
94  {
95  for(Int_t row = 0; row<nRow; row++)
96  {
97  SetADCchannel (supermodule,column,row, calibda.GetADCchannel (supermodule,column,row));
98  SetADCchannelOnline(supermodule,column,row, calibda.GetADCchannelOnline(supermodule,column,row));
99  SetADCchannelDecal (supermodule,column,row, calibda.GetADCchannelDecal (supermodule,column,row));
100  SetADCpedestal (supermodule,column,row, calibda.GetADCpedestal (supermodule,column,row));
101  SetTimeChannelDecal(supermodule,column,row, calibda.GetTimeChannelDecal(supermodule,column,row));
102  for(Int_t bc = 0; bc < 4; bc++)
103  SetTimeChannel(supermodule,column,row,bc,calibda.GetTimeChannel(supermodule,column,row,bc));
104  } // col
105  } // row
106  } // col
107 
108  return *this;
109 }
110 
113 //_____________________________
115 {
116  fADCchannelRef = 0.0162;
117 
118  Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
119  Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
120  Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
121 
122  for (Int_t supermodule=0; supermodule<nSMod; supermodule++)
123  {
124  //Init all SM equally, even the channels known to not exist.
125 
126  for (Int_t column=0; column < nCol; column++)
127  {
128  for (Int_t row = 0; row < nRow; row++)
129  {
130  SetADCchannel (supermodule,column,row, fADCchannelRef);
131  SetADCchannelOnline(supermodule,column,row, fADCchannelRef);
132  SetADCchannelDecal (supermodule,column,row, 1);
133  SetADCpedestal (supermodule,column,row, 0);
134  SetTimeChannelDecal(supermodule,column,row, 0);
135  for(Int_t bc = 0; bc < 4; bc++)
136  SetTimeChannel(supermodule,column,row, bc, 0);
137 
138  }
139  }
140  }
141 }
142 
146 //____________________________________________________
147 void AliEMCALCalibData::Print(Option_t *option) const
148 {
150  Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
151  Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
152 
153  for (Int_t supermodule = 0; supermodule < nSMod; supermodule++)
154  {
155  //Init all SM equally, even the channels known to not exist.
156 
157  printf("============== Supermodule %d\n",supermodule+1);
158  for (Int_t column = 0; column < nCol; column++)
159  {
160  for (Int_t row = 0; row < nRow; row++)
161  {
162  printf("[col %d,row %d] ",column, row);
163  if (strstr(option,"gain") || strstr(option,"all"))
164  printf("calib=%2.4f ",GetADCchannel(supermodule,column,row));
165 
166  if (strstr(option,"online") || strstr(option,"all"))
167  printf("calib0=%2.4f ", GetADCchannelOnline(supermodule,column,row));
168 
169  if (strstr(option,"decal") || strstr(option,"all"))
170  printf("calibDecal=%2.4f ",GetADCchannelDecal(supermodule,column,row));
171 
172  if (strstr(option,"ped") || strstr(option,"all"))
173  printf("ped=%2.4f ", GetADCpedestal(supermodule,column,row));
174 
175  if (strstr(option,"time") || strstr(option,"all"))
176  printf("time::bc0 =%2.4f, bc1=%2.4f, bc2=%2.4f, bc3=%2.4f ",
177  GetTimeChannel(supermodule,column,row,0), GetTimeChannel(supermodule,column,row,1), GetTimeChannel(supermodule,column,row,2), GetTimeChannel(supermodule,column,row,3));
178 
179  if (strstr(option,"timdecal") || strstr(option,"all"))
180  printf("timeDecal=%2.4f ", GetTimeChannelDecal(supermodule,column,row));
181 
182  if (strstr(option,"all") || (row%4==3) ) printf("\n");
183  }
184  }
185  }
186 }
187 
194 //________________________________________________________________________________________
195 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
196 {
197  if(supermodule < 12) return fADCchannel [supermodule] [column][row];
198  else return fADCchannelDCAL[supermodule-12][column][row];
199 }
200 
207 //______________________________________________________________________________________________
208 Float_t AliEMCALCalibData::GetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row) const
209 {
210  if(supermodule < 12) return fADCchannelOnline [supermodule] [column][row];
211  else return fADCchannelOnlineDCAL[supermodule-12][column][row];
212 }
213 
220 //_____________________________________________________________________________________________
221 Float_t AliEMCALCalibData::GetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row) const
222 {
223  if(supermodule < 12) return fADCchannelDecal [supermodule] [column][row];
224  else return fADCchannelDecalDCAL[supermodule-12][column][row];
225 }
226 
230 //_________________________________________________________________________________________
231 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
232 {
233  if(supermodule < 12) return fADCpedestal [supermodule] [column][row];
234  else return fADCpedestalDCAL[supermodule-12][column][row];
235 }
236 
240 //______________________________________________________________________________________________
241 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
242 {
243  if(supermodule < 12) fADCchannel [supermodule] [column][row] = value;
244  else fADCchannelDCAL[supermodule-12][column][row] = value;
245 }
246 
250 //____________________________________________________________________________________________________
251 void AliEMCALCalibData::SetADCchannelOnline(Int_t supermodule, Int_t column, Int_t row, Float_t value)
252 {
253  if(supermodule < 12) fADCchannelOnline [supermodule] [column][row] = value;
254  else fADCchannelOnlineDCAL[supermodule-12][column][row] = value;
255 }
256 
260 //___________________________________________________________________________________________________
261 void AliEMCALCalibData::SetADCchannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
262 {
263  if(supermodule < 12) fADCchannelDecal [supermodule] [column][row] = value;
264  else fADCchannelDecalDCAL[supermodule-12][column][row] = value;
265 }
266 
270 //_______________________________________________________________________________________________
271 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
272 {
273  if(supermodule < 12) fADCpedestal [supermodule] [column][row] = value;
274  else fADCpedestalDCAL[supermodule-12][column][row] = value;
275 }
276 
277 //*** Do not use the following methods use instead AliEMCALCalibTime:
278 
282 //___________________________________________________________________________________________________
283 Float_t AliEMCALCalibData::GetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc) const
284 {
285  if(supermodule < 12) return fTimeChannel [supermodule] [column][row][bc];
286  else return fTimeChannelDCAL[supermodule-12][column][row][bc];
287 }
288 
292 //______________________________________________________________________________________________
293 Float_t AliEMCALCalibData::GetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row) const
294 {
295  if(supermodule < 12) return fTimeChannelDecal [supermodule] [column][row];
296  else return fTimeChannelDecalDCAL[supermodule-12][column][row];
297 }
298 
302 //_________________________________________________________________________________________________________
303 void AliEMCALCalibData::SetTimeChannel(Int_t supermodule, Int_t column, Int_t row, Int_t bc, Float_t value)
304 {
305  if(supermodule < 12) fTimeChannel [supermodule] [column][row][bc] = value;
306  else fTimeChannelDCAL[supermodule-12][column][row][bc] = value;
307 }
308 
312 //____________________________________________________________________________________________________
313 void AliEMCALCalibData::SetTimeChannelDecal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
314 {
315  if(supermodule < 12) fTimeChannelDecal [supermodule] [column][row] = value;
316  else fTimeChannelDecalDCAL[supermodule-12][column][row] = value;
317 }
318 
319 
320 
void SetADCchannel(Int_t module, Int_t column, Int_t row, Float_t value)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void SetTimeChannel(Int_t module, Int_t column, Int_t row, Int_t bc, Float_t value)
static const int fgkEMCALRows
Number of rows per module for EMCAL.
Float_t GetTimeChannelDecal(Int_t module, Int_t column, Int_t row) const
Float_t fADCchannelDecal[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
width of one ADC channel in GeV obtained from the voltage settings online
Float_t fADCchannelOnlineDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
width of one ADC channel in GeV ([mod][col][row])
AliEMCALCalibData()
Default constructor.
Cell energy calibration factors container class.
void Print(Option_t *option="") const
Float_t fADCchannel[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
base value of the ADC channel set from cosmics calibration, not to be used, instead use fADCchannelOn...
Float_t GetADCchannelRef() const
Float_t fTimeChannel[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows][4]
time shift of one ADC channel ([mod][col][row])
Float_t fTimeChannelDecal[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
value of the ADC pedestal ([mod][col][row]), not used
void SetADCpedestal(Int_t module, Int_t column, Int_t row, Float_t value)
void SetADCchannelDecal(Int_t module, Int_t column, Int_t row, Float_t value)
Float_t GetADCchannelOnline(Int_t module, Int_t column, Int_t row) const
Float_t fTimeChannelDecalDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
value of the ADC pedestal ([mod][col][row]), not used
AliEMCALCalibData & operator=(const AliEMCALCalibData &calibda)
Assignment operator.
Float_t fADCpedestal[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
decalibrate width of one ADC channel in GeV ([mod][col][row])
void Reset()
Set all pedestals to 0 and all ADC channels widths to 1.
Float_t GetADCchannelDecal(Int_t module, Int_t column, Int_t row) const
Float_t fADCchannelDecalDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
width of one ADC channel in GeV obtained from the voltage settings online
Float_t GetTimeChannel(Int_t module, Int_t column, Int_t row, Int_t bc) const
Float_t fADCchannelOnline[fgkECALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
width of one ADC channel in GeV ([mod][col][row])
static const int fgkEMCALCols
Number of columns per module for EMCAL.
Float_t GetADCchannel(Int_t module, Int_t column, Int_t row) const
Float_t fADCpedestalDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
decalibrate width of one ADC channel in GeV ([mod][col][row])
static const int fgkEMCALModules
Number of modules, 12 for EMCal + 8 for DCAL.
void SetTimeChannelDecal(Int_t module, Int_t column, Int_t row, Float_t value)
Float_t GetADCpedestal(Int_t module, Int_t column, Int_t row) const
Float_t fADCchannelDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
time shift of one ADC channel ([mod][col][row][bunch crossing number])
void SetADCchannelOnline(Int_t module, Int_t column, Int_t row, Float_t value)
Float_t fTimeChannelDCAL[fgkDCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows][4]
time shift of one ADC channel ([mod][col][row])