]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSEmcCalibData.cxx
Overlaps between PCA2 and PFG1 are corrected
[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];
fc6706cb 59 }
60 }
61 }
62}
63
64//________________________________________________________________
65AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
66{
67 // assignment operator
27f8cf68 68
69 if(this != &calibda) {
70
71 SetName(calibda.GetName());
72 SetTitle(calibda.GetName());
73
74 for(Int_t module=0; module<5; module++) {
75 for(Int_t column=0; column<56; column++) {
76 for(Int_t row=0; row<64; row++) {
77 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
78 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
e3310625 79 fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
80 fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
27f8cf68 81 }
fc6706cb 82 }
83 }
84 }
27f8cf68 85
fc6706cb 86 return *this;
87}
88
89//________________________________________________________________
90AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
91{
92 // Destructor
93}
94
95//________________________________________________________________
96void AliPHOSEmcCalibData::Reset()
97{
e3310625 98 // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
fc6706cb 99
100 for (Int_t module=0; module<5; module++){
101 for (Int_t column=0; column<56; column++){
102 for (Int_t row=0; row<64; row++){
72e5feac 103 fADCpedestalEmc[module][column][row] = 0.;
e3310625 104 fADCchannelEmc[module][column][row] = 0.005;
105 fHighLowRatioEmc[module][column][row] = 16. ;
106 fTimeShiftEmc[module][column][row] = 0. ;
fc6706cb 107 }
108 }
109 }
110
111}
112
113//________________________________________________________________
114void AliPHOSEmcCalibData::Print(Option_t *option) const
115{
116 // Print tables of pedestals and ADC channels
117
118 if (strstr(option,"ped")) {
119 printf("\n ---- EMC Pedestal values ----\n\n");
120 for (Int_t module=0; module<5; module++){
121 printf("============== Module %d\n",module+1);
122 for (Int_t column=0; column<56; column++){
123 for (Int_t row=0; row<64; row++){
124 printf("%4.1f",fADCpedestalEmc[module][column][row]);
125 }
126 printf("\n");
127 }
128 }
129 }
130
131 if (strstr(option,"gain")) {
132 printf("\n ---- EMC ADC channel values ----\n\n");
133 for (Int_t module=0; module<5; module++){
134 printf("============== Module %d\n",module+1);
135 for (Int_t column=0; column<56; column++){
136 for (Int_t row=0; row<64; row++){
137 printf("%4.1f",fADCchannelEmc[module][column][row]);
138 }
139 printf("\n");
140 }
141 }
142 }
e3310625 143
144 if (strstr(option,"hilo")) {
145 printf("\n ---- EMC High/Low ratio ----\n\n");
146 for (Int_t module=0; module<5; module++){
147 printf("============== Module %d\n",module+1);
148 for (Int_t column=0; column<56; column++){
149 for (Int_t row=0; row<64; row++){
150 printf("%4.1f",fHighLowRatioEmc[module][column][row]);
151 }
152 printf("\n");
153 }
154 }
155 }
156 if (strstr(option,"time")) {
157 printf("\n ---- EMC t0 shifts ----\n\n");
158 for (Int_t module=0; module<5; module++){
159 printf("============== Module %d\n",module+1);
160 for (Int_t column=0; column<56; column++){
161 for (Int_t row=0; row<64; row++){
162 printf("%6.3e",fTimeShiftEmc[module][column][row]);
163 }
164 printf("\n");
165 }
166 }
167 }
fc6706cb 168}
169
1fdb1c5e 170//________________________________________________________________
fc6706cb 171Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
172{
1fdb1c5e 173 //Return EMC calibration coefficient
fc6706cb 174 //module, column,raw should follow the internal PHOS convention:
175 //module 1:5, column 1:56, row 1:64
176
177 return fADCchannelEmc[module-1][column-1][row-1];
178}
179
1fdb1c5e 180//________________________________________________________________
fc6706cb 181Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
182{
1fdb1c5e 183 //Return EMC pedestal
184 //module, column,raw should follow the internal PHOS convention:
185 //module 1:5, column 1:56, row 1:64
186
fc6706cb 187 return fADCpedestalEmc[module-1][column-1][row-1];
188}
189
e3310625 190//________________________________________________________________
191Float_t AliPHOSEmcCalibData::GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const
192{
193 //Return EMC pedestal
194 //module, column,raw should follow the internal PHOS convention:
195 //module 1:5, column 1:56, row 1:64
196
197 return fHighLowRatioEmc[module-1][column-1][row-1];
198}
199
200//________________________________________________________________
201Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const
202{
203 //Return EMC pedestal
204 //module, column,raw should follow the internal PHOS convention:
205 //module 1:5, column 1:56, row 1:64
206
207 return fTimeShiftEmc[module-1][column-1][row-1];
208}
209
1fdb1c5e 210//________________________________________________________________
fc6706cb 211void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
212{
1fdb1c5e 213 //Set EMC calibration coefficient
214 //module, column,raw should follow the internal PHOS convention:
215 //module 1:5, column 1:56, row 1:64
216
fc6706cb 217 fADCchannelEmc[module-1][column-1][row-1] = value;
218}
219
1fdb1c5e 220//________________________________________________________________
fc6706cb 221void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
222{
1fdb1c5e 223 //Set EMC pedestal
224 //module, column,raw should follow the internal PHOS convention:
225 //module 1:5, column 1:56, row 1:64
fc6706cb 226 fADCpedestalEmc[module-1][column-1][row-1] = value;
227}
e3310625 228
229//________________________________________________________________
230void AliPHOSEmcCalibData::SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value)
231{
232 //Set EMC pedestal
233 //module, column,raw should follow the internal PHOS convention:
234 //module 1:5, column 1:56, row 1:64
235 fHighLowRatioEmc[module-1][column-1][row-1] = value;
236}
237//________________________________________________________________
238void AliPHOSEmcCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value)
239{
240 //Set EMC pedestal
241 //module, column,raw should follow the internal PHOS convention:
242 //module 1:5, column 1:56, row 1:64
243 fTimeShiftEmc[module-1][column-1][row-1] = value;
244}