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 "AliZDCCalibData.h"
26 ClassImp(AliZDCCalibData)
28 //________________________________________________________________
29 AliZDCCalibData::AliZDCCalibData()
35 //________________________________________________________________
36 AliZDCCalibData::AliZDCCalibData(const char* name)
39 TString namst = "Calib_";
41 SetName(namst.Data());
42 SetTitle(namst.Data());
47 //________________________________________________________________
48 AliZDCCalibData::AliZDCCalibData(const AliZDCCalibData& calibda) :
52 SetName(calibda.GetName());
53 SetTitle(calibda.GetName());
55 for(int t=0; t<47; t++){
56 fMeanPedestal[t] = calibda.GetMeanPed(t);
57 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
59 for(int t=0; t<44; t++){
60 fOOTPedestal[t] = calibda.GetOOTPed(t);
61 fOOTPedWidth[t] = calibda.GetOOTPedWidth(t);
62 fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
63 fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
65 for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
69 //________________________________________________________________
70 AliZDCCalibData &AliZDCCalibData::operator =(const AliZDCCalibData& calibda)
72 // assignment operator
73 SetName(calibda.GetName());
74 SetTitle(calibda.GetName());
76 for(int t=0; t<47; t++){
77 fMeanPedestal[t] = calibda.GetMeanPed(t);
78 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
80 for(int t=0; t<44; t++){
81 fOOTPedestal[t] = calibda.GetOOTPed(t);
82 fOOTPedWidth[t] = calibda.GetOOTPedWidth(t);
83 fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
84 fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
86 for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
91 //________________________________________________________________
92 AliZDCCalibData::~AliZDCCalibData()
97 //________________________________________________________________
98 void AliZDCCalibData::Reset()
101 memset(fMeanPedestal,0,47*sizeof(Float_t));
102 memset(fMeanPedWidth,0,47*sizeof(Float_t));
103 memset(fOOTPedestal,0,44*sizeof(Float_t));
104 memset(fOOTPedWidth,0,44*sizeof(Float_t));
105 memset(fEnCalibration,0,6*sizeof(Float_t));
109 //________________________________________________________________
110 void AliZDCCalibData::CleanHistos()
112 if (fHistMeanPed) delete fHistMeanPed; fHistMeanPed = 0;
115 //________________________________________________________________
116 void AliZDCCalibData::PrepHistos()
118 // CleanHistos(); // this gives a segm.viol!
119 Int_t kNChannels = 47;
120 Float_t kMaxPedVal = 47.;
121 TString hname = GetName(); hname += "_Pedestals";
122 fHistMeanPed = new TH1F(hname.Data(),hname.Data(),kNChannels,0.,kMaxPedVal);
123 for(int i=0; i<47; i++) fHistMeanPed->SetBinContent(i+1,GetMeanPed(i));
127 //________________________________________________________________
128 void AliZDCCalibData::Print(Option_t *) const
130 // Printing of calibration object
131 printf("\n ####### In-time pedestal values (mean value, sigma) ####### \n");
132 for(int t=0; t<44; t++){
133 if(t==0 || t==24) printf("\n-------- ZN HighRes -------- \n");
134 else if(t==5 || t==29) printf("\n-------- ZN LowRes -------- \n");
135 else if(t==10 || t==34) printf("\n-------- ZP HighRes -------- \n");
136 else if(t==15 || t==39) printf("\n-------- ZP LowRes -------- \n");
137 else if(t==20) printf("\n-------- ZEM1 HighRes -------- \n");
138 else if(t==21) printf("\n-------- ZEM1 LowRes -------- \n");
139 else if(t==22) printf("\n-------- ZEM2 HighRes -------- \n");
140 else if(t==23) printf("\n-------- ZEM2 LowRes -------- \n");
141 printf("ADC%d (%.1f, %.1f)\t",t,fMeanPedestal[t],fMeanPedWidth[t]);
144 printf("\n\n\n ####### Out-of-time pedestal values (mean value, sigma) ####### \n");
145 for(int t=0; t<44; t++){
146 if(t==0 || t==24) printf("\n-------- ZN HighRes -------- \n");
147 else if(t==5 || t==29) printf("\n-------- ZN LowRes -------- \n");
148 else if(t==10 || t==34) printf("\n-------- ZP HighRes -------- \n");
149 else if(t==15 || t==39) printf("\n-------- ZP LowRes -------- \n");
150 else if(t==20) printf("\n-------- ZEM1 HighRes -------- \n");
151 else if(t==21) printf("\n-------- ZEM1 LowRes -------- \n");
152 else if(t==22) printf("\n-------- ZEM2 HighRes -------- \n");
153 else if(t==23) printf("\n-------- ZEM2 LowRes -------- \n");
154 printf("ADC%d (%.1f, %.1f)\t",t,fOOTPedestal[t],fOOTPedWidth[t]);
157 printf("\n\n\n ####### Energy calibration coefficients ####### \n");
158 printf(" ZN1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[0]);
159 printf(" ZP1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[1]);
160 printf(" ZN2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[2]);
161 printf(" ZP2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[3]);
162 printf(" ZEM1 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[4]);
163 printf(" ZEM2 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[5]);
166 //________________________________________________________________
167 void AliZDCCalibData::SetMeanPed(Float_t* MeanPed)
169 if(MeanPed) for(int t=0; t<47; t++) fMeanPedestal[t] = MeanPed[t];
170 else for(int t=0; t<47; t++) fMeanPedestal[t] = 0.;
172 //________________________________________________________________
173 void AliZDCCalibData::SetMeanPedWidth(Float_t* MeanPedWidth)
175 if(MeanPedWidth) for(int t=0; t<47; t++) fMeanPedWidth[t] = MeanPedWidth[t];
176 else for(int t=0; t<47; t++) fMeanPedWidth[t] = 0.;
179 //________________________________________________________________
180 void AliZDCCalibData::SetOOTPed(Float_t* OOTPed)
182 if(OOTPed) for(int t=0; t<44; t++) fOOTPedestal[t] = OOTPed[t];
183 else for(int t=0; t<44; t++) fOOTPedestal[t] = 0.;
186 //________________________________________________________________
187 void AliZDCCalibData::SetOOTPedWidth(Float_t* OOTPedWidth)
189 if(OOTPedWidth) for(int t=0; t<44; t++) fOOTPedWidth[t] = OOTPedWidth[t];
190 else for(int t=0; t<44; t++) fOOTPedWidth[t] = 0.;
193 //________________________________________________________________
194 void AliZDCCalibData:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
196 // Set coefficients for pedestal correlations
198 for(Int_t j=0; j<2; j++){
199 for(int t=0; t<44; t++)
200 fPedCorrCoeff[j][t] = PedCorrCoeff[t];
204 for(Int_t j=0; j<2; j++){
205 for(int t=0; t<44; t++)
206 fPedCorrCoeff[j][t] = 0.;
212 //________________________________________________________________
213 void AliZDCCalibData:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
215 // Set coefficients for pedestal correlations
216 if(PedCorrCoeff0 && PedCorrCoeff1){
217 for(int t=0; t<44; t++){
218 fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
219 fPedCorrCoeff[0][t] = PedCorrCoeff1[t];
223 for(int t=0; t<44; t++){
224 fPedCorrCoeff[0][t] = 0.;
225 fPedCorrCoeff[1][t] = 0.;
231 //________________________________________________________________
232 void AliZDCCalibData::SetEnCalib(Float_t* EnCalib)
234 // Set energy calibration coefficients
235 if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
236 else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
239 //________________________________________________________________
240 void AliZDCCalibData::SetPMTHVVal(Float_t* HVVal)
242 // Set PMTs HV values
243 if(HVVal) for(int t=0; t<22; t++) fPMTHVVal[t] = HVVal[t];
244 else for(int t=0; t<22; t++) fPMTHVVal[t] = 0.;