]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDParameters.h
754c1946211b6a4fd63800c4a476e5b69aad0487
[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 //
13 //  Singleton class to handle various parameters (not geometry) of the
14 //  FMD
15 //  Should get ata fromm Conditions DB.
16 //
17 #ifndef ROOT_TNamed
18 # include <TNamed.h>
19 #endif
20 #ifndef ROOT_TArrayI
21 # include <TArrayI.h>
22 #endif
23 #ifndef ALIFMDUSHORTMAP_H
24 # include <AliFMDUShortMap.h>
25 #endif
26 #ifndef ALIFMDBOOLMAP_H
27 # include <AliFMDBoolMap.h>
28 #endif
29 typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
30 typedef AliFMDBoolMap   AliFMDCalibDeadMap;
31 class AliFMDCalibPedestal;
32 class AliFMDCalibGain;
33 class AliFMDCalibSampleRate;
34
35 class AliFMDParameters : public TNamed
36 {
37 public:
38   static AliFMDParameters* Instance();
39   
40   // Set various `Fixed' parameters 
41   void SetVA1MipRange(UShort_t r=20)          { fVA1MipRange = r; }
42   void SetAltroChannelSize(UShort_t s=1024)   { fAltroChannelSize = s;}
43   void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
44   void SetPedestalFactor(Float_t f=3)         { fPedestalFactor = f; }
45
46   // Set various variable parameter defaults
47   void SetZeroSuppression(UShort_t s=0)       { fFixedZeroSuppression = s; }
48   void SetSampleRate(UShort_t r=1)            { fFixedSampleRate = (r>2?2:r);}
49   void SetPedestal(Float_t p=10)              { fFixedPedestal = p; }
50   void SetPedestalWidth(Float_t w=1)          { fFixedPedestalWidth = w; }
51   void SetThreshold(Float_t t=0)              { fFixedThreshold = t; }
52
53   // Get `Fixed' various parameters
54   UShort_t GetVA1MipRange()          const { return fVA1MipRange; }
55   UShort_t GetAltroChannelSize()     const { return fAltroChannelSize; }
56   UShort_t GetChannelsPerAltro()     const { return fChannelsPerAltro; }
57   Float_t  GetEdepMip()              const;
58   Float_t  GetPedestalFactor()       const { return fPedestalFactor; }
59
60   // Get variable parameters 
61   Bool_t   IsDead(UShort_t detector, 
62                   Char_t ring, 
63                   UShort_t sector, 
64                   UShort_t strip) const;
65   Float_t  GetThreshold() const;
66   Float_t  GetPulseGain(UShort_t detector, 
67                         Char_t ring, 
68                         UShort_t sector, 
69                         UShort_t strip) const;
70   Float_t  GetPedestal(UShort_t detector, 
71                        Char_t ring, 
72                        UShort_t sector, 
73                        UShort_t strip) const;
74   Float_t  GetPedestalWidth(UShort_t detector, 
75                             Char_t ring, 
76                             UShort_t sector, 
77                             UShort_t strip) const;
78   UShort_t GetZeroSuppression(UShort_t detector, 
79                               Char_t ring, 
80                               UShort_t sector, 
81                               UShort_t strip) const;
82   UShort_t GetSampleRate(UShort_t ddl) const;
83
84   enum { 
85     kBaseDDL = 0x1000 // DDL offset for the FMD
86   };
87 protected:
88   AliFMDParameters();
89   virtual ~AliFMDParameters() {}
90   static AliFMDParameters* fgInstance; // Static singleton instance
91   
92   const Float_t   fSiDeDxMip;            // MIP dE/dx in Silicon
93   UShort_t        fVA1MipRange;          // # MIPs the pre-amp can do    
94   UShort_t        fAltroChannelSize;     // Largest # to store in 1 ADC ch.
95   UShort_t        fChannelsPerAltro;     // Number of pre-amp. chan/adc chan.
96   Float_t         fPedestalFactor;       // Number of pedestal widths
97
98   Float_t         fFixedPedestal;        // Pedestal to subtract
99   Float_t         fFixedPedestalWidth;   // Width of pedestal
100   UShort_t        fFixedZeroSuppression; // Threshold for zero-suppression
101   UShort_t        fFixedSampleRate;      // Times the ALTRO samples pre-amp.
102   Float_t         fFixedThreshold;       //
103   mutable Float_t fFixedPulseGain;       //! Gain (cached)
104   mutable Float_t fEdepMip;              //! Cache of energy loss for a MIP
105   
106   AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
107   AliFMDCalibSampleRate*      fSampleRate;      // Sample rate from CDB 
108   AliFMDCalibPedestal*        fPedestal;        // Pedestals 
109   AliFMDCalibGain*            fPulseGain;       // Pulser gain
110   AliFMDCalibDeadMap*         fDeadMap;         // Pulser gain
111   
112   
113   ClassDef(AliFMDParameters,2)
114 };
115
116 #endif
117 //____________________________________________________________________
118 //
119 // Local Variables:
120 //   mode: C++
121 // End:
122 //
123 // EOF
124 //
125