]>
Commit | Line | Data |
---|---|---|
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 | ||
28 | ClassImp(AliVZEROCalibData) | |
29 | ||
30 | //________________________________________________________________ | |
31 | AliVZEROCalibData::AliVZEROCalibData() | |
32 | { | |
d7a5c700 | 33 | // |
3191f471 | 34 | } |
35 | ||
a3c86e1f | 36 | //________________________________________________________________ |
37 | void AliVZEROCalibData::Reset() | |
38 | { | |
d7a5c700 | 39 | // reset |
a3c86e1f | 40 | } |
41 | ||
3191f471 | 42 | //________________________________________________________________ |
43 | AliVZEROCalibData::AliVZEROCalibData(const char* name) | |
44 | { | |
45 | TString namst = "Calib_"; | |
46 | namst += name; | |
47 | SetName(namst.Data()); | |
48 | SetTitle(namst.Data()); | |
49 | ||
50 | } | |
51 | ||
52 | //________________________________________________________________ | |
53 | AliVZEROCalibData::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 | //________________________________________________________________ | |
77 | AliVZEROCalibData &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 | //________________________________________________________________ | |
102 | AliVZEROCalibData::~AliVZEROCalibData() | |
103 | { | |
d7a5c700 | 104 | // destructor |
3191f471 | 105 | } |
106 | ||
3191f471 | 107 | //________________________________________________________________ |
108 | void 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 | //________________________________________________________________ | |
115 | void 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 | 122 | void 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 | //________________________________________________________________ |
129 | void 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 | 136 | void 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 | 143 | void 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 | |
7495d2be | 149 | //________________________________________________________________ |
150 | void AliVZEROCalibData::SetDeadMap(Bool_t* deadMap) | |
151 | { | |
152 | if(deadMap) for(int t=0; t<64; t++) fDeadChannel[t] = deadMap[t]; | |
153 | else for(int t=0; t<64; t++) fDeadChannel[t] = kFALSE; | |
154 | } | |
155 | ||
d7a5c700 | 156 | //________________________________________________________________ |
2a25ea57 | 157 | void AliVZEROCalibData::SetGain(Float_t* Gain) |
d7a5c700 | 158 | { |
2a25ea57 | 159 | if(Gain) for(int t=0; t<128; t++) fGain[t] = Gain[t]; |
160 | else for(int t=0; t<128; t++) fGain[t] = 0.0; | |
d7a5c700 | 161 | } |
162 | ||
163 | //________________________________________________________________ | |
2a25ea57 | 164 | void AliVZEROCalibData::SetTimeOffset(Float_t* TimeOffset) |
d7a5c700 | 165 | { |
2a25ea57 | 166 | if(TimeOffset) for(int t=0; t<64; t++) fTimeOffset[t] = TimeOffset[t]; |
167 | else for(int t=0; t<64; t++) fTimeOffset[t] = 0.0; | |
d7a5c700 | 168 | } |
2a25ea57 | 169 | |
170 | //________________________________________________________________ | |
171 | void AliVZEROCalibData::SetTimeGain(Float_t* TimeGain) | |
172 | { | |
173 | if(TimeGain) for(int t=0; t<64; t++) fTimeGain[t] = TimeGain[t]; | |
174 | else for(int t=0; t<64; t++) fTimeGain[t] = 0.0; | |
175 | } | |
176 | ||
706506da | 177 | //_____________________________________________________________________________ |
178 | Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const { | |
179 | ||
180 | // Computes the MIP conversion factor - MIP per ADC channel - | |
181 | // Argument passed is the PM number (aliroot numbering) | |
182 | ||
183 | Float_t P0[64] = { | |
184 | 7.094891, 7.124938, 7.089708, 7.098169, 7.094482, 7.147250, 7.170978, 7.183392, | |
185 | 7.145760, 7.148096, 7.153840, 7.143544, 7.186069, 7.194580, 7.203516, 7.195176, | |
186 | 7.188333, 7.198607, 7.209412, 7.226565, 7.221695, 7.205132, 7.191238, 7.227724, | |
187 | 7.232810, 7.252655, 7.230309, 7.273518, 7.273518, 7.242969, 7.252859, 7.252655, | |
188 | 7.026802, 7.079913, 7.134147, 7.092387, 7.079561, 7.072848, 7.123192, 7.003141, | |
189 | 7.024667, 7.124784, 7.123442, 7.129744, 7.110671, 7.143031, 7.139439, 7.178109, | |
190 | 7.247803, 7.139396, 7.293809, 7.094454, 6.992198, 7.206448, 7.244765, 7.056197, | |
191 | 7.263595, 7.138569, 7.089582, 7.215683, 7.266183, 7.165123, 7.243276, 7.235135 }; | |
192 | Float_t P1[64] = { | |
193 | 0.135569, 0.146405, 0.142425, 0.144278, 0.142307, 0.141648, 0.128477, 0.138239, | |
194 | 0.144173, 0.143419, 0.143572, 0.144482, 0.138024, 0.136542, 0.135955, 0.138537, | |
195 | 0.148521, 0.141999, 0.139627, 0.130014, 0.134970, 0.135635, 0.139094, 0.140634, | |
196 | 0.137971, 0.142080, 0.142793, 0.142778, 0.142778, 0.146045, 0.139133, 0.142080, | |
197 | 0.144121, 0.142311, 0.136564, 0.142686, 0.138792, 0.166285, 0.136387, 0.155391, | |
198 | 0.176082, 0.140408, 0.164738, 0.144270, 0.142766, 0.147486, 0.141951, 0.138012, | |
199 | 0.132394, 0.142849, 0.140477, 0.144592, 0.141558, 0.157646, 0.143758, 0.173385, | |
200 | 0.146489, 0.143279, 0.145230, 0.147203, 0.147333, 0.144979, 0.148597, 0.138985 }; | |
201 | ||
202 | // High Voltage retrieval from Calibration Data Base: | |
203 | Float_t HV = fMeanHV[channel]; | |
2f52e327 | 204 | Float_t MIP = -1; |
205 | if (HV>0) | |
206 | MIP = 0.5/TMath::Exp((TMath::Log(HV) - P0[channel] )/P1[channel]); | |
706506da | 207 | return MIP; |
208 | ||
209 | } | |
210 |