]>
Commit | Line | Data |
---|---|---|
1a1fdef7 | 1 | #ifndef ALIFMDPARAMETERS_H |
2 | #define ALIFMDPARAMETERS_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * Latest changes by Christian Holm Christensen <cholm@nbi.dk> | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
1a1fdef7 | 10 | //____________________________________________________________________ |
11 | // | |
12 | // Singleton class to handle various parameters (not geometry) of the | |
13 | // FMD | |
088f8e79 | 14 | // Should get ata fromm Conditions DB. |
1a1fdef7 | 15 | // |
02a27b50 | 16 | /** @file AliFMDParameters.h |
17 | @author Christian Holm Christensen <cholm@nbi.dk> | |
18 | @date Mon Mar 27 12:44:43 2006 | |
19 | @brief Manager of FMD parameters | |
20 | */ | |
1a1fdef7 | 21 | #ifndef ROOT_TNamed |
22 | # include <TNamed.h> | |
23 | #endif | |
8f6ee336 | 24 | #ifndef ROOT_TArrayI |
25 | # include <TArrayI.h> | |
26 | #endif | |
27 | #ifndef ALIFMDUSHORTMAP_H | |
28 | # include <AliFMDUShortMap.h> | |
29 | #endif | |
30 | #ifndef ALIFMDBOOLMAP_H | |
31 | # include <AliFMDBoolMap.h> | |
32 | #endif | |
33 | typedef AliFMDUShortMap AliFMDCalibZeroSuppression; | |
34 | typedef AliFMDBoolMap AliFMDCalibDeadMap; | |
35 | class AliFMDCalibPedestal; | |
36 | class AliFMDCalibGain; | |
37 | class AliFMDCalibSampleRate; | |
c2fc1258 | 38 | class AliFMDCalibStripRange; |
57c3c593 | 39 | class AliFMDAltroMapping; |
dc02d468 | 40 | class AliCDBEntry; |
41 | class AliFMDPreprocessor; | |
42 | ||
02a27b50 | 43 | //____________________________________________________________________ |
44 | // | |
45 | // Singleton class to handle various parameters (not geometry) of the | |
46 | // FMD | |
47 | // Should get ata fromm Conditions DB. | |
48 | // | |
1a1fdef7 | 49 | |
c2fc1258 | 50 | /** @brief This class is a singleton that handles various parameters |
51 | of the FMD detectors. | |
52 | This class reads from the Conditions DB to get the various | |
53 | parameters, which code can then request from here. In that way, | |
54 | all code uses the same data, and the interface is consistent. | |
9f662337 | 55 | |
56 | Some of the parameter managed are | |
57 | - @c fPedestal, @c fPedestalWidth | |
58 | Mean and width of the pedestal. The pedestal is simulated | |
59 | by a Guassian, but derived classes my override MakePedestal | |
60 | to simulate it differently (or pick it up from a database). | |
61 | - @c fVA1MipRange | |
62 | The dymamic MIP range of the VA1_ALICE pre-amplifier chip | |
63 | - @c fAltroChannelSize | |
64 | The largest number plus one that can be stored in one | |
65 | channel in one time step in the ALTRO ADC chip. | |
66 | - @c fSampleRate | |
67 | How many times the ALTRO ADC chip samples the VA1_ALICE | |
68 | pre-amplifier signal. The VA1_ALICE chip is read-out at | |
69 | 10MHz, while it's possible to drive the ALTRO chip at | |
70 | 25MHz. That means, that the ALTRO chip can have time to | |
71 | sample each VA1_ALICE signal up to 2 times. Although it's | |
72 | not certain this feature will be used in the production, | |
73 | we'd like have the option, and so it should be reflected in | |
74 | the code. | |
75 | ||
76 | @ingroup FMD_base | |
77 | */ | |
1a1fdef7 | 78 | class AliFMDParameters : public TNamed |
79 | { | |
80 | public: | |
f6449cc0 | 81 | /** Enumeration of things to initialize */ |
82 | enum What { | |
83 | /** Pulser gain */ | |
84 | kPulseGain = 0x1, // Pulser gain | |
85 | /** Pedestals and noise */ | |
86 | kPedestal = 0x2, // Pedestal and noise | |
87 | /** Dead channel map */ | |
88 | kDeadMap = 0x4, // Dead channel map | |
89 | /** Over sampling rate */ | |
90 | kSampleRate = 0x8, // Over sampling rate | |
91 | /** Zero suppression parameters */ | |
92 | kZeroSuppression = 0x10, // Zero suppression parameters | |
93 | /** ALTRO data map */ | |
6bf06d81 | 94 | kAltroMap = 0x20, // Altro channel map |
95 | /** Strip Range */ | |
f560b28c | 96 | kStripRange = 0x40 //Strip range, |
f6449cc0 | 97 | }; |
f560b28c | 98 | enum { |
99 | kAll = (kPulseGain|kPedestal|kDeadMap|kSampleRate| | |
100 | kZeroSuppression|kAltroMap|kStripRange) | |
101 | }; | |
102 | ||
9f662337 | 103 | /** Singleton access |
104 | @return single to */ | |
1a1fdef7 | 105 | static AliFMDParameters* Instance(); |
57c3c593 | 106 | |
9f662337 | 107 | /** Initialize the manager. This tries to read the parameters from |
108 | CDB. If that fails, the class uses the hard-coded parameters. | |
109 | */ | |
f560b28c | 110 | void Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll ); |
dc02d468 | 111 | /** Initialize the manager. This tries to read the parameters from |
112 | CDB. If that fails, the class uses the hard-coded parameters. | |
113 | */ | |
114 | void Init(AliFMDPreprocessor* pp, | |
f560b28c | 115 | Bool_t forceReInit=kFALSE, |
116 | UInt_t what=kAll); | |
117 | /** | |
118 | * Initialize the manager. This will try to read some calibrations | |
119 | * (sample rate, strip range, gains, pedestals) from local comma | |
120 | * separated value (CSV) files in the directory pointed at by @a | |
121 | * path. If they are not found, then they will be retrieved from | |
122 | * OCDB as appropriately. Other calibrations are always read from | |
123 | * OCDB. | |
124 | * | |
125 | * The CSV files should be named as | |
126 | * | |
127 | * - Pedestals: <tt>peds</tt><i>det_number</i><tt>.csv</tt> | |
128 | * - Gains: <tt>gains</tt><i>det_number</i><tt>.csv</tt> | |
129 | * - Sample Rate: <tt>conditions</tt><i>det_number</i><tt>.csv</tt> | |
130 | * - Strip Range: <tt>conditions</tt><i>det_number</i><tt>.csv</tt> | |
131 | * | |
132 | * where <i>det_number</i> is the detector number (1, 2, or 3). | |
133 | * | |
134 | * @param path Where to look for the CSV files | |
135 | * @param forceReInit Always reinitialise | |
136 | * @param what What calibrations to load. | |
137 | */ | |
138 | void Init(const char* path, | |
139 | Bool_t forceReInit=kFALSE, | |
140 | UInt_t what=kAll); | |
141 | ||
142 | /** | |
143 | * Automatically generate a dead map from the pedestals and gains. | |
144 | * A channel is marked as dead of the noise is too high (currently | |
145 | * more than 10 ADC counts), or the gain is unreasonable (currently | |
146 | * larger than 10, or smaller than 0.1). | |
147 | * | |
148 | * The procedure does not overwrite channels previously marked as | |
149 | * dead - e.g., channels marked as dead in the calibration loaded | |
150 | * from OCDB will continue to be marked as dead. That is, this | |
151 | * procedure will never make a channel un-dead. | |
152 | * | |
153 | * @param maxNoise Maximum noise value before a channel is marked | |
154 | * as dead. | |
155 | * @param minGain Minimum value of the calibrated gain before a | |
156 | * channel is considered dead. | |
157 | * @param maxGain Maximum value of the calibrated gain before a | |
158 | * channel is considered dead. | |
159 | */ | |
160 | void MakeDeadMap(Float_t maxNoise=10, Float_t minGain=.1, Float_t maxGain=10); | |
c2fc1258 | 161 | /** Print all parameters. |
162 | @param option Option string */ | |
163 | void Print(Option_t* option="A") const; | |
6169f936 | 164 | /** Draw parameters. |
165 | @param option What to draw. Should be one of | |
166 | - dead Dead channels | |
167 | - threshold Threshold | |
168 | - gain Gain | |
169 | - pedestal Pedestal | |
170 | - noise Noise (or pedestal width) | |
171 | - zero Zero suppression | |
172 | - rate Sampling rate (VA1 clock / ALTRO clock) | |
173 | - min Minimum strip read out | |
174 | - max Maximum strip read out | |
175 | - map hardware address | |
176 | */ | |
177 | void Draw(Option_t* option="pedestal"); | |
1a1fdef7 | 178 | |
9f662337 | 179 | /** @{ */ |
180 | /** @name Set various `Fixed' parameters */ | |
c2fc1258 | 181 | /** @param r How many MIP signals we can fit in the VA1 |
182 | pre-amps. (default and design is 20) */ | |
8f6ee336 | 183 | void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; } |
c2fc1258 | 184 | /** @param s Maximum number of the ADC (ALTRO). This is a 10 bit |
185 | ADC so, the maximum number is 1024 */ | |
8f6ee336 | 186 | void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;} |
c2fc1258 | 187 | /** @param size The number of strips multiplexed into one ALTRO |
188 | channel. That is, how many strips is connected to one VA1 | |
189 | pre-amp. */ | |
8f6ee336 | 190 | void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; } |
c2fc1258 | 191 | /** @param f Factor to use for accepting a signal. */ |
8f6ee336 | 192 | void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; } |
cce354f6 | 193 | /** @param n Number of pre-samples to keep during zero-suppression - |
194 | only used in simulation. */ | |
195 | void SetZSPreSamples(UShort_t n=1) { fZSPre = (n & 0x3); } | |
196 | /** @param n Number of post-samples to keep during zero-suppression - | |
197 | only used in simulation. */ | |
198 | void SetZSPostSamples(UShort_t n=1) { fZSPost = (n & 0x3); } | |
199 | /** @param use If true, do pedestal subtraction before zero | |
200 | suppression - only used in simulation */ | |
201 | void SetZSPedSubtract(Bool_t use=kTRUE) { fZSPedSubtract = use; } | |
9f662337 | 202 | /** @} */ |
8f6ee336 | 203 | |
9f662337 | 204 | /** @{ */ |
205 | /** @name Set various variable parameter defaults */ | |
c2fc1258 | 206 | /** @param s Zero suppression threshold in ADC counts */ |
8f6ee336 | 207 | void SetZeroSuppression(UShort_t s=0) { fFixedZeroSuppression = s; } |
c2fc1258 | 208 | /** @param r How many times we oversample each strip. */ |
f743c846 | 209 | void SetSampleRate(UShort_t r=1) { fFixedSampleRate = r ;}//(r>2?2:r);} |
6acbd49f | 210 | void SetSampleRate(AliFMDCalibSampleRate* r) { fSampleRate = r; } |
c2fc1258 | 211 | /** @param p Pedestal value in ADC counts */ |
8f6ee336 | 212 | void SetPedestal(Float_t p=10) { fFixedPedestal = p; } |
e064ab4a | 213 | /** @param p Pedestal map */ |
214 | void SetPedestal(AliFMDCalibPedestal* p) { fPedestal = p; } | |
c2fc1258 | 215 | /** @param w Pedestal width in ADC counts */ |
8f6ee336 | 216 | void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; } |
c2fc1258 | 217 | /** @param t Threshold used for 1 MIP acceptance. */ |
8f6ee336 | 218 | void SetThreshold(Float_t t=0) { fFixedThreshold = t; } |
c2fc1258 | 219 | /** Range of strips read out |
220 | @param min Minimum strip number (0-127). | |
221 | @param max Maximum strip number (0-127). */ | |
222 | void SetStripRange(UShort_t min=0, UShort_t max=127); | |
433a88bd | 223 | void SetStripRange(AliFMDCalibStripRange* r) { fStripRange = r; } |
625d7886 | 224 | /** Whether raw data has full common data header (8 32bit words) or |
225 | the older invalid format (7 32bit words with bogus entries) | |
226 | @param yes if true the raw data has complete data header */ | |
227 | void UseCompleteHeader(Bool_t yes=kTRUE) { fHasCompleteHeader = yes; } | |
e064ab4a | 228 | /** @param g Gain map */ |
229 | void SetGain(AliFMDCalibGain* g) { fPulseGain = g; } | |
9f662337 | 230 | /** @} */ |
1a1fdef7 | 231 | |
9f662337 | 232 | /** @{ */ |
233 | /** @name Get `Fixed' various parameters */ | |
c2fc1258 | 234 | /** @return Number of MIP signals that fit inside a VA1 channel */ |
1a1fdef7 | 235 | UShort_t GetVA1MipRange() const { return fVA1MipRange; } |
c2fc1258 | 236 | /** @return The maximum count in the ADC */ |
1a1fdef7 | 237 | UShort_t GetAltroChannelSize() const { return fAltroChannelSize; } |
c2fc1258 | 238 | /** @return Number of strips muliplexed into one ADC channel */ |
1a1fdef7 | 239 | UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; } |
c2fc1258 | 240 | /** @return The average energy deposited by one MIP */ |
1a1fdef7 | 241 | Float_t GetEdepMip() const; |
68aba90a | 242 | /** @return The conversion factor from DAC to ADC */ |
243 | Float_t GetDACPerMIP() const; | |
c2fc1258 | 244 | /** @return The factor used of signal acceptance */ |
1a1fdef7 | 245 | Float_t GetPedestalFactor() const { return fPedestalFactor; } |
cce354f6 | 246 | /** @param n Number of pre-samples to keep during zero-suppression - |
247 | only used in simulation. */ | |
248 | UShort_t GetZSPreSamples() const { return fZSPre; } | |
249 | /** @param n Number of post-samples to keep during zero-suppression - | |
250 | only used in simulation. */ | |
251 | UShort_t GetZSPostSamples() const { return fZSPost; } | |
252 | /** @param use If true, do pedestal subtraction before zero | |
253 | suppression - only used in simulation */ | |
254 | Bool_t IsZSPedSubtract() const { return fZSPedSubtract; } | |
9f662337 | 255 | /** @} */ |
1a1fdef7 | 256 | |
9f662337 | 257 | /** @{ */ |
f38b1653 | 258 | /** @name Various varible conditions */ |
c2fc1258 | 259 | /** Whether the strip is considered dead |
260 | @param detector Detector # (1-3) | |
261 | @param ring Ring ID ('I' or 'O') | |
262 | @param sector Sector number (0-39) | |
263 | @param strip Strip number (0-511) | |
264 | @return @c true if the strip is considered dead, @c false if | |
265 | it's OK. */ | |
8f6ee336 | 266 | Bool_t IsDead(UShort_t detector, |
267 | Char_t ring, | |
268 | UShort_t sector, | |
269 | UShort_t strip) const; | |
270 | Float_t GetThreshold() const; | |
c2fc1258 | 271 | /** Gain of pre-amp. |
272 | @param detector Detector # (1-3) | |
273 | @param ring Ring ID ('I' or 'O') | |
274 | @param sector Sector number (0-39) | |
275 | @param strip Strip number (0-511) | |
276 | @return Gain of pre-amp. */ | |
8f6ee336 | 277 | Float_t GetPulseGain(UShort_t detector, |
278 | Char_t ring, | |
279 | UShort_t sector, | |
280 | UShort_t strip) const; | |
c2fc1258 | 281 | /** Get mean of pedestal |
282 | @param detector Detector # (1-3) | |
283 | @param ring Ring ID ('I' or 'O') | |
284 | @param sector Sector number (0-39) | |
285 | @param strip Strip number (0-511) | |
286 | @return Mean of pedestal */ | |
8f6ee336 | 287 | Float_t GetPedestal(UShort_t detector, |
288 | Char_t ring, | |
289 | UShort_t sector, | |
290 | UShort_t strip) const; | |
c2fc1258 | 291 | /** Width of pedestal |
292 | @param detector Detector # (1-3) | |
293 | @param ring Ring ID ('I' or 'O') | |
294 | @param sector Sector number (0-39) | |
295 | @param strip Strip number (0-511) | |
296 | @return Width of pedestal */ | |
8f6ee336 | 297 | Float_t GetPedestalWidth(UShort_t detector, |
298 | Char_t ring, | |
299 | UShort_t sector, | |
300 | UShort_t strip) const; | |
c2fc1258 | 301 | /** zero suppression threshold (in ADC counts) |
302 | @param detector Detector # (1-3) | |
303 | @param ring Ring ID ('I' or 'O') | |
304 | @param sector Sector number (0-39) | |
305 | @param strip Strip number (0-511) | |
306 | @return zero suppression threshold (in ADC counts) */ | |
8f6ee336 | 307 | UShort_t GetZeroSuppression(UShort_t detector, |
308 | Char_t ring, | |
309 | UShort_t sector, | |
310 | UShort_t strip) const; | |
c2fc1258 | 311 | /** Get the sampling rate |
312 | @param detector Detector # (1-3) | |
313 | @param ring Ring ID ('I' or 'O') | |
314 | @param sector Sector number (0-39) | |
315 | @param strip Strip number (0-511) | |
316 | @return The sampling rate */ | |
317 | UShort_t GetSampleRate(UShort_t detector, | |
318 | Char_t ring, | |
319 | UShort_t sector, | |
320 | UShort_t strip) const; | |
321 | /** Get the minimum strip in the read-out range | |
322 | @param detector Detector # (1-3) | |
323 | @param ring Ring ID ('I' or 'O') | |
324 | @param sector Sector number (0-39) | |
325 | @param strip Strip number (0-511) | |
326 | @return Minimum strip */ | |
327 | UShort_t GetMinStrip(UShort_t detector, | |
328 | Char_t ring, | |
329 | UShort_t sector, | |
330 | UShort_t strip) const; | |
331 | /** Get the maximum strip in the read-out range | |
332 | @param detector Detector # (1-3) | |
333 | @param ring Ring ID ('I' or 'O') | |
334 | @param sector Sector number (0-39) | |
335 | @param strip Strip number (0-511) | |
336 | @return Maximum strip */ | |
337 | UShort_t GetMaxStrip(UShort_t detector, | |
338 | Char_t ring, | |
339 | UShort_t sector, | |
340 | UShort_t strip) const; | |
625d7886 | 341 | /** Get the number of pre-samples in ALTRO channels |
342 | @param detector Detector # (1-3) | |
343 | @param ring Ring ID ('I' or 'O') | |
344 | @param sector Sector number (0-39) | |
345 | @param strip Strip number (0-511) | |
346 | @return Maximum strip */ | |
347 | UShort_t GetPreSamples(UShort_t, | |
348 | Char_t, | |
349 | UShort_t, | |
350 | UShort_t) const { return 14+5; } | |
f38b1653 | 351 | /** @} */ |
352 | ||
353 | /** @{ | |
354 | @name Hardware to detector translation (and inverse) */ | |
355 | /** Map a hardware address into a detector index. | |
356 | @param ddl Hardware DDL number | |
357 | @param board FEC number | |
358 | @param altro ALTRO number | |
359 | @param channel Channel number | |
360 | @param timebin Timebin | |
361 | @param det On return, the detector # | |
362 | @param ring On return, the ring ID | |
363 | @param sec On return, the sector # | |
364 | @param str On return, the base of strip # | |
365 | @param sam On return, the sample number for this strip | |
366 | @return @c true on success, false otherwise */ | |
b995fc28 | 367 | Bool_t Hardware2Detector(UShort_t ddl, UShort_t board, |
368 | UShort_t altro, UShort_t chan, | |
f38b1653 | 369 | UShort_t timebin, |
370 | UShort_t& det, Char_t& ring, | |
371 | UShort_t& sec, Short_t& str, | |
372 | UShort_t& sam) const; | |
f38b1653 | 373 | /** Map a hardware address into a detector index. |
374 | @param ddl Hardware DDL number | |
375 | @param hwaddr Hardware address. | |
376 | @param timebin Timebin | |
377 | @param det On return, the detector # | |
378 | @param ring On return, the ring ID | |
379 | @param sec On return, the sector # | |
380 | @param str On return, the base of strip # | |
381 | @param sam On return, the sample number for this strip | |
382 | @return @c true on success, false otherwise */ | |
b995fc28 | 383 | Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr, |
f38b1653 | 384 | UShort_t timebin, |
385 | UShort_t& det, Char_t& ring, | |
386 | UShort_t& sec, Short_t& str, | |
387 | UShort_t& sam) const; | |
b995fc28 | 388 | #if 0 |
389 | /** Translate hardware address to detector coordinates | |
390 | @param ddl DDL number | |
391 | @param board Board address | |
392 | @param chip Chip # | |
393 | @param channel Channel # | |
394 | @param det On return, Detector # (1-3) | |
395 | @param ring On return, Ring ID ('I' or 'O') | |
396 | @param sec On return, Sector number (0-39) | |
397 | @param str On return, Strip number (0-511) | |
398 | @return @c true on success. */ | |
399 | Bool_t Hardware2Detector(UShort_t ddl, UShort_t board, | |
400 | UShort_t chip, UShort_t channel, | |
401 | UShort_t& det, Char_t& ring, | |
402 | UShort_t& sec, Short_t& str) const; | |
c2fc1258 | 403 | /** Translate hardware address to detector coordinates |
404 | @param ddl DDL number | |
405 | @param addr Hardware address | |
406 | @param det On return, Detector # (1-3) | |
407 | @param ring On return, Ring ID ('I' or 'O') | |
408 | @param sec On return, Sector number (0-39) | |
409 | @param str On return, Strip number (0-511) | |
410 | @return @c true on success. */ | |
b995fc28 | 411 | Bool_t Hardware2Detector(UShort_t ddl, UShort_t addr, UShort_t& det, |
f38b1653 | 412 | Char_t& ring, UShort_t& sec, Short_t& str) const; |
b995fc28 | 413 | #endif |
f6449cc0 | 414 | |
f38b1653 | 415 | /** Map a detector index into a hardware address. |
416 | @param det The detector # | |
417 | @param ring The ring ID | |
418 | @param sec The sector # | |
419 | @param str The strip # | |
420 | @param sam The sample number | |
421 | @param ddl On return, hardware DDL number | |
422 | @param board On return, the FEC board address (local to DDL) | |
423 | @param altro On return, the ALTRO number (local to FEC) | |
424 | @param channel On return, the channel number (local to ALTRO) | |
425 | @param timebin On return, the timebin number (local to ALTRO) | |
426 | @return @c true on success, false otherwise */ | |
427 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, | |
428 | UShort_t sec, UShort_t str, | |
429 | UShort_t sam, | |
b995fc28 | 430 | UShort_t& ddl, UShort_t& board, |
431 | UShort_t& altro, UShort_t& channel, | |
f38b1653 | 432 | UShort_t& timebin) const; |
f38b1653 | 433 | /** Map a detector index into a hardware address. |
434 | @param det The detector # | |
435 | @param ring The ring ID | |
436 | @param sec The sector # | |
437 | @param str The strip # | |
438 | @param sam The sample number | |
439 | @param ddl On return, hardware DDL number | |
440 | @param hwaddr On return, hardware address. | |
441 | @param timebin On return, the timebin number (local to ALTRO) | |
442 | @return @c true on success, false otherwise */ | |
443 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, | |
444 | UShort_t sec, UShort_t str, | |
445 | UShort_t sam, | |
b995fc28 | 446 | UShort_t& ddl, UShort_t& hwaddr, |
f38b1653 | 447 | UShort_t& timebin) const; |
b995fc28 | 448 | #if 0 |
449 | /** Translate detector coordinates to hardware address | |
450 | @param det Detector # (1-3) | |
451 | @param ring Ring ID ('I' or 'O') | |
452 | @param sec Sector number (0-39) | |
453 | @param str Strip number (0-511) | |
454 | @param ddl On return, DDL number | |
455 | @param board On return, Board address | |
456 | @param chip On return, Chip # | |
457 | @param channel On return, Channel # | |
458 | @return @c true on success. */ | |
459 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, | |
460 | UShort_t sec, UShort_t str, | |
461 | UShort_t& ddl, UShort_t& board, | |
462 | UShort_t& chip, UShort_t& channel) const; | |
c2fc1258 | 463 | /** Translate detector coordinates to hardware address |
464 | @param det Detector # (1-3) | |
465 | @param ring Ring ID ('I' or 'O') | |
466 | @param sec Sector number (0-39) | |
467 | @param str Strip number (0-511) | |
468 | @param ddl On return, DDL number | |
469 | @param addr On return, Hardware address | |
470 | @return @c true on success. */ | |
bf000c32 | 471 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec, |
b995fc28 | 472 | UShort_t str, UShort_t& ddl, UShort_t& addr) const; |
473 | #endif | |
c2fc1258 | 474 | /** Get the map that translates hardware to detector coordinates |
475 | @return Get the map that translates hardware to detector | |
476 | coordinates */ | |
57c3c593 | 477 | AliFMDAltroMapping* GetAltroMap() const; |
625d7886 | 478 | /** Whether raw data has full common data header (8 32bit words) or |
479 | the older invalid format (7 32bit words with bogus entries) | |
480 | @return false if the raw data has incomplete data header */ | |
481 | Bool_t HasCompleteHeader() const { return fHasCompleteHeader; } | |
482 | ||
9f662337 | 483 | /** @} */ |
484 | ||
02a27b50 | 485 | static const char* PulseGainPath() { return fgkPulseGain; } |
486 | static const char* PedestalPath() { return fgkPedestal; } | |
487 | static const char* DeadPath() { return fgkDead; } | |
488 | static const char* SampleRatePath() { return fgkSampleRate; } | |
489 | static const char* AltroMapPath() { return fgkAltroMap; } | |
490 | static const char* ZeroSuppressionPath() { return fgkZeroSuppression; } | |
491 | static const char* StripRangePath() { return fgkStripRange; } | |
6cd5cd4d | 492 | static const char* GetPedestalShuttleID() {return fkPedestalShuttleID;} |
493 | static const char* GetGainShuttleID() {return fkGainShuttleID;} | |
494 | static const char* GetConditionsShuttleID() {return fkConditionsShuttleID;} | |
cf12b007 | 495 | |
497e0e62 | 496 | protected: |
9f662337 | 497 | /** CTOR */ |
497e0e62 | 498 | AliFMDParameters(); |
02a27b50 | 499 | /** CTOR */ |
500 | AliFMDParameters(const AliFMDParameters& o) | |
b5ee4425 | 501 | : TNamed(o), |
502 | fIsInit(o.fIsInit), | |
503 | fkSiDeDxMip(o.fkSiDeDxMip), | |
504 | fVA1MipRange(o.fVA1MipRange), | |
505 | fAltroChannelSize(o.fAltroChannelSize), | |
506 | fChannelsPerAltro(o.fChannelsPerAltro), | |
507 | fPedestalFactor(o.fPedestalFactor), | |
cce354f6 | 508 | fZSPre(o.fZSPre), |
509 | fZSPost(o.fZSPost), | |
510 | fZSPedSubtract(o.fZSPedSubtract), | |
b5ee4425 | 511 | fFixedPedestal(o.fFixedPedestal), |
512 | fFixedPedestalWidth(o.fFixedPedestalWidth), | |
513 | fFixedZeroSuppression(o.fFixedZeroSuppression), | |
514 | fFixedSampleRate(o.fFixedSampleRate), | |
515 | fFixedThreshold(o.fFixedThreshold), | |
516 | fFixedMinStrip(o.fFixedMinStrip), | |
517 | fFixedMaxStrip(o.fFixedMaxStrip), | |
518 | fFixedPulseGain(o.fFixedPulseGain), | |
519 | fEdepMip(o.fEdepMip), | |
625d7886 | 520 | fHasCompleteHeader(o.fHasCompleteHeader), |
b5ee4425 | 521 | fZeroSuppression(o.fZeroSuppression), |
522 | fSampleRate(o.fSampleRate), | |
523 | fPedestal(o.fPedestal), | |
524 | fPulseGain(o.fPulseGain), | |
525 | fDeadMap(o.fDeadMap), | |
526 | fAltroMap(o.fAltroMap), | |
3d7ed4ed | 527 | fStripRange(o.fStripRange) |
b5ee4425 | 528 | {} |
02a27b50 | 529 | /** Assignement operator |
530 | @return Reference to this */ | |
531 | AliFMDParameters& operator=(const AliFMDParameters&) { return *this; } | |
9f662337 | 532 | /** DTOR */ |
497e0e62 | 533 | virtual ~AliFMDParameters() {} |
9f662337 | 534 | /** Singleton instance */ |
497e0e62 | 535 | static AliFMDParameters* fgInstance; // Static singleton instance |
f560b28c | 536 | /** |
537 | * Check if the file <i>prefix</i><i>number</i> exists in @a path, | |
538 | * and write the full path to @a f. | |
539 | * | |
540 | * @param prefix File prefix (cond, peds, gains, ...) | |
541 | * @param path Path to files | |
542 | * @param number Detector number (1, 2, or 3) | |
543 | * @param f On return full path to file (if found) | |
544 | * | |
545 | * @return @c true if file exists and is readable, @c false otherwise | |
546 | */ | |
547 | Bool_t CheckFile(const char* prefix, const char* path, | |
548 | int number, TString& f) const; | |
dc02d468 | 549 | /** Get an entry from either global AliCDBManager or passed |
550 | AliFMDPreprocessor. | |
551 | @param path Path to CDB object. | |
552 | @param pp AliFMDPreprocessor | |
553 | @param fatal If true, raise a fatal flag if we didn't get the entry. | |
554 | @return AliCDBEntry if found */ | |
555 | AliCDBEntry* GetEntry(const char* path, AliFMDPreprocessor* pp, | |
556 | Bool_t fatal=kTRUE) const; | |
9f662337 | 557 | /** Initialize gains. Try to get them from CDB */ |
dc02d468 | 558 | void InitPulseGain(AliFMDPreprocessor* pp=0); |
9f662337 | 559 | /** Initialize pedestals. Try to get them from CDB */ |
dc02d468 | 560 | void InitPedestal(AliFMDPreprocessor* pp=0); |
9f662337 | 561 | /** Initialize dead map. Try to get it from CDB */ |
dc02d468 | 562 | void InitDeadMap(AliFMDPreprocessor* pp=0); |
9f662337 | 563 | /** Initialize sample rates. Try to get them from CDB */ |
dc02d468 | 564 | void InitSampleRate(AliFMDPreprocessor* pp=0); |
9f662337 | 565 | /** Initialize zero suppression thresholds. Try to get them from CDB */ |
dc02d468 | 566 | void InitZeroSuppression(AliFMDPreprocessor* pp=0); |
9f662337 | 567 | /** Initialize hardware map. Try to get it from CDB */ |
dc02d468 | 568 | void InitAltroMap(AliFMDPreprocessor* pp=0); |
c2fc1258 | 569 | /** Initialize strip range. Try to get it from CDB */ |
dc02d468 | 570 | void InitStripRange(AliFMDPreprocessor* pp=0); |
57c3c593 | 571 | |
6cd5cd4d | 572 | Bool_t fIsInit; // Whether we've been initialised |
57c3c593 | 573 | |
6cd5cd4d | 574 | static const char* fgkPulseGain; // Path to PulseGain calib object |
575 | static const char* fgkPedestal; // Path to Pedestal calib object | |
576 | static const char* fgkDead; // Path to Dead calib object | |
577 | static const char* fgkSampleRate; // Path to SampleRate calib object | |
578 | static const char* fgkAltroMap; // Path to AltroMap calib object | |
579 | static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object | |
580 | static const char* fgkStripRange; // Path to strip range cal object | |
581 | const Float_t fkSiDeDxMip; // MIP dE/dx in Silicon | |
582 | UShort_t fVA1MipRange; // # MIPs the pre-amp can do | |
583 | UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch. | |
584 | UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan. | |
585 | Float_t fPedestalFactor; // Number of pedestal widths | |
cce354f6 | 586 | UShort_t fZSPre; // Number of pre-samples in ZS |
587 | UShort_t fZSPost; // Number of post-samples in ZS | |
588 | Bool_t fZSPedSubtract; // Pedestal subtraction before ZS | |
1a1fdef7 | 589 | |
6cd5cd4d | 590 | Float_t fFixedPedestal; // Pedestal to subtract |
591 | Float_t fFixedPedestalWidth; // Width of pedestal | |
592 | UShort_t fFixedZeroSuppression; // Threshold for zero-suppression | |
593 | UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp. | |
594 | Float_t fFixedThreshold; // Threshold in ADC counts | |
595 | UShort_t fFixedMinStrip; // Minimum strip read-out | |
596 | UShort_t fFixedMaxStrip; // Maximum strip read-out | |
597 | mutable Float_t fFixedPulseGain; //! Gain (cached) | |
598 | mutable Float_t fEdepMip; //! Cache of energy loss for a MIP | |
6cd5cd4d | 599 | Bool_t fHasCompleteHeader; // raw data has incomplete data header |
600 | ||
601 | static const char* fkPedestalShuttleID; // Shuttle/preprocessor ID for pedestals | |
602 | static const char* fkGainShuttleID; // Shuttle/preprocessor ID for gains | |
603 | static const char* fkConditionsShuttleID; // Shuttle/preprocessor ID for conditions | |
8f6ee336 | 604 | |
605 | AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB | |
606 | AliFMDCalibSampleRate* fSampleRate; // Sample rate from CDB | |
607 | AliFMDCalibPedestal* fPedestal; // Pedestals | |
608 | AliFMDCalibGain* fPulseGain; // Pulser gain | |
609 | AliFMDCalibDeadMap* fDeadMap; // Pulser gain | |
57c3c593 | 610 | AliFMDAltroMapping* fAltroMap; // Map of hardware |
c2fc1258 | 611 | AliFMDCalibStripRange* fStripRange; // Strip range |
8f6ee336 | 612 | |
9a090ccd | 613 | ClassDef(AliFMDParameters,6) // Manager of parameters |
1a1fdef7 | 614 | }; |
615 | ||
616 | #endif | |
617 | //____________________________________________________________________ | |
618 | // | |
619 | // Local Variables: | |
620 | // mode: C++ | |
621 | // End: | |
622 | // | |
623 | // EOF | |
624 | // | |
625 |