]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDParameters.h
Additiona TOF data members (S.Arcelli)
[u/mrichter/AliRoot.git] / FMD / AliFMDParameters.h
CommitLineData
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 */
10
11//____________________________________________________________________
12//
13// Singleton class to handle various parameters (not geometry) of the
14// FMD
088f8e79 15// Should get ata fromm Conditions DB.
1a1fdef7 16//
17#ifndef ROOT_TNamed
18# include <TNamed.h>
19#endif
8f6ee336 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
29typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
30typedef AliFMDBoolMap AliFMDCalibDeadMap;
31class AliFMDCalibPedestal;
32class AliFMDCalibGain;
33class AliFMDCalibSampleRate;
57c3c593 34class AliFMDAltroMapping;
1a1fdef7 35
9f662337 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.
40
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).
46 - @c fVA1MipRange
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.
51 - @c fSampleRate
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
59 the code.
60
61 @ingroup FMD_base
62*/
1a1fdef7 63class AliFMDParameters : public TNamed
64{
65public:
9f662337 66 /** Singleton access
67 @return single to */
1a1fdef7 68 static AliFMDParameters* Instance();
57c3c593 69
9f662337 70 /** Initialize the manager. This tries to read the parameters from
71 CDB. If that fails, the class uses the hard-coded parameters.
72 */
57c3c593 73 void Init();
1a1fdef7 74
9f662337 75 /** @{ */
76 /** @name Set various `Fixed' parameters */
8f6ee336 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; }
9f662337 81 /** @} */
8f6ee336 82
9f662337 83 /** @{ */
84 /** @name Set various variable parameter defaults */
8f6ee336 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; }
9f662337 90 /** @} */
1a1fdef7 91
9f662337 92 /** @{ */
93 /** @name Get `Fixed' various parameters */
1a1fdef7 94 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
95 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
96 UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
1a1fdef7 97 Float_t GetEdepMip() const;
1a1fdef7 98 Float_t GetPedestalFactor() const { return fPedestalFactor; }
9f662337 99 /** @} */
1a1fdef7 100
9f662337 101 /** @{ */
102 /** @name Get variable parameters */
8f6ee336 103 Bool_t IsDead(UShort_t detector,
104 Char_t ring,
105 UShort_t sector,
106 UShort_t strip) const;
107 Float_t GetThreshold() const;
108 Float_t GetPulseGain(UShort_t detector,
109 Char_t ring,
110 UShort_t sector,
111 UShort_t strip) const;
112 Float_t GetPedestal(UShort_t detector,
113 Char_t ring,
114 UShort_t sector,
115 UShort_t strip) const;
116 Float_t GetPedestalWidth(UShort_t detector,
117 Char_t ring,
118 UShort_t sector,
119 UShort_t strip) const;
120 UShort_t GetZeroSuppression(UShort_t detector,
121 Char_t ring,
122 UShort_t sector,
123 UShort_t strip) const;
124 UShort_t GetSampleRate(UShort_t ddl) const;
125
bf000c32 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;
57c3c593 130 AliFMDAltroMapping* GetAltroMap() const;
9f662337 131 /** @} */
132
1a1fdef7 133 enum {
134 kBaseDDL = 0x1000 // DDL offset for the FMD
135 };
57c3c593 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
497e0e62 142protected:
9f662337 143 /** CTOR */
497e0e62 144 AliFMDParameters();
9f662337 145 /** DTOR */
497e0e62 146 virtual ~AliFMDParameters() {}
9f662337 147 /** Singleton instance */
497e0e62 148 static AliFMDParameters* fgInstance; // Static singleton instance
9f662337 149 /** Initialize gains. Try to get them from CDB */
1e8f773e 150 void InitPulseGain();
9f662337 151 /** Initialize pedestals. Try to get them from CDB */
1e8f773e 152 void InitPedestal();
9f662337 153 /** Initialize dead map. Try to get it from CDB */
1e8f773e 154 void InitDeadMap();
9f662337 155 /** Initialize sample rates. Try to get them from CDB */
1e8f773e 156 void InitSampleRate();
9f662337 157 /** Initialize zero suppression thresholds. Try to get them from CDB */
1e8f773e 158 void InitZeroSuppression();
9f662337 159 /** Initialize hardware map. Try to get it from CDB */
1e8f773e 160 void InitAltroMap();
57c3c593 161
162 Bool_t fIsInit; // Whether we've been initialised
163
8f6ee336 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
1a1fdef7 169
8f6ee336 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
177
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
57c3c593 183 AliFMDAltroMapping* fAltroMap; // Map of hardware
8f6ee336 184
57c3c593 185 ClassDef(AliFMDParameters,3)
1a1fdef7 186};
187
188#endif
189//____________________________________________________________________
190//
191// Local Variables:
192// mode: C++
193// End:
194//
195// EOF
196//
197