]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDCRecParam.cxx
Monalisa configuration added: host and table name
[u/mrichter/AliRoot.git] / ZDC / AliZDCRecParam.cxx
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 "AliZDCRecParam.h"
25
26 ClassImp(AliZDCRecParam)
27
28 //________________________________________________________________
29 AliZDCRecParam::AliZDCRecParam():
30 TNamed()
31 {
32   Reset();
33 }
34
35 //________________________________________________________________
36 AliZDCRecParam::AliZDCRecParam(const char* name):
37 TNamed(),
38 fZEMEndValue(0),
39 fZEMCutFraction(0),
40 fDZEMSup(0),
41 fDZEMInf(0),
42 fEZN1MaxValue(0),
43 fEZP1MaxValue(0),
44 fEZDC1MaxValue(0),
45 fEZN2MaxValue(0),
46 fEZP2MaxValue(0),
47 fEZDC2MaxValue(0)
48 {
49   // Constructor
50   TString namst = "Calib_";
51   namst += name;
52   SetName(namst.Data());
53   SetTitle(namst.Data());
54   Reset();
55 }
56
57 //________________________________________________________________
58 AliZDCRecParam::AliZDCRecParam(const AliZDCRecParam& calibda) :
59   TNamed(calibda)
60 {
61   // Copy constructor
62   SetName(calibda.GetName());
63   SetTitle(calibda.GetName());
64   Reset();
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);
72   }
73   for(int t=0; t<6; t++)  fEnCalibration[t] = calibda.GetEnCalib(t);
74   //
75   fZEMEndValue    = calibda.GetZEMEndValue();   
76   fZEMCutFraction = calibda.GetZEMCutFraction();
77   fDZEMSup        = calibda.GetDZEMSup();
78   fDZEMInf        = calibda.GetDZEMInf();
79 }
80
81 //________________________________________________________________
82 AliZDCRecParam &AliZDCRecParam::operator =(const AliZDCRecParam& calibda)
83 {
84 // assignment operator
85   SetName(calibda.GetName());
86   SetTitle(calibda.GetName());
87   Reset();
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);
95   }
96   for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
97   fZEMEndValue    = calibda.GetZEMEndValue();
98   fZEMCutFraction = calibda.GetZEMCutFraction();
99
100   return *this;
101 }
102
103 //________________________________________________________________
104 AliZDCRecParam::~AliZDCRecParam()
105 {
106 }
107
108 //________________________________________________________________
109 void AliZDCRecParam::Reset()
110 {
111   // 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));
121 }                                                                                       
122
123
124 //________________________________________________________________
125 void  AliZDCRecParam::Print(Option_t *) const
126 {
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);
132  
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);
138
139
140
141 //________________________________________________________________
142 void AliZDCRecParam::SetMeanPed(Float_t* MeanPed)
143 {
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.;
146 }
147 //________________________________________________________________
148 void AliZDCRecParam::SetMeanPedWidth(Float_t* MeanPedWidth)
149 {
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.;
152 }
153
154 //________________________________________________________________
155 void AliZDCRecParam::SetOOTPed(Float_t* OOTPed)
156 {
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.;
159 }
160
161 //________________________________________________________________
162 void AliZDCRecParam::SetOOTPedWidth(Float_t* OOTPedWidth)
163 {
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.;
166 }
167
168 //________________________________________________________________
169 void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
170 {
171   // Set coefficients for pedestal correlations
172   if(PedCorrCoeff){
173     for(Int_t j=0; j<2; j++){
174      for(int t=0; t<48; t++)
175        fPedCorrCoeff[j][t] = PedCorrCoeff[t];
176     }
177   }
178   else{
179     for(Int_t j=0; j<2; j++){
180      for(int t=0; t<48; t++)
181        fPedCorrCoeff[j][t] = 0.;
182     }
183   }
184  
185 }
186
187 //________________________________________________________________
188 void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
189 {
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];
195     }
196   }
197   else{
198      for(int t=0; t<48; t++){
199        fPedCorrCoeff[0][t] = 0.;
200        fPedCorrCoeff[1][t] = 0.;
201     }
202   }
203  
204 }
205
206 //________________________________________________________________
207 void AliZDCRecParam::SetEnCalib(Float_t* EnCalib) 
208 {
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.;
212 }
213
214 //________________________________________________________________
215 void AliZDCRecParam::SetZN1EqualCoeff(Float_t* EqualCoeff)
216 {
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.;
220 }
221  
222 //________________________________________________________________
223 void AliZDCRecParam::SetZP1EqualCoeff(Float_t* EqualCoeff)
224 {
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.;
228 }
229 //________________________________________________________________
230 void AliZDCRecParam::SetZN2EqualCoeff(Float_t* EqualCoeff)
231 {
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.;
235 }
236  
237 //________________________________________________________________
238 void AliZDCRecParam::SetZP2EqualCoeff(Float_t* EqualCoeff)
239 {
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.;
243 }
244