Access to the headers from RAW
[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
36class AliFMDParameters : public TNamed
37{
38public:
39 static AliFMDParameters* Instance();
57c3c593 40
41 void Init();
1a1fdef7 42
8f6ee336 43 // Set various `Fixed' parameters
44 void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
45 void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
46 void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
47 void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
48
49 // Set various variable parameter defaults
50 void SetZeroSuppression(UShort_t s=0) { fFixedZeroSuppression = s; }
51 void SetSampleRate(UShort_t r=1) { fFixedSampleRate = (r>2?2:r);}
52 void SetPedestal(Float_t p=10) { fFixedPedestal = p; }
53 void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; }
54 void SetThreshold(Float_t t=0) { fFixedThreshold = t; }
1a1fdef7 55
8f6ee336 56 // Get `Fixed' various parameters
1a1fdef7 57 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
58 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
59 UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
1a1fdef7 60 Float_t GetEdepMip() const;
1a1fdef7 61 Float_t GetPedestalFactor() const { return fPedestalFactor; }
62
8f6ee336 63 // Get variable parameters
64 Bool_t IsDead(UShort_t detector,
65 Char_t ring,
66 UShort_t sector,
67 UShort_t strip) const;
68 Float_t GetThreshold() const;
69 Float_t GetPulseGain(UShort_t detector,
70 Char_t ring,
71 UShort_t sector,
72 UShort_t strip) const;
73 Float_t GetPedestal(UShort_t detector,
74 Char_t ring,
75 UShort_t sector,
76 UShort_t strip) const;
77 Float_t GetPedestalWidth(UShort_t detector,
78 Char_t ring,
79 UShort_t sector,
80 UShort_t strip) const;
81 UShort_t GetZeroSuppression(UShort_t detector,
82 Char_t ring,
83 UShort_t sector,
84 UShort_t strip) const;
85 UShort_t GetSampleRate(UShort_t ddl) const;
86
bf000c32 87 Bool_t Hardware2Detector(UInt_t ddl, UInt_t addr, UShort_t& det,
88 Char_t& ring, UShort_t& sec, UShort_t& str) const;
89 Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec,
90 UShort_t str, UInt_t& ddl, UInt_t& addr) const;
57c3c593 91 AliFMDAltroMapping* GetAltroMap() const;
1a1fdef7 92 enum {
93 kBaseDDL = 0x1000 // DDL offset for the FMD
94 };
57c3c593 95 static const char* fgkPulseGain; // Path to PulseGain calib object
96 static const char* fgkPedestal; // Path to Pedestal calib object
97 static const char* fgkDead; // Path to Dead calib object
98 static const char* fgkSampleRate; // Path to SampleRate calib object
99 static const char* fgkAltroMap; // Path to AltroMap calib object
100 static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
497e0e62 101protected:
102 AliFMDParameters();
103 virtual ~AliFMDParameters() {}
104 static AliFMDParameters* fgInstance; // Static singleton instance
1e8f773e 105 void InitPulseGain();
106 void InitPedestal();
107 void InitDeadMap();
108 void InitSampleRate();
109 void InitZeroSuppression();
110 void InitAltroMap();
57c3c593 111
112 Bool_t fIsInit; // Whether we've been initialised
113
8f6ee336 114 const Float_t fSiDeDxMip; // MIP dE/dx in Silicon
115 UShort_t fVA1MipRange; // # MIPs the pre-amp can do
116 UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
117 UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
118 Float_t fPedestalFactor; // Number of pedestal widths
1a1fdef7 119
8f6ee336 120 Float_t fFixedPedestal; // Pedestal to subtract
121 Float_t fFixedPedestalWidth; // Width of pedestal
122 UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
123 UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
124 Float_t fFixedThreshold; //
125 mutable Float_t fFixedPulseGain; //! Gain (cached)
126 mutable Float_t fEdepMip; //! Cache of energy loss for a MIP
127
128 AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
129 AliFMDCalibSampleRate* fSampleRate; // Sample rate from CDB
130 AliFMDCalibPedestal* fPedestal; // Pedestals
131 AliFMDCalibGain* fPulseGain; // Pulser gain
132 AliFMDCalibDeadMap* fDeadMap; // Pulser gain
57c3c593 133 AliFMDAltroMapping* fAltroMap; // Map of hardware
8f6ee336 134
57c3c593 135 ClassDef(AliFMDParameters,3)
1a1fdef7 136};
137
138#endif
139//____________________________________________________________________
140//
141// Local Variables:
142// mode: C++
143// End:
144//
145// EOF
146//
147