Fixing ompilation warnings
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcCalibData.cxx
CommitLineData
fc6706cb 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///////////////////////////////////////////////////////////////////////////////
17// //
18// class for PHOS EmCal calibration //
19// //
20///////////////////////////////////////////////////////////////////////////////
21
22#include "AliPHOSEmcCalibData.h"
23
24ClassImp(AliPHOSEmcCalibData)
25
26//________________________________________________________________
27f8cf68 27 AliPHOSEmcCalibData::AliPHOSEmcCalibData(): TNamed()
fc6706cb 28{
29 // Default constructor
30 Reset();
31}
32
33//________________________________________________________________
34AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name)
35{
36 // Constructor
37 TString namst = "Calib_";
38 namst += name;
39 SetName(namst.Data());
40 SetTitle(namst.Data());
41 Reset();
42}
43
44//________________________________________________________________
45AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
46 TNamed(calibda)
47{
48 // copy constructor
49 SetName(calibda.GetName());
50 SetTitle(calibda.GetName());
27f8cf68 51
fc6706cb 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++) {
27f8cf68 55 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
56 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
e3310625 57 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
58 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
bafc1087 59 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
fc6706cb 60 }
61 }
62 }
63}
64
65//________________________________________________________________
66AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
67{
68 // assignment operator
27f8cf68 69
70 if(this != &calibda) {
71
72 SetName(calibda.GetName());
73 SetTitle(calibda.GetName());
74
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];
e3310625 80 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
81 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
bafc1087 82 fAltroOffsets[module][column][row] = calibda.fAltroOffsets[module][column][row];
27f8cf68 83 }
fc6706cb 84 }
85 }
86 }
27f8cf68 87
fc6706cb 88 return *this;
89}
90
91//________________________________________________________________
92AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
93{
94 // Destructor
95}
96
97//________________________________________________________________
98void AliPHOSEmcCalibData::Reset()
99{
e3310625 100 // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
fc6706cb 101
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++){
72e5feac 105 fADCpedestalEmc[module][column][row] = 0.;
e3310625 106 fADCchannelEmc[module][column][row] = 0.005;
107 fHighLowRatioEmc[module][column][row] = 16. ;
108 fTimeShiftEmc[module][column][row] = 0. ;
bafc1087 109 fAltroOffsets[module][column][row] = 0 ;
fc6706cb 110 }
111 }
112 }
113
114}
115
116//________________________________________________________________
117void AliPHOSEmcCalibData::Print(Option_t *option) const
118{
119 // Print tables of pedestals and ADC channels
120
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]);
128 }
129 printf("\n");
130 }
131 }
132 }
133
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]);
141 }
142 printf("\n");
143 }
144 }
145 }
e3310625 146
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]);
154 }
155 printf("\n");
156 }
157 }
158 }
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]);
166 }
167 printf("\n");
168 }
169 }
170 }
bafc1087 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]);
178 }
179 printf("\n");
180 }
181 }
182 }
fc6706cb 183}
184
1fdb1c5e 185//________________________________________________________________
fc6706cb 186Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
187{
1fdb1c5e 188 //Return EMC calibration coefficient
fc6706cb 189 //module, column,raw should follow the internal PHOS convention:
190 //module 1:5, column 1:56, row 1:64
191
192 return fADCchannelEmc[module-1][column-1][row-1];
193}
194
1fdb1c5e 195//________________________________________________________________
fc6706cb 196Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
197{
1fdb1c5e 198 //Return EMC pedestal
199 //module, column,raw should follow the internal PHOS convention:
200 //module 1:5, column 1:56, row 1:64
201
fc6706cb 202 return fADCpedestalEmc[module-1][column-1][row-1];
203}
204
1fdb1c5e 205//________________________________________________________________
e3310625 206Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
207{
208 //Return EMC pedestal
209 //module, column,raw should follow the internal PHOS convention:
210 //module 1:5, column 1:56, row 1:64
211
212 return fHighLowRatioEmc[module-1][column-1][row-1];
213}
214
215//________________________________________________________________
216Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
217{
218 //Return EMC pedestal
219 //module, column,raw should follow the internal PHOS convention:
220 //module 1:5, column 1:56, row 1:64
221
222 return fTimeShiftEmc[module-1][column-1][row-1];
223}
bafc1087 224//________________________________________________________________
225Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const
226{
227 //Return EMC altro offsets
228 //module, column,raw should follow the internal PHOS convention:
229 //module 1:5, column 1:56, row 1:64
230
231 return fAltroOffsets[module-1][column-1][row-1];
232}
e3310625 233//________________________________________________________________
fc6706cb 234void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
235{
1fdb1c5e 236 //Set EMC calibration coefficient
237 //module, column,raw should follow the internal PHOS convention:
238 //module 1:5, column 1:56, row 1:64
239
fc6706cb 240 fADCchannelEmc[module-1][column-1][row-1] = value;
241}
242
1fdb1c5e 243//________________________________________________________________
fc6706cb 244void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
245{
1fdb1c5e 246 //Set EMC pedestal
247 //module, column,raw should follow the internal PHOS convention:
248 //module 1:5, column 1:56, row 1:64
fc6706cb 249 fADCpedestalEmc[module-1][column-1][row-1] = value;
250}
e3310625 251
252//________________________________________________________________
253void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
254{
255 //Set EMC pedestal
256 //module, column,raw should follow the internal PHOS convention:
257 //module 1:5, column 1:56, row 1:64
258 fHighLowRatioEmc[module-1][column-1][row-1] = value;
259}
260//________________________________________________________________
261void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
262{
263 //Set EMC pedestal
264 //module, column,raw should follow the internal PHOS convention:
265 //module 1:5, column 1:56, row 1:64
266 fTimeShiftEmc[module-1][column-1][row-1] = value;
267}
bafc1087 268//________________________________________________________________
269void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value)
270{
271 //Set EMC pedestal
272 //module, column,raw should follow the internal PHOS convention:
273 //module 1:5, column 1:56, row 1:64
274 fAltroOffsets[module-1][column-1][row-1] = value;
275}