1 #ifndef ALIFMDPARAMETERS_H
2 #define ALIFMDPARAMETERS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
11 //____________________________________________________________________
13 // Singleton class to handle various parameters (not geometry) of the
15 // Should get ata fromm Conditions DB.
23 #ifndef ALIFMDUSHORTMAP_H
24 # include <AliFMDUShortMap.h>
26 #ifndef ALIFMDBOOLMAP_H
27 # include <AliFMDBoolMap.h>
29 typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
30 typedef AliFMDBoolMap AliFMDCalibDeadMap;
31 class AliFMDCalibPedestal;
32 class AliFMDCalibGain;
33 class AliFMDCalibSampleRate;
34 class AliFMDAltroMapping;
36 /** This class is a singleton that handles various parameters of the
37 FMD detectors. This class reads from the Conditions DB to get the
38 various parameters, which code can then request from here. In that
39 way, all code uses the same data, and the interface is consistent.
41 Some of the parameter managed are
42 - @c fPedestal, @c fPedestalWidth
43 Mean and width of the pedestal. The pedestal is simulated
44 by a Guassian, but derived classes my override MakePedestal
45 to simulate it differently (or pick it up from a database).
47 The dymamic MIP range of the VA1_ALICE pre-amplifier chip
48 - @c fAltroChannelSize
49 The largest number plus one that can be stored in one
50 channel in one time step in the ALTRO ADC chip.
52 How many times the ALTRO ADC chip samples the VA1_ALICE
53 pre-amplifier signal. The VA1_ALICE chip is read-out at
54 10MHz, while it's possible to drive the ALTRO chip at
55 25MHz. That means, that the ALTRO chip can have time to
56 sample each VA1_ALICE signal up to 2 times. Although it's
57 not certain this feature will be used in the production,
58 we'd like have the option, and so it should be reflected in
63 class AliFMDParameters : public TNamed
68 static AliFMDParameters* Instance();
70 /** Initialize the manager. This tries to read the parameters from
71 CDB. If that fails, the class uses the hard-coded parameters.
76 /** @name Set various `Fixed' parameters */
77 void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
78 void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
79 void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
80 void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
84 /** @name Set various variable parameter defaults */
85 void SetZeroSuppression(UShort_t s=0) { fFixedZeroSuppression = s; }
86 void SetSampleRate(UShort_t r=1) { fFixedSampleRate = (r>2?2:r);}
87 void SetPedestal(Float_t p=10) { fFixedPedestal = p; }
88 void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; }
89 void SetThreshold(Float_t t=0) { fFixedThreshold = t; }
93 /** @name Get `Fixed' various parameters */
94 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
95 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
96 UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
97 Float_t GetEdepMip() const;
98 Float_t GetPedestalFactor() const { return fPedestalFactor; }
102 /** @name Get variable parameters */
103 Bool_t IsDead(UShort_t detector,
106 UShort_t strip) const;
107 Float_t GetThreshold() const;
108 Float_t GetPulseGain(UShort_t detector,
111 UShort_t strip) const;
112 Float_t GetPedestal(UShort_t detector,
115 UShort_t strip) const;
116 Float_t GetPedestalWidth(UShort_t detector,
119 UShort_t strip) const;
120 UShort_t GetZeroSuppression(UShort_t detector,
123 UShort_t strip) const;
124 UShort_t GetSampleRate(UShort_t ddl) const;
126 Bool_t Hardware2Detector(UInt_t ddl, UInt_t addr, UShort_t& det,
127 Char_t& ring, UShort_t& sec, UShort_t& str) const;
128 Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec,
129 UShort_t str, UInt_t& ddl, UInt_t& addr) const;
130 AliFMDAltroMapping* GetAltroMap() const;
134 kBaseDDL = 0x1000 // DDL offset for the FMD
136 static const char* fgkPulseGain; // Path to PulseGain calib object
137 static const char* fgkPedestal; // Path to Pedestal calib object
138 static const char* fgkDead; // Path to Dead calib object
139 static const char* fgkSampleRate; // Path to SampleRate calib object
140 static const char* fgkAltroMap; // Path to AltroMap calib object
141 static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
146 virtual ~AliFMDParameters() {}
147 /** Singleton instance */
148 static AliFMDParameters* fgInstance; // Static singleton instance
149 /** Initialize gains. Try to get them from CDB */
150 void InitPulseGain();
151 /** Initialize pedestals. Try to get them from CDB */
153 /** Initialize dead map. Try to get it from CDB */
155 /** Initialize sample rates. Try to get them from CDB */
156 void InitSampleRate();
157 /** Initialize zero suppression thresholds. Try to get them from CDB */
158 void InitZeroSuppression();
159 /** Initialize hardware map. Try to get it from CDB */
162 Bool_t fIsInit; // Whether we've been initialised
164 const Float_t fSiDeDxMip; // MIP dE/dx in Silicon
165 UShort_t fVA1MipRange; // # MIPs the pre-amp can do
166 UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
167 UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
168 Float_t fPedestalFactor; // Number of pedestal widths
170 Float_t fFixedPedestal; // Pedestal to subtract
171 Float_t fFixedPedestalWidth; // Width of pedestal
172 UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
173 UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
174 Float_t fFixedThreshold; //
175 mutable Float_t fFixedPulseGain; //! Gain (cached)
176 mutable Float_t fEdepMip; //! Cache of energy loss for a MIP
178 AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
179 AliFMDCalibSampleRate* fSampleRate; // Sample rate from CDB
180 AliFMDCalibPedestal* fPedestal; // Pedestals
181 AliFMDCalibGain* fPulseGain; // Pulser gain
182 AliFMDCalibDeadMap* fDeadMap; // Pulser gain
183 AliFMDAltroMapping* fAltroMap; // Map of hardware
185 ClassDef(AliFMDParameters,3)
189 //____________________________________________________________________