1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for ZDC calibration //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliZDCRecParam.h"
26 ClassImp(AliZDCRecParam)
28 //________________________________________________________________
29 AliZDCRecParam::AliZDCRecParam():
35 //________________________________________________________________
36 AliZDCRecParam::AliZDCRecParam(const char* name):
50 TString namst = "Calib_";
52 SetName(namst.Data());
53 SetTitle(namst.Data());
57 //________________________________________________________________
58 AliZDCRecParam::AliZDCRecParam(const AliZDCRecParam& calibda) :
62 SetName(calibda.GetName());
63 SetTitle(calibda.GetName());
65 for(int t=0; t<48; t++){
66 fMeanPedestal[t] = calibda.GetMeanPed(t);
67 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
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);
73 for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
75 fZEMEndValue = calibda.GetZEMEndValue();
76 fZEMCutFraction = calibda.GetZEMCutFraction();
77 fDZEMSup = calibda.GetDZEMSup();
78 fDZEMInf = calibda.GetDZEMInf();
81 //________________________________________________________________
82 AliZDCRecParam &AliZDCRecParam::operator =(const AliZDCRecParam& calibda)
84 // assignment operator
85 SetName(calibda.GetName());
86 SetTitle(calibda.GetName());
88 for(int t=0; t<48; t++){
89 fMeanPedestal[t] = calibda.GetMeanPed(t);
90 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
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);
96 for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
97 fZEMEndValue = calibda.GetZEMEndValue();
98 fZEMCutFraction = calibda.GetZEMCutFraction();
103 //________________________________________________________________
104 AliZDCRecParam::~AliZDCRecParam()
108 //________________________________________________________________
109 void AliZDCRecParam::Reset()
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));
116 memset(fEnCalibration,0,6*sizeof(Float_t));
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));
124 //________________________________________________________________
125 void AliZDCRecParam::Print(Option_t *) const
127 // Printing calibration object
128 printf("\n\n ####### Parameters from EZDC vs. ZEM correlation ####### \n");
129 printf(" ZEMEndPoint = %1.2f, ZEMCutFraction = %1.2f \n"
130 " DZEMInf = %1.2f, DZEMSup = %1.2f\n",
131 fZEMEndValue, fZEMCutFraction, fDZEMInf, fDZEMSup);
133 printf("\n\n ####### Parameters from EZDC vs. Nspec correlation ####### \n");
134 printf(" EZN1MaxValue = %1.2f, EZP1MaxValue = %1.2f, EZDC1MaxValue = %1.2f \n"
135 " EZN2MaxValue = %1.2f, EZP2MaxValue = %1.2f, EZDC2MaxValue = %1.2f \n\n",
136 fEZN1MaxValue, fEZP1MaxValue, fEZDC1MaxValue,
137 fEZN2MaxValue, fEZP2MaxValue, fEZDC2MaxValue);
141 //________________________________________________________________
142 void AliZDCRecParam::SetMeanPed(Float_t* MeanPed)
144 if(MeanPed) for(int t=0; t<48; t++) fMeanPedestal[t] = MeanPed[t];
145 else for(int t=0; t<48; t++) fMeanPedestal[t] = 0.;
147 //________________________________________________________________
148 void AliZDCRecParam::SetMeanPedWidth(Float_t* MeanPedWidth)
150 if(MeanPedWidth) for(int t=0; t<48; t++) fMeanPedWidth[t] = MeanPedWidth[t];
151 else for(int t=0; t<48; t++) fMeanPedWidth[t] = 0.;
154 //________________________________________________________________
155 void AliZDCRecParam::SetOOTPed(Float_t* OOTPed)
157 if(OOTPed) for(int t=0; t<48; t++) fOOTPedestal[t] = OOTPed[t];
158 else for(int t=0; t<48; t++) fOOTPedestal[t] = 0.;
161 //________________________________________________________________
162 void AliZDCRecParam::SetOOTPedWidth(Float_t* OOTPedWidth)
164 if(OOTPedWidth) for(int t=0; t<48; t++) fOOTPedWidth[t] = OOTPedWidth[t];
165 else for(int t=0; t<48; t++) fOOTPedWidth[t] = 0.;
168 //________________________________________________________________
169 void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
171 // Set coefficients for pedestal correlations
173 for(Int_t j=0; j<2; j++){
174 for(int t=0; t<48; t++)
175 fPedCorrCoeff[j][t] = PedCorrCoeff[t];
179 for(Int_t j=0; j<2; j++){
180 for(int t=0; t<48; t++)
181 fPedCorrCoeff[j][t] = 0.;
187 //________________________________________________________________
188 void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
190 // Set coefficients for pedestal correlations
191 if(PedCorrCoeff0 && PedCorrCoeff1){
192 for(int t=0; t<48; t++){
193 fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
194 fPedCorrCoeff[0][t] = PedCorrCoeff1[t];
198 for(int t=0; t<48; t++){
199 fPedCorrCoeff[0][t] = 0.;
200 fPedCorrCoeff[1][t] = 0.;
206 //________________________________________________________________
207 void AliZDCRecParam::SetEnCalib(Float_t* EnCalib)
209 // Set energy calibration coefficients
210 if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
211 else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
214 //________________________________________________________________
215 void AliZDCRecParam::SetZN1EqualCoeff(Float_t* EqualCoeff)
217 // Set ZN1 equalization coefficients
218 if(EqualCoeff) for(int t=0; t<5; t++) fZN1EqualCoeff[t] = EqualCoeff[t];
219 else for(int t=0; t<5; t++) fZN1EqualCoeff[t] = 1.;
222 //________________________________________________________________
223 void AliZDCRecParam::SetZP1EqualCoeff(Float_t* EqualCoeff)
225 // Set ZP1 equalization coefficients
226 if(EqualCoeff) for(int t=0; t<5; t++) fZP1EqualCoeff[t] = EqualCoeff[t];
227 else for(int t=0; t<5; t++) fZP1EqualCoeff[t] = 1.;
229 //________________________________________________________________
230 void AliZDCRecParam::SetZN2EqualCoeff(Float_t* EqualCoeff)
232 // Set ZN2 equalization coefficients
233 if(EqualCoeff) for(int t=0; t<5; t++) fZN2EqualCoeff[t] = EqualCoeff[t];
234 else for(int t=0; t<5; t++) fZN2EqualCoeff[t] = 1.;
237 //________________________________________________________________
238 void AliZDCRecParam::SetZP2EqualCoeff(Float_t* EqualCoeff)
240 // Set ZN1 equalization coefficients
241 if(EqualCoeff) for(int t=0; t<5; t++) fZP2EqualCoeff[t] = EqualCoeff[t];
242 else for(int t=0; t<5; t++) fZP2EqualCoeff[t] = 1.;