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