]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSEmcCalibData.cxx
Implementation of copy constructor and assignement operators (Marian)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcCalibData.cxx
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
24 ClassImp(AliPHOSEmcCalibData)
25
26 //________________________________________________________________
27   AliPHOSEmcCalibData::AliPHOSEmcCalibData(): TNamed()
28 {
29   // Default constructor
30   Reset();
31 }
32
33 //________________________________________________________________
34 AliPHOSEmcCalibData::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 //________________________________________________________________
45 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
46   TNamed(calibda)
47 {
48   // copy constructor
49   SetName(calibda.GetName());
50   SetTitle(calibda.GetName());
51
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       }
60     }
61   }
62 }
63
64 //________________________________________________________________
65 AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
66 {
67   // assignment operator
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];
79           fHighLowRatioEmc[module][column][row] = calibda.fHighLowRatioEmc[module][column][row];
80           fTimeShiftEmc[module][column][row] = calibda.fTimeShiftEmc[module][column][row];
81         }
82       }
83     }
84   }
85
86   return *this;
87 }
88
89 //________________________________________________________________
90 AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
91 {
92   // Destructor
93 }
94
95 //________________________________________________________________
96 void AliPHOSEmcCalibData::Reset()
97 {
98   // Set all pedestals and all ADC channels to its ideal values = 5. (MeV/ADC)
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++){
103         fADCpedestalEmc[module][column][row] = 0.;
104         fADCchannelEmc[module][column][row]  = 0.005;
105         fHighLowRatioEmc[module][column][row] = 16. ;
106         fTimeShiftEmc[module][column][row] = 0. ;
107       }
108     }
109   }
110
111 }
112
113 //________________________________________________________________
114 void  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   }
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   }
168 }
169
170 //________________________________________________________________
171 Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
172 {
173   //Return EMC calibration coefficient
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
180 //________________________________________________________________
181 Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
182 {
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
187   return fADCpedestalEmc[module-1][column-1][row-1];
188 }
189
190 //________________________________________________________________
191 Float_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 //________________________________________________________________
201 Float_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
210 //________________________________________________________________
211 void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
212 {
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
217   fADCchannelEmc[module-1][column-1][row-1] = value;
218 }
219
220 //________________________________________________________________
221 void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
222 {
223   //Set EMC pedestal
224   //module, column,raw should follow the internal PHOS convention:
225   //module 1:5, column 1:56, row 1:64
226   fADCpedestalEmc[module-1][column-1][row-1] = value;
227 }
228
229 //________________________________________________________________
230 void 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 //________________________________________________________________
238 void 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 }