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 -> values for pedestal subtraction //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliZDCPedestals.h"
26 ClassImp(AliZDCPedestals)
28 //________________________________________________________________
29 AliZDCPedestals::AliZDCPedestals():
35 //________________________________________________________________
36 AliZDCPedestals::AliZDCPedestals(const char* name):
40 TString namst = "Calib_";
42 SetName(namst.Data());
43 SetTitle(namst.Data());
45 for(Int_t i=0; i<48; i++){
46 fMeanPedestal[i] = 0.;
47 fMeanPedWidth[i] = 0.;
50 for(Int_t j=0; j<2; j++) fPedCorrCoeff[j][i] = 0.;
56 //________________________________________________________________
57 AliZDCPedestals::AliZDCPedestals(const AliZDCPedestals& calibda) :
61 SetName(calibda.GetName());
62 SetTitle(calibda.GetName());
64 for(int t=0; t<48; t++){
65 fMeanPedestal[t] = calibda.GetMeanPed(t);
66 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
67 fOOTPedestal[t] = calibda.GetOOTPed(t);
68 fOOTPedWidth[t] = calibda.GetOOTPedWidth(t);
69 fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
70 fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
74 //________________________________________________________________
75 AliZDCPedestals &AliZDCPedestals::operator =(const AliZDCPedestals& calibda)
77 // assignment operator
78 SetName(calibda.GetName());
79 SetTitle(calibda.GetName());
81 for(int t=0; t<48; t++){
82 fMeanPedestal[t] = calibda.GetMeanPed(t);
83 fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
84 fOOTPedestal[t] = calibda.GetOOTPed(t);
85 fOOTPedWidth[t] = calibda.GetOOTPedWidth(t);
86 fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
87 fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
93 //________________________________________________________________
94 AliZDCPedestals::~AliZDCPedestals()
98 //________________________________________________________________
99 void AliZDCPedestals::Reset()
102 memset(fMeanPedestal,0,48*sizeof(Float_t));
103 memset(fMeanPedWidth,0,48*sizeof(Float_t));
104 memset(fOOTPedestal,0,48*sizeof(Float_t));
105 memset(fOOTPedWidth,0,48*sizeof(Float_t));
109 //________________________________________________________________
110 void AliZDCPedestals::Print(Option_t *) const
112 // Printing of calibration object
113 printf("\n ####### In-time pedestal values (mean value, sigma) ####### \n");
114 for(int t=0; t<48; t++)
115 printf("\t ADC%d (%.1f, %.1f)\n",t,fMeanPedestal[t],fMeanPedWidth[t]);
117 printf("\n\n ####### Out-of-time pedestal values (mean value, sigma) ####### \n");
118 for(int t=0; t<48; t++)
119 printf("\t ADC-OoT%d (%.1f, %.1f)\n",t,fOOTPedestal[t],fOOTPedWidth[t]);
123 //________________________________________________________________
124 void AliZDCPedestals::SetMeanPed(Float_t* MeanPed)
126 if(MeanPed) for(int t=0; t<48; t++) fMeanPedestal[t] = MeanPed[t];
127 else for(int t=0; t<48; t++) fMeanPedestal[t] = 0.;
129 //________________________________________________________________
130 void AliZDCPedestals::SetMeanPedWidth(Float_t* MeanPedWidth)
132 if(MeanPedWidth) for(int t=0; t<48; t++) fMeanPedWidth[t] = MeanPedWidth[t];
133 else for(int t=0; t<48; t++) fMeanPedWidth[t] = 0.;
136 //________________________________________________________________
137 void AliZDCPedestals::SetOOTPed(Float_t* OOTPed)
139 if(OOTPed) for(int t=0; t<48; t++) fOOTPedestal[t] = OOTPed[t];
140 else for(int t=0; t<48; t++) fOOTPedestal[t] = 0.;
143 //________________________________________________________________
144 void AliZDCPedestals::SetOOTPedWidth(Float_t* OOTPedWidth)
146 if(OOTPedWidth) for(int t=0; t<48; t++) fOOTPedWidth[t] = OOTPedWidth[t];
147 else for(int t=0; t<48; t++) fOOTPedWidth[t] = 0.;
150 //________________________________________________________________
151 void AliZDCPedestals:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
153 // Set coefficients for pedestal correlations
155 for(Int_t j=0; j<2; j++){
156 for(int t=0; t<48; t++)
157 fPedCorrCoeff[j][t] = PedCorrCoeff[t];
161 for(Int_t j=0; j<2; j++){
162 for(int t=0; t<48; t++)
163 fPedCorrCoeff[j][t] = 0.;
169 //________________________________________________________________
170 void AliZDCPedestals:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
172 // Set coefficients for pedestal correlations
173 if(PedCorrCoeff0 && PedCorrCoeff1){
174 for(int t=0; t<48; t++){
175 fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
176 fPedCorrCoeff[1][t] = PedCorrCoeff1[t];
180 for(int t=0; t<48; t++){
181 fPedCorrCoeff[0][t] = 0.;
182 fPedCorrCoeff[1][t] = 0.;