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 class AliFMDParameters : public TNamed
39 static AliFMDParameters* Instance();
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; }
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; }
56 // Get `Fixed' various parameters
57 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
58 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
59 UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
60 Float_t GetEdepMip() const;
61 Float_t GetPedestalFactor() const { return fPedestalFactor; }
63 // Get variable parameters
64 Bool_t IsDead(UShort_t detector,
67 UShort_t strip) const;
68 Float_t GetThreshold() const;
69 Float_t GetPulseGain(UShort_t detector,
72 UShort_t strip) const;
73 Float_t GetPedestal(UShort_t detector,
76 UShort_t strip) const;
77 Float_t GetPedestalWidth(UShort_t detector,
80 UShort_t strip) const;
81 UShort_t GetZeroSuppression(UShort_t detector,
84 UShort_t strip) const;
85 UShort_t GetSampleRate(UShort_t ddl) const;
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;
91 AliFMDAltroMapping* GetAltroMap() const;
93 kBaseDDL = 0x1000 // DDL offset for the FMD
97 virtual ~AliFMDParameters() {}
98 static AliFMDParameters* fgInstance; // Static singleton instance
99 static const char* fgkPulseGain; // Path to PulseGain calib object
100 static const char* fgkPedestal; // Path to Pedestal calib object
101 static const char* fgkDead; // Path to Dead calib object
102 static const char* fgkSampleRate; // Path to SampleRate calib object
103 static const char* fgkAltroMap; // Path to AltroMap calib object
104 static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
106 Bool_t fIsInit; // Whether we've been initialised
108 const Float_t fSiDeDxMip; // MIP dE/dx in Silicon
109 UShort_t fVA1MipRange; // # MIPs the pre-amp can do
110 UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
111 UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
112 Float_t fPedestalFactor; // Number of pedestal widths
114 Float_t fFixedPedestal; // Pedestal to subtract
115 Float_t fFixedPedestalWidth; // Width of pedestal
116 UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
117 UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
118 Float_t fFixedThreshold; //
119 mutable Float_t fFixedPulseGain; //! Gain (cached)
120 mutable Float_t fEdepMip; //! Cache of energy loss for a MIP
122 AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
123 AliFMDCalibSampleRate* fSampleRate; // Sample rate from CDB
124 AliFMDCalibPedestal* fPedestal; // Pedestals
125 AliFMDCalibGain* fPulseGain; // Pulser gain
126 AliFMDCalibDeadMap* fDeadMap; // Pulser gain
127 AliFMDAltroMapping* fAltroMap; // Map of hardware
129 ClassDef(AliFMDParameters,3)
133 //____________________________________________________________________