]>
Commit | Line | Data |
---|---|---|
dbadb4c4 | 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 | #include "AliTRDCalOnlineGainTable.h" | |
17 | ||
18 | ////////////////////////////////////////////////////////////////////////////////////////////// | |
19 | // | |
20 | // Data structure to store gaintables of the online calibration in the OCDB | |
21 | // consisting of three classes: | |
22 | // AliTRDCalOnlineGainTable | |
23 | // AliTRDCalOnlineGainTableROC | |
24 | // AliTRDCalOnlineGainTableMCM | |
25 | // | |
26 | // AliTRDCalOnlineGainTable is the main class from which all stored data can be accessed. | |
27 | // The two sub-classes AliTRDCalOnlineGainTableROC and AliTRDCalOnlineGainTableMCM | |
28 | // contain the gaintables on ROC level and on the MCM level respectively. | |
29 | // | |
30 | // The online calibration is used to compensate gain deviations on the pad level. | |
31 | // For the offline reconstruction the online calibration has to be undone. | |
32 | // The corresponding gain correction factor that was used by the online gain filter can be accessed | |
33 | // via the functions AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t det, Int_t row, Int_t col) | |
34 | // and AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t sector, Int_t stack, Int_t layer, Int_t row, Int_t col). | |
35 | // | |
36 | ////////////////////////////////////////////////////////////////////////////////////////////// | |
37 | ||
38 | ClassImp(AliTRDCalOnlineGainTable); | |
39 | ||
40 | const Float_t AliTRDCalOnlineGainTable::UnDef=-999.; | |
41 | ||
42 | //_____________________________________________________________________________ | |
43 | AliTRDCalOnlineGainTable::AliTRDCalOnlineGainTable() | |
44 | :TObject() | |
45 | { | |
46 | // | |
47 | // constructor | |
48 | // | |
49 | ||
50 | for (int i=0; i<540; i++) { | |
51 | fROCGainTables[i] = 0; | |
52 | } | |
53 | ||
54 | } | |
55 | ||
56 | //_____________________________________________________________________________ | |
57 | AliTRDCalOnlineGainTable::AliTRDCalOnlineGainTable(const AliTRDCalOnlineGainTable& other) | |
58 | :TObject(other) | |
59 | { | |
60 | // | |
61 | // copy constructor | |
62 | // | |
63 | ||
64 | for (int i=0; i<540; i++) { | |
65 | if (other.GetGainTableROC(i)) { | |
66 | fROCGainTables[i] = new AliTRDCalOnlineGainTableROC( *(other.GetGainTableROC(i)) ); | |
67 | } else { | |
68 | fROCGainTables[i] = 0; | |
69 | } | |
70 | } | |
71 | ||
72 | } | |
73 | ||
74 | //_____________________________________________________________________________ | |
75 | AliTRDCalOnlineGainTable& AliTRDCalOnlineGainTable::operator=(const AliTRDCalOnlineGainTable& other) | |
76 | { | |
77 | // | |
78 | // assignment operator | |
79 | // | |
80 | ||
81 | for (int i=0; i<540; i++) { | |
82 | ||
83 | if (fROCGainTables[i]) { | |
84 | delete fROCGainTables[i]; | |
85 | } | |
86 | ||
87 | if (other.GetGainTableROC(i)) { | |
88 | fROCGainTables[i] = new AliTRDCalOnlineGainTableROC( *(other.GetGainTableROC(i)) ); | |
89 | } else { | |
90 | fROCGainTables[i] = 0; | |
91 | } | |
92 | } | |
93 | ||
94 | return *this; | |
95 | ||
96 | } | |
97 | ||
98 | //_____________________________________________________________________________ | |
99 | AliTRDCalOnlineGainTable::~AliTRDCalOnlineGainTable() | |
100 | { | |
101 | // | |
102 | // destructor | |
103 | // | |
104 | ||
105 | for (int i=0; i<540; i++) { | |
106 | if (fROCGainTables[i]) { | |
107 | delete fROCGainTables[i]; | |
108 | } | |
109 | } | |
110 | ||
111 | } | |
112 | ||
113 | //_____________________________________________________________________________ | |
ea3eaa08 | 114 | Float_t AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t det |
115 | , Int_t row | |
116 | , Int_t col) const | |
dbadb4c4 | 117 | { |
118 | // | |
119 | // returns the Gain Correction Factor of the channel | |
120 | // given by det, row, col | |
121 | // | |
122 | ||
123 | AliTRDCalOnlineGainTableROC* gtbl = GetGainTableROC(det); | |
124 | ||
125 | if (gtbl) { | |
126 | return gtbl->GetGainCorrectionFactor(row,col); | |
127 | } else { | |
128 | return AliTRDCalOnlineGainTable::UnDef; | |
129 | } | |
130 | ||
131 | } | |
132 | ||
133 | //_____________________________________________________________________________ | |
ea3eaa08 | 134 | Float_t AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t sector |
135 | , Int_t stack | |
136 | , Int_t layer | |
137 | , Int_t row | |
138 | , Int_t col) const | |
dbadb4c4 | 139 | { |
140 | // | |
141 | // returns the Gain Correction Factor of the channel | |
142 | // given by sector, stack, layer, row, col | |
143 | // | |
144 | ||
145 | return GetGainCorrectionFactor(30*sector + 6*stack + layer, row, col); | |
146 | } | |
147 | ||
148 | //_____________________________________________________________________________ | |
149 | Short_t AliTRDCalOnlineGainTable::GetAdcdac(Int_t det, Int_t row, Int_t col) | |
150 | { | |
151 | // | |
152 | // returns the ADC's reference voltage of the channel | |
153 | // given by det, row, col | |
154 | // | |
155 | ||
156 | AliTRDCalOnlineGainTableROC* gtbl = GetGainTableROC(det); | |
157 | ||
158 | if (gtbl) { | |
159 | return gtbl->GetAdcdac(row,col); | |
160 | } else { | |
161 | return -999; | |
162 | } | |
163 | ||
164 | } | |
165 | ||
166 | //_____________________________________________________________________________ | |
167 | Short_t AliTRDCalOnlineGainTable::GetAdcdac(Int_t sector, Int_t stack, Int_t layer, | |
168 | Int_t row, Int_t col) | |
169 | { | |
170 | // | |
171 | // returns the ADC's reference voltage of the channel | |
172 | // given by sector, stack, layer, row, col | |
173 | // | |
174 | ||
175 | return GetAdcdac(30*sector + 6*stack + layer, row, col); | |
176 | } | |
177 | ||
178 | //_____________________________________________________________________________ | |
179 | Float_t AliTRDCalOnlineGainTable::GetMCMGain(Int_t det, Int_t row, Int_t col) | |
180 | { | |
181 | // | |
182 | // returns the Gain Factor which would lead to a Correction Factor of 1.0 | |
183 | // within the MCM given by det, row, col | |
184 | // | |
185 | ||
186 | AliTRDCalOnlineGainTableROC* gtbl = GetGainTableROC(det); | |
187 | ||
188 | if (gtbl) { | |
189 | return gtbl->GetMCMGain(row,col); | |
190 | } else { | |
191 | return AliTRDCalOnlineGainTable::UnDef; | |
192 | } | |
193 | ||
194 | } | |
195 | ||
196 | //_____________________________________________________________________________ | |
197 | Float_t AliTRDCalOnlineGainTable::GetMCMGain(Int_t sector, Int_t stack, Int_t layer, | |
198 | Int_t row, Int_t col) | |
199 | { | |
200 | // | |
201 | // returns the Gain Factor which would lead to a Correction Factor of 1.0 | |
202 | // within the MCM given by sector, stack, layer, row, col | |
203 | // | |
204 | ||
205 | return GetMCMGain(30*sector + 6*stack + layer, row, col); | |
206 | } | |
207 | ||
208 | //_____________________________________________________________________________ | |
209 | Short_t AliTRDCalOnlineGainTable::GetFGAN(Int_t det, Int_t row, Int_t col) | |
210 | { | |
211 | // | |
212 | // returns the Gain Correction Filter Additive of the channel | |
213 | // given by det, row, col | |
214 | // | |
215 | ||
216 | AliTRDCalOnlineGainTableROC* gtbl = GetGainTableROC(det); | |
217 | ||
218 | if (gtbl) { | |
219 | return gtbl->GetFGAN(row,col); | |
220 | } else { | |
221 | return -999; | |
222 | } | |
223 | ||
224 | } | |
225 | ||
226 | //_____________________________________________________________________________ | |
227 | Short_t AliTRDCalOnlineGainTable::GetFGAN(Int_t sector, Int_t stack, Int_t layer, | |
228 | Int_t row, Int_t col) | |
229 | { | |
230 | // | |
231 | // returns the Gain Correction Filter Additive of the channel | |
232 | // given by sector, stack, layer, row, col | |
233 | // | |
234 | ||
235 | return GetFGAN(30*sector + 6*stack + layer, row, col); | |
236 | } | |
237 | ||
238 | //_____________________________________________________________________________ | |
239 | Short_t AliTRDCalOnlineGainTable::GetFGFN(Int_t det, Int_t row, Int_t col) | |
240 | { | |
241 | // | |
242 | // returns the Gain Correction Filter Factor of the channel | |
243 | // given by det, row, col | |
244 | // | |
245 | ||
246 | AliTRDCalOnlineGainTableROC* gtbl = GetGainTableROC(det); | |
247 | ||
248 | if (gtbl) { | |
249 | return gtbl->GetFGFN(row,col); | |
250 | } else { | |
251 | return -999; | |
252 | } | |
253 | } | |
254 | ||
255 | //_____________________________________________________________________________ | |
256 | Short_t AliTRDCalOnlineGainTable::GetFGFN(Int_t sector, Int_t stack, Int_t layer, | |
257 | Int_t row, Int_t col) | |
258 | { | |
259 | // | |
260 | // returns the Gain Correction Filter Factor of the channel | |
261 | // given by sector, stack, layer, row, col | |
262 | // | |
263 | ||
264 | return GetFGFN(30*sector + 6*stack + layer, row, col); | |
265 | } | |
266 | ||
267 | //_____________________________________________________________________________ | |
268 | void AliTRDCalOnlineGainTable::AllocateGainTableROC(Int_t det) | |
269 | { | |
270 | // | |
271 | // allocates a Gain Table for the given detector | |
272 | // | |
273 | ||
274 | if (fROCGainTables[det]) { | |
275 | delete fROCGainTables[det]; | |
276 | } | |
277 | ||
278 | fROCGainTables[det] = new AliTRDCalOnlineGainTableROC; | |
279 | } | |
280 |