]>
Commit | Line | Data |
---|---|---|
8af17dba | 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 | /* $Id$ */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // class for ZDC calibration // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "AliZDCCalibData.h" | |
25 | ||
26 | ClassImp(AliZDCCalibData) | |
27 | ||
28 | //________________________________________________________________ | |
ea628de7 | 29 | AliZDCCalibData::AliZDCCalibData(): |
30 | TNamed() | |
8af17dba | 31 | { |
8af17dba | 32 | Reset(); |
33 | } | |
34 | ||
35 | //________________________________________________________________ | |
ea628de7 | 36 | AliZDCCalibData::AliZDCCalibData(const char* name): |
37 | TNamed(), | |
38 | fZEMEndValue(0), | |
39 | fZEMCutFraction(0), | |
40 | fDZEMSup(0), | |
41 | fDZEMInf(0), | |
42 | fEZN1MaxValue(0), | |
43 | fEZP1MaxValue(0), | |
44 | fEZDC1MaxValue(0), | |
45 | fEZN2MaxValue(0), | |
46 | fEZP2MaxValue(0), | |
47 | fEZDC2MaxValue(0) | |
8af17dba | 48 | { |
8a2624cc | 49 | // Constructor |
8af17dba | 50 | TString namst = "Calib_"; |
51 | namst += name; | |
52 | SetName(namst.Data()); | |
53 | SetTitle(namst.Data()); | |
8af17dba | 54 | Reset(); |
55 | } | |
56 | ||
8599f95e | 57 | //________________________________________________________________ |
58 | AliZDCCalibData::AliZDCCalibData(const AliZDCCalibData& calibda) : | |
59 | TNamed(calibda) | |
60 | { | |
c0aec6f6 | 61 | // Copy constructor |
8599f95e | 62 | SetName(calibda.GetName()); |
63 | SetTitle(calibda.GetName()); | |
64 | Reset(); | |
83347831 | 65 | for(int t=0; t<48; t++){ |
8831501a | 66 | fMeanPedestal[t] = calibda.GetMeanPed(t); |
67 | fMeanPedWidth[t] = calibda.GetMeanPedWidth(t); | |
8831501a | 68 | fOOTPedestal[t] = calibda.GetOOTPed(t); |
69 | fOOTPedWidth[t] = calibda.GetOOTPedWidth(t); | |
70 | fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t); | |
71 | fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t); | |
72 | } | |
72bde173 | 73 | for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t); |
ac992fb1 | 74 | // |
646f1679 | 75 | fZEMEndValue = calibda.GetZEMEndValue(); |
76 | fZEMCutFraction = calibda.GetZEMCutFraction(); | |
77 | fDZEMSup = calibda.GetDZEMSup(); | |
78 | fDZEMInf = calibda.GetDZEMInf(); | |
8599f95e | 79 | } |
80 | ||
81 | //________________________________________________________________ | |
82 | AliZDCCalibData &AliZDCCalibData::operator =(const AliZDCCalibData& calibda) | |
83 | { | |
84 | // assignment operator | |
85 | SetName(calibda.GetName()); | |
86 | SetTitle(calibda.GetName()); | |
87 | Reset(); | |
83347831 | 88 | for(int t=0; t<48; t++){ |
8831501a | 89 | fMeanPedestal[t] = calibda.GetMeanPed(t); |
90 | fMeanPedWidth[t] = calibda.GetMeanPedWidth(t); | |
8831501a | 91 | fOOTPedestal[t] = calibda.GetOOTPed(t); |
92 | fOOTPedWidth[t] = calibda.GetOOTPedWidth(t); | |
93 | fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t); | |
94 | fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t); | |
95 | } | |
72bde173 | 96 | for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t); |
646f1679 | 97 | fZEMEndValue = calibda.GetZEMEndValue(); |
98 | fZEMCutFraction = calibda.GetZEMCutFraction(); | |
ac992fb1 | 99 | |
8599f95e | 100 | return *this; |
101 | } | |
102 | ||
8af17dba | 103 | //________________________________________________________________ |
104 | AliZDCCalibData::~AliZDCCalibData() | |
105 | { | |
8af17dba | 106 | } |
107 | ||
108 | //________________________________________________________________ | |
109 | void AliZDCCalibData::Reset() | |
110 | { | |
8a2624cc | 111 | // Reset |
83347831 | 112 | memset(fMeanPedestal,0,48*sizeof(Float_t)); |
113 | memset(fMeanPedWidth,0,48*sizeof(Float_t)); | |
114 | memset(fOOTPedestal,0,48*sizeof(Float_t)); | |
115 | memset(fOOTPedWidth,0,48*sizeof(Float_t)); | |
72bde173 | 116 | memset(fEnCalibration,0,6*sizeof(Float_t)); |
ea628de7 | 117 | memset(fZN1EqualCoeff,0,5*sizeof(Float_t)); |
118 | memset(fZP1EqualCoeff,0,5*sizeof(Float_t)); | |
119 | memset(fZN2EqualCoeff,0,5*sizeof(Float_t)); | |
120 | memset(fZP2EqualCoeff,0,5*sizeof(Float_t)); | |
8af17dba | 121 | } |
122 | ||
8af17dba | 123 | |
124 | //________________________________________________________________ | |
5bc762ca | 125 | void AliZDCCalibData::Print(Option_t *) const |
8af17dba | 126 | { |
8a2624cc | 127 | // Printing of calibration object |
ea628de7 | 128 | printf("\n ####### In-time pedestal values (mean value, sigma) ####### \n"); |
129 | for(int t=0; t<48; t++) | |
130 | printf("\t ADC%d (%.1f, %.1f)\n",t,fMeanPedestal[t],fMeanPedWidth[t]); | |
e1ea0c63 | 131 | // |
ea628de7 | 132 | printf("\n\n ####### Out-of-time pedestal values (mean value, sigma) ####### \n"); |
133 | for(int t=0; t<48; t++) | |
134 | printf("\t ADC-OoT%d (%.1f, %.1f)\n",t,fOOTPedestal[t],fOOTPedWidth[t]); | |
72bde173 | 135 | |
ea628de7 | 136 | printf("\n\n ####### Energy calibration coefficients ####### \n"); |
e1ea0c63 | 137 | printf(" ZN1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[0]); |
138 | printf(" ZP1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[1]); | |
139 | printf(" ZN2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[2]); | |
140 | printf(" ZP2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[3]); | |
141 | printf(" ZEM1 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[4]); | |
142 | printf(" ZEM2 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[5]); | |
ac992fb1 | 143 | |
ea628de7 | 144 | printf("\n\n ####### Equalization coefficients ####### \n"); |
ac992fb1 | 145 | printf(" ZN1 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n", |
146 | fZN1EqualCoeff[0],fZN1EqualCoeff[1],fZN1EqualCoeff[2],fZN1EqualCoeff[3],fZN1EqualCoeff[4]); | |
147 | printf(" ZP1 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n", | |
148 | fZP1EqualCoeff[0],fZP1EqualCoeff[1],fZP1EqualCoeff[2],fZP1EqualCoeff[3],fZP1EqualCoeff[4]); | |
149 | printf(" ZN2 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n", | |
150 | fZN2EqualCoeff[0],fZN2EqualCoeff[1],fZN2EqualCoeff[2],fZN2EqualCoeff[3],fZN2EqualCoeff[4]); | |
dcf60b09 | 151 | printf(" ZP2 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n", |
ac992fb1 | 152 | fZP2EqualCoeff[0],fZP2EqualCoeff[1],fZP2EqualCoeff[2],fZP2EqualCoeff[3],fZP2EqualCoeff[4]); |
dcf60b09 | 153 | |
ea628de7 | 154 | printf("\n\n ####### Parameters from EZDC vs. ZEM correlation ####### \n"); |
646f1679 | 155 | printf(" ZEMEndPoint = %1.2f, ZEMCutFraction = %1.2f \n" |
ea628de7 | 156 | " DZEMInf = %1.2f, DZEMSup = %1.2f\n", |
646f1679 | 157 | fZEMEndValue, fZEMCutFraction, fDZEMInf, fDZEMSup); |
158 | ||
ea628de7 | 159 | printf("\n\n ####### Parameters from EZDC vs. Nspec correlation ####### \n"); |
646f1679 | 160 | printf(" EZN1MaxValue = %1.2f, EZP1MaxValue = %1.2f, EZDC1MaxValue = %1.2f \n" |
161 | " EZN2MaxValue = %1.2f, EZP2MaxValue = %1.2f, EZDC2MaxValue = %1.2f \n\n", | |
162 | fEZN1MaxValue, fEZP1MaxValue, fEZDC1MaxValue, | |
163 | fEZN2MaxValue, fEZP2MaxValue, fEZDC2MaxValue); | |
164 | ||
8af17dba | 165 | } |
166 | ||
167 | //________________________________________________________________ | |
168 | void AliZDCCalibData::SetMeanPed(Float_t* MeanPed) | |
169 | { | |
83347831 | 170 | if(MeanPed) for(int t=0; t<48; t++) fMeanPedestal[t] = MeanPed[t]; |
171 | else for(int t=0; t<48; t++) fMeanPedestal[t] = 0.; | |
72bde173 | 172 | } |
8831501a | 173 | //________________________________________________________________ |
174 | void AliZDCCalibData::SetMeanPedWidth(Float_t* MeanPedWidth) | |
175 | { | |
83347831 | 176 | if(MeanPedWidth) for(int t=0; t<48; t++) fMeanPedWidth[t] = MeanPedWidth[t]; |
177 | else for(int t=0; t<48; t++) fMeanPedWidth[t] = 0.; | |
8831501a | 178 | } |
72bde173 | 179 | |
180 | //________________________________________________________________ | |
181 | void AliZDCCalibData::SetOOTPed(Float_t* OOTPed) | |
182 | { | |
83347831 | 183 | if(OOTPed) for(int t=0; t<48; t++) fOOTPedestal[t] = OOTPed[t]; |
184 | else for(int t=0; t<48; t++) fOOTPedestal[t] = 0.; | |
8af17dba | 185 | } |
186 | ||
6a03966b | 187 | //________________________________________________________________ |
188 | void AliZDCCalibData::SetOOTPedWidth(Float_t* OOTPedWidth) | |
189 | { | |
83347831 | 190 | if(OOTPedWidth) for(int t=0; t<48; t++) fOOTPedWidth[t] = OOTPedWidth[t]; |
191 | else for(int t=0; t<48; t++) fOOTPedWidth[t] = 0.; | |
6a03966b | 192 | } |
193 | ||
8831501a | 194 | //________________________________________________________________ |
31af5828 | 195 | void AliZDCCalibData:: SetPedCorrCoeff(Float_t* PedCorrCoeff) |
196 | { | |
197 | // Set coefficients for pedestal correlations | |
198 | if(PedCorrCoeff){ | |
199 | for(Int_t j=0; j<2; j++){ | |
83347831 | 200 | for(int t=0; t<48; t++) |
31af5828 | 201 | fPedCorrCoeff[j][t] = PedCorrCoeff[t]; |
202 | } | |
203 | } | |
204 | else{ | |
205 | for(Int_t j=0; j<2; j++){ | |
83347831 | 206 | for(int t=0; t<48; t++) |
31af5828 | 207 | fPedCorrCoeff[j][t] = 0.; |
208 | } | |
209 | } | |
210 | ||
211 | } | |
212 | ||
213 | //________________________________________________________________ | |
214 | void AliZDCCalibData:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1) | |
8831501a | 215 | { |
8a2624cc | 216 | // Set coefficients for pedestal correlations |
31af5828 | 217 | if(PedCorrCoeff0 && PedCorrCoeff1){ |
83347831 | 218 | for(int t=0; t<48; t++){ |
31af5828 | 219 | fPedCorrCoeff[0][t] = PedCorrCoeff0[t]; |
220 | fPedCorrCoeff[0][t] = PedCorrCoeff1[t]; | |
221 | } | |
8831501a | 222 | } |
31af5828 | 223 | else{ |
83347831 | 224 | for(int t=0; t<48; t++){ |
31af5828 | 225 | fPedCorrCoeff[0][t] = 0.; |
226 | fPedCorrCoeff[1][t] = 0.; | |
227 | } | |
8831501a | 228 | } |
31af5828 | 229 | |
8831501a | 230 | } |
231 | ||
8af17dba | 232 | //________________________________________________________________ |
233 | void AliZDCCalibData::SetEnCalib(Float_t* EnCalib) | |
234 | { | |
31af5828 | 235 | // Set energy calibration coefficients |
72bde173 | 236 | if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t]; |
237 | else for(int t=0; t<6; t++) fEnCalibration[t] = 0.; | |
8af17dba | 238 | } |
239 | ||
6cd02eaf | 240 | //________________________________________________________________ |
241 | void AliZDCCalibData::SetZN1EqualCoeff(Float_t* EqualCoeff) | |
242 | { | |
243 | // Set ZN1 equalization coefficients | |
244 | if(EqualCoeff) for(int t=0; t<5; t++) fZN1EqualCoeff[t] = EqualCoeff[t]; | |
245 | else for(int t=0; t<5; t++) fZN1EqualCoeff[t] = 1.; | |
246 | } | |
247 | ||
248 | //________________________________________________________________ | |
249 | void AliZDCCalibData::SetZP1EqualCoeff(Float_t* EqualCoeff) | |
250 | { | |
251 | // Set ZP1 equalization coefficients | |
252 | if(EqualCoeff) for(int t=0; t<5; t++) fZP1EqualCoeff[t] = EqualCoeff[t]; | |
253 | else for(int t=0; t<5; t++) fZP1EqualCoeff[t] = 1.; | |
254 | } | |
255 | //________________________________________________________________ | |
256 | void AliZDCCalibData::SetZN2EqualCoeff(Float_t* EqualCoeff) | |
257 | { | |
258 | // Set ZN2 equalization coefficients | |
259 | if(EqualCoeff) for(int t=0; t<5; t++) fZN2EqualCoeff[t] = EqualCoeff[t]; | |
260 | else for(int t=0; t<5; t++) fZN2EqualCoeff[t] = 1.; | |
261 | } | |
262 | ||
263 | //________________________________________________________________ | |
264 | void AliZDCCalibData::SetZP2EqualCoeff(Float_t* EqualCoeff) | |
265 | { | |
266 | // Set ZN1 equalization coefficients | |
267 | if(EqualCoeff) for(int t=0; t<5; t++) fZP2EqualCoeff[t] = EqualCoeff[t]; | |
268 | else for(int t=0; t<5; t++) fZP2EqualCoeff[t] = 1.; | |
269 | } | |
270 |