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 //
21 // -> values for energy calibration and relative sector calibration //
23 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliZDCCalib.h"
29 //________________________________________________________________
30 AliZDCCalib::AliZDCCalib():
36 //________________________________________________________________
37 AliZDCCalib::AliZDCCalib(const char* name):
41 TString namst = "Calib_";
43 SetName(namst.Data());
44 SetTitle(namst.Data());
46 for(Int_t i=0; i<6; i++){
47 fEnCalibration[i] = 0.;
49 fZN1EqualCoeff[i] = 0.;
50 fZP1EqualCoeff[i] = 0.;
51 fZN2EqualCoeff[i] = 0.;
52 fZP2EqualCoeff[i] = 0.;
57 //________________________________________________________________
58 AliZDCCalib::AliZDCCalib(const AliZDCCalib& calibda) :
62 SetName(calibda.GetName());
63 SetTitle(calibda.GetName());
65 for(int i=0; i<6; i++){
66 fEnCalibration[i] = calibda.GetEnCalib(i);
68 fZN1EqualCoeff[i] = calibda.GetZN1EqualCoeff(i);
69 fZP1EqualCoeff[i] = calibda.GetZP1EqualCoeff(i);
70 fZN2EqualCoeff[i] = calibda.GetZN2EqualCoeff(i);
71 fZP2EqualCoeff[i] = calibda.GetZP2EqualCoeff(i);
76 //________________________________________________________________
77 AliZDCCalib &AliZDCCalib::operator =(const AliZDCCalib& calibda)
79 // assignment operator
80 SetName(calibda.GetName());
81 SetTitle(calibda.GetName());
83 for(int i=0; i<6; i++){
84 fEnCalibration[i] = calibda.GetEnCalib(i);
86 fZN1EqualCoeff[i] = calibda.GetZN1EqualCoeff(i);
87 fZP1EqualCoeff[i] = calibda.GetZP1EqualCoeff(i);
88 fZN2EqualCoeff[i] = calibda.GetZN2EqualCoeff(i);
89 fZP2EqualCoeff[i] = calibda.GetZP2EqualCoeff(i);
96 //________________________________________________________________
97 AliZDCCalib::~AliZDCCalib()
101 //________________________________________________________________
102 void AliZDCCalib::Reset()
105 memset(fEnCalibration,0,6*sizeof(Float_t));
106 memset(fZN1EqualCoeff,0,5*sizeof(Float_t));
107 memset(fZP1EqualCoeff,0,5*sizeof(Float_t));
108 memset(fZN2EqualCoeff,0,5*sizeof(Float_t));
109 memset(fZP2EqualCoeff,0,5*sizeof(Float_t));
113 //________________________________________________________________
114 void AliZDCCalib::Print(Option_t *) const
116 // Printing of calibration object
117 printf("\n\n ####### Energy calibration coefficients ####### \n");
118 printf(" ZN1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[0]);
119 printf(" ZP1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[1]);
120 printf(" ZN2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[2]);
121 printf(" ZP2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[3]);
122 printf(" ZEM1 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[4]);
123 printf(" ZEM2 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[5]);
125 printf("\n\n ####### Equalization coefficients ####### \n");
126 printf(" ZN1 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n",
127 fZN1EqualCoeff[0],fZN1EqualCoeff[1],fZN1EqualCoeff[2],fZN1EqualCoeff[3],fZN1EqualCoeff[4]);
128 printf(" ZP1 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n",
129 fZP1EqualCoeff[0],fZP1EqualCoeff[1],fZP1EqualCoeff[2],fZP1EqualCoeff[3],fZP1EqualCoeff[4]);
130 printf(" ZN2 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n",
131 fZN2EqualCoeff[0],fZN2EqualCoeff[1],fZN2EqualCoeff[2],fZN2EqualCoeff[3],fZN2EqualCoeff[4]);
132 printf(" ZP2 -> %1.2f %1.2f %1.2f %1.2f %1.2f \n",
133 fZP2EqualCoeff[0],fZP2EqualCoeff[1],fZP2EqualCoeff[2],fZP2EqualCoeff[3],fZP2EqualCoeff[4]);
137 //________________________________________________________________
138 void AliZDCCalib::SetEnCalib(Float_t* EnCalib)
140 // Set energy calibration coefficients
141 if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
142 else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
145 //________________________________________________________________
146 void AliZDCCalib::SetZN1EqualCoeff(Float_t* EqualCoeff)
148 // Set ZN1 equalization coefficients
149 if(EqualCoeff) for(int t=0; t<5; t++) fZN1EqualCoeff[t] = EqualCoeff[t];
150 else for(int t=0; t<5; t++) fZN1EqualCoeff[t] = 1.;
153 //________________________________________________________________
154 void AliZDCCalib::SetZP1EqualCoeff(Float_t* EqualCoeff)
156 // Set ZP1 equalization coefficients
157 if(EqualCoeff) for(int t=0; t<5; t++) fZP1EqualCoeff[t] = EqualCoeff[t];
158 else for(int t=0; t<5; t++) fZP1EqualCoeff[t] = 1.;
160 //________________________________________________________________
161 void AliZDCCalib::SetZN2EqualCoeff(Float_t* EqualCoeff)
163 // Set ZN2 equalization coefficients
164 if(EqualCoeff) for(int t=0; t<5; t++) fZN2EqualCoeff[t] = EqualCoeff[t];
165 else for(int t=0; t<5; t++) fZN2EqualCoeff[t] = 1.;
168 //________________________________________________________________
169 void AliZDCCalib::SetZP2EqualCoeff(Float_t* EqualCoeff)
171 // Set ZN1 equalization coefficients
172 if(EqualCoeff) for(int t=0; t<5; t++) fZP2EqualCoeff[t] = EqualCoeff[t];
173 else for(int t=0; t<5; t++) fZP2EqualCoeff[t] = 1.;