Coding rule violations corrected.
[u/mrichter/AliRoot.git] / VZERO / AliVZEROCalibData.cxx
CommitLineData
3191f471 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: AliVZEROCalibData.cxx, */
17
18/////////////////////////////////////////////////////////////////////////////
19// //
20// class for VZERO calibration //
21// //
22/////////////////////////////////////////////////////////////////////////////
23
706506da 24#include <TMath.h>
25
3191f471 26#include "AliVZEROCalibData.h"
27
28ClassImp(AliVZEROCalibData)
29
30//________________________________________________________________
31AliVZEROCalibData::AliVZEROCalibData()
32{
d7a5c700 33 //
3191f471 34}
35
a3c86e1f 36//________________________________________________________________
37void AliVZEROCalibData::Reset()
38{
d7a5c700 39 // reset
a3c86e1f 40}
41
3191f471 42//________________________________________________________________
43AliVZEROCalibData::AliVZEROCalibData(const char* name)
44{
45 TString namst = "Calib_";
46 namst += name;
47 SetName(namst.Data());
48 SetTitle(namst.Data());
49
50}
51
52//________________________________________________________________
53AliVZEROCalibData::AliVZEROCalibData(const AliVZEROCalibData& calibda) :
54 TNamed(calibda)
55{
56// copy constructor
57
58 SetName(calibda.GetName());
59 SetTitle(calibda.GetName());
60
fae0e0c0 61 for(int t=0; t<128; t++) {
3191f471 62 fPedestal[t] = calibda.GetPedestal(t);
fae0e0c0 63 fSigma[t] = calibda.GetSigma(t);
2a25ea57 64 fADCmean[t] = calibda.GetADCmean(t);
65 fADCsigma[t] = calibda.GetADCsigma(t);
66 fGain[t] = calibda.GetGain(t); }
fae0e0c0 67
68 for(int t=0; t<64; t++) {
d7a5c700 69 fMeanHV[t] = calibda.GetMeanHV(t);
2a25ea57 70 fWidthHV[t] = calibda.GetWidthHV(t);
71 fTimeOffset[t] = calibda.GetTimeOffset(t);
72 fTimeGain[t] = calibda.GetTimeGain(t); }
3191f471 73
74}
75
76//________________________________________________________________
77AliVZEROCalibData &AliVZEROCalibData::operator =(const AliVZEROCalibData& calibda)
78{
79// assignment operator
80
81 SetName(calibda.GetName());
82 SetTitle(calibda.GetName());
83
fae0e0c0 84 for(int t=0; t<128; t++) {
3191f471 85 fPedestal[t] = calibda.GetPedestal(t);
fae0e0c0 86 fSigma[t] = calibda.GetSigma(t);
2a25ea57 87 fADCmean[t] = calibda.GetADCmean(t);
40b6a179 88 fADCsigma[t] = calibda.GetADCsigma(t);
2a25ea57 89 fGain[t] = calibda.GetGain(t); }
fae0e0c0 90
2a25ea57 91 for(int t=0; t<64; t++) {
d7a5c700 92 fMeanHV[t] = calibda.GetMeanHV(t);
2a25ea57 93 fWidthHV[t] = calibda.GetWidthHV(t);
94 fTimeOffset[t] = calibda.GetTimeOffset(t);
95 fTimeGain[t] = calibda.GetTimeGain(t); }
96
3191f471 97 return *this;
98
99}
100
101//________________________________________________________________
102AliVZEROCalibData::~AliVZEROCalibData()
103{
d7a5c700 104 // destructor
3191f471 105}
106
3191f471 107//________________________________________________________________
108void AliVZEROCalibData::SetPedestal(Float_t* Pedestal)
109{
fae0e0c0 110 if(Pedestal) for(int t=0; t<128; t++) fPedestal[t] = Pedestal[t];
111 else for(int t=0; t<128; t++) fPedestal[t] = 0.0;
112}
113
114//________________________________________________________________
115void AliVZEROCalibData::SetSigma(Float_t* Sigma)
116{
117 if(Sigma) for(int t=0; t<128; t++) fSigma[t] = Sigma[t];
118 else for(int t=0; t<128; t++) fSigma[t] = 0.0;
3191f471 119}
120
121//________________________________________________________________
2a25ea57 122void AliVZEROCalibData::SetADCmean(Float_t* ADCmean)
3191f471 123{
2a25ea57 124 if(ADCmean) for(int t=0; t<128; t++) fADCmean[t] = ADCmean[t];
125 else for(int t=0; t<128; t++) fADCmean[t] = 0.0;
3191f471 126}
127
40b6a179 128//________________________________________________________________
129void AliVZEROCalibData::SetADCsigma(Float_t* ADCsigma)
130{
131 if(ADCsigma) for(int t=0; t<128; t++) fADCsigma[t] = ADCsigma[t];
132 else for(int t=0; t<128; t++) fADCsigma[t] = 0.0;
133}
134
fae0e0c0 135//________________________________________________________________
2a25ea57 136void AliVZEROCalibData::SetMeanHV(Float_t* MeanHV)
fae0e0c0 137{
2a25ea57 138 if(MeanHV) for(int t=0; t<64; t++) fMeanHV[t] = MeanHV[t];
139 else for(int t=0; t<64; t++) fMeanHV[t] = 0.0;
fae0e0c0 140}
141
142//________________________________________________________________
2a25ea57 143void AliVZEROCalibData::SetWidthHV(Float_t* WidthHV)
fae0e0c0 144{
2a25ea57 145 if(WidthHV) for(int t=0; t<64; t++) fWidthHV[t] = WidthHV[t];
146 else for(int t=0; t<64; t++) fWidthHV[t] = 0.0;
fae0e0c0 147}
d7a5c700 148
149//________________________________________________________________
2a25ea57 150void AliVZEROCalibData::SetGain(Float_t* Gain)
d7a5c700 151{
2a25ea57 152 if(Gain) for(int t=0; t<128; t++) fGain[t] = Gain[t];
153 else for(int t=0; t<128; t++) fGain[t] = 0.0;
d7a5c700 154}
155
156//________________________________________________________________
2a25ea57 157void AliVZEROCalibData::SetTimeOffset(Float_t* TimeOffset)
d7a5c700 158{
2a25ea57 159 if(TimeOffset) for(int t=0; t<64; t++) fTimeOffset[t] = TimeOffset[t];
160 else for(int t=0; t<64; t++) fTimeOffset[t] = 0.0;
d7a5c700 161}
2a25ea57 162
163//________________________________________________________________
164void AliVZEROCalibData::SetTimeGain(Float_t* TimeGain)
165{
166 if(TimeGain) for(int t=0; t<64; t++) fTimeGain[t] = TimeGain[t];
167 else for(int t=0; t<64; t++) fTimeGain[t] = 0.0;
168}
169
706506da 170//_____________________________________________________________________________
171Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const {
172
173 // Computes the MIP conversion factor - MIP per ADC channel -
174 // Argument passed is the PM number (aliroot numbering)
175
176 Float_t P0[64] = {
177 7.094891, 7.124938, 7.089708, 7.098169, 7.094482, 7.147250, 7.170978, 7.183392,
178 7.145760, 7.148096, 7.153840, 7.143544, 7.186069, 7.194580, 7.203516, 7.195176,
179 7.188333, 7.198607, 7.209412, 7.226565, 7.221695, 7.205132, 7.191238, 7.227724,
180 7.232810, 7.252655, 7.230309, 7.273518, 7.273518, 7.242969, 7.252859, 7.252655,
181 7.026802, 7.079913, 7.134147, 7.092387, 7.079561, 7.072848, 7.123192, 7.003141,
182 7.024667, 7.124784, 7.123442, 7.129744, 7.110671, 7.143031, 7.139439, 7.178109,
183 7.247803, 7.139396, 7.293809, 7.094454, 6.992198, 7.206448, 7.244765, 7.056197,
184 7.263595, 7.138569, 7.089582, 7.215683, 7.266183, 7.165123, 7.243276, 7.235135 };
185 Float_t P1[64] = {
186 0.135569, 0.146405, 0.142425, 0.144278, 0.142307, 0.141648, 0.128477, 0.138239,
187 0.144173, 0.143419, 0.143572, 0.144482, 0.138024, 0.136542, 0.135955, 0.138537,
188 0.148521, 0.141999, 0.139627, 0.130014, 0.134970, 0.135635, 0.139094, 0.140634,
189 0.137971, 0.142080, 0.142793, 0.142778, 0.142778, 0.146045, 0.139133, 0.142080,
190 0.144121, 0.142311, 0.136564, 0.142686, 0.138792, 0.166285, 0.136387, 0.155391,
191 0.176082, 0.140408, 0.164738, 0.144270, 0.142766, 0.147486, 0.141951, 0.138012,
192 0.132394, 0.142849, 0.140477, 0.144592, 0.141558, 0.157646, 0.143758, 0.173385,
193 0.146489, 0.143279, 0.145230, 0.147203, 0.147333, 0.144979, 0.148597, 0.138985 };
194
195 // High Voltage retrieval from Calibration Data Base:
196 Float_t HV = fMeanHV[channel];
2f52e327 197 Float_t MIP = -1;
198 if (HV>0)
199 MIP = 0.5/TMath::Exp((TMath::Log(HV) - P0[channel] )/P1[channel]);
706506da 200 return MIP;
201
202}
203