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