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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // class for PHOS EmCal calibration //
20 ///////////////////////////////////////////////////////////////////////////////
22 #include "AliPHOSEmcCalibData.h"
24 ClassImp(AliPHOSEmcCalibData)
26 //________________________________________________________________
27 AliPHOSEmcCalibData::AliPHOSEmcCalibData(): TNamed()
29 // Default constructor
33 //________________________________________________________________
34 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name)
37 TString namst = "Calib_";
39 SetName(namst.Data());
40 SetTitle(namst.Data());
44 //________________________________________________________________
45 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
49 SetName(calibda.GetName());
50 SetTitle(calibda.GetName());
52 for(Int_t module=0; module<5; module++) {
53 for(Int_t column=0; column<56; column++) {
54 for(Int_t row=0; row<64; row++) {
55 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
56 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
57 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
58 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
59 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
65 //________________________________________________________________
66 AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
68 // assignment operator
70 if(this != &calibda) {
72 SetName(calibda.GetName());
73 SetTitle(calibda.GetName());
75 for(Int_t module=0; module<5; module++) {
76 for(Int_t column=0; column<56; column++) {
77 for(Int_t row=0; row<64; row++) {
78 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
79 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
80 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
81 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
82 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
91 //________________________________________________________________
92 AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
97 //________________________________________________________________
98 void AliPHOSEmcCalibData::Reset()
100 // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
102 for (Int_t module=0; module<5; module++){
103 for (Int_t column=0; column<56; column++){
104 for (Int_t row=0; row<64; row++){
105 fADCpedestalEmc[module][column][row] = 0.;
106 fADCchannelEmc[module][column][row] = 0.005;
107 fHighLowRatioEmc[module][column][row] = 16. ;
108 fTimeShiftEmc[module][column][row] = 0. ;
109 fAltroOffsets[module][column][row] = 0 ;
113 fSampleTimeStep=100.e-9 ; //100 ns
116 //________________________________________________________________
117 void AliPHOSEmcCalibData::Print(Option_t *option) const
119 // Print tables of pedestals and ADC channels
121 if (strstr(option,"ped")) {
122 printf("\n ---- EMC Pedestal values ----\n\n");
123 for (Int_t module=0; module<5; module++){
124 printf("============== Module %d\n",module+1);
125 for (Int_t column=0; column<56; column++){
126 for (Int_t row=0; row<64; row++){
127 printf("%4.1f",fADCpedestalEmc[module][column][row]);
134 if (strstr(option,"gain")) {
135 printf("\n ---- EMC ADC channel values ----\n\n");
136 for (Int_t module=0; module<5; module++){
137 printf("============== Module %d\n",module+1);
138 for (Int_t column=0; column<56; column++){
139 for (Int_t row=0; row<64; row++){
140 printf("%4.1f",fADCchannelEmc[module][column][row]);
147 if (strstr(option,"hilo")) {
148 printf("\n ---- EMC High/Low ratio ----\n\n");
149 for (Int_t module=0; module<5; module++){
150 printf("============== Module %d\n",module+1);
151 for (Int_t column=0; column<56; column++){
152 for (Int_t row=0; row<64; row++){
153 printf("%4.1f",fHighLowRatioEmc[module][column][row]);
159 if (strstr(option,"time")) {
160 printf("\n ---- EMC t0 shifts ----\n\n");
161 for (Int_t module=0; module<5; module++){
162 printf("============== Module %d\n",module+1);
163 for (Int_t column=0; column<56; column++){
164 for (Int_t row=0; row<64; row++){
165 printf("%6.3e",fTimeShiftEmc[module][column][row]);
171 if (strstr(option,"altro")) {
172 printf("\n ---- EMC altro offsets ----\n\n");
173 for (Int_t module=0; module<5; module++){
174 printf("============== Module %d\n",module+1);
175 for (Int_t column=0; column<56; column++){
176 for (Int_t row=0; row<64; row++){
177 printf("%5d",fAltroOffsets[module][column][row]);
185 //________________________________________________________________
186 Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
188 //Return EMC calibration coefficient
189 //module, column,raw should follow the internal PHOS convention:
190 //module 1:5, column 1:56, row 1:64
192 return fADCchannelEmc[module-1][column-1][row-1];
195 //________________________________________________________________
196 Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
198 //Return EMC pedestal
199 //module, column,raw should follow the internal PHOS convention:
200 //module 1:5, column 1:56, row 1:64
202 return fADCpedestalEmc[module-1][column-1][row-1];
205 //________________________________________________________________
206 Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
208 //Return EMC pedestal
209 //module, column,raw should follow the internal PHOS convention:
210 //module 1:5, column 1:56, row 1:64
212 return fHighLowRatioEmc[module-1][column-1][row-1];
215 //________________________________________________________________
216 Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
218 //Return EMC pedestal
219 //module, column,raw should follow the internal PHOS convention:
220 //module 1:5, column 1:56, row 1:64
222 return fTimeShiftEmc[module-1][column-1][row-1];
224 //________________________________________________________________
225 Float_t AliPHOSEmcCalibData::GetSampleTimeStep()const
227 //Returns conversion coefficient from ALTRO smaple time step and secods
228 //Negative value not used in reconstruction (conversion taken from TRU trailer)
229 //and only in raw simulation
230 return fSampleTimeStep ;
232 //________________________________________________________________
233 Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const
235 //Return EMC altro offsets
236 //module, column,raw should follow the internal PHOS convention:
237 //module 1:5, column 1:56, row 1:64
239 return fAltroOffsets[module-1][column-1][row-1];
241 //________________________________________________________________
242 void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
244 //Set EMC calibration coefficient
245 //module, column,raw should follow the internal PHOS convention:
246 //module 1:5, column 1:56, row 1:64
248 fADCchannelEmc[module-1][column-1][row-1] = value;
251 //________________________________________________________________
252 void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
255 //module, column,raw should follow the internal PHOS convention:
256 //module 1:5, column 1:56, row 1:64
257 fADCpedestalEmc[module-1][column-1][row-1] = value;
260 //________________________________________________________________
261 void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
264 //module, column,raw should follow the internal PHOS convention:
265 //module 1:5, column 1:56, row 1:64
266 fHighLowRatioEmc[module-1][column-1][row-1] = value;
268 //________________________________________________________________
269 void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
272 //module, column,raw should follow the internal PHOS convention:
273 //module 1:5, column 1:56, row 1:64
274 fTimeShiftEmc[module-1][column-1][row-1] = value;
276 //________________________________________________________________
277 void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value)
280 //module, column,raw should follow the internal PHOS convention:
281 //module 1:5, column 1:56, row 1:64
282 fAltroOffsets[module-1][column-1][row-1] = value;
284 //________________________________________________________________
285 void AliPHOSEmcCalibData::SetSampleTimeStep(Float_t step)
287 //Sets conversion coefficient from ALTRO smaple time step and secods
288 //Negative value not used in reconstruction (conversion taken from TRU trailer)
289 //and only in raw simulation
290 fSampleTimeStep = step ;