class AliFMDCalibSampleRate;
class AliFMDCalibStripRange;
class AliFMDAltroMapping;
+class AliCDBEntry;
+class AliFMDPreprocessor;
+
//____________________________________________________________________
//
// Singleton class to handle various parameters (not geometry) of the
class AliFMDParameters : public TNamed
{
public:
+ /** Enumeration of things to initialize */
+ enum What {
+ /** Pulser gain */
+ kPulseGain = 0x1, // Pulser gain
+ /** Pedestals and noise */
+ kPedestal = 0x2, // Pedestal and noise
+ /** Dead channel map */
+ kDeadMap = 0x4, // Dead channel map
+ /** Over sampling rate */
+ kSampleRate = 0x8, // Over sampling rate
+ /** Zero suppression parameters */
+ kZeroSuppression = 0x10, // Zero suppression parameters
+ /** ALTRO data map */
+ kAltroMap = 0x20 // Altro channel map
+ };
+
/** Singleton access
@return single to */
static AliFMDParameters* Instance();
/** Initialize the manager. This tries to read the parameters from
CDB. If that fails, the class uses the hard-coded parameters.
*/
- void Init(Bool_t forceReInit=kFALSE);
+ void Init(Bool_t forceReInit=kFALSE,
+ UInt_t what = (kPulseGain|kPedestal|kDeadMap|kSampleRate|
+ kZeroSuppression|kAltroMap));
+ /** Initialize the manager. This tries to read the parameters from
+ CDB. If that fails, the class uses the hard-coded parameters.
+ */
+ void Init(AliFMDPreprocessor* pp,
+ Bool_t forceReInit=kFALSE,
+ UInt_t what = (kPulseGain|kPedestal|kDeadMap|kSampleRate|
+ kZeroSuppression|kAltroMap));
/** Print all parameters.
@param option Option string */
void Print(Option_t* option="A") const;
Char_t ring,
UShort_t sector,
UShort_t strip) const;
+ /** Translate hardware address to detector coordinates
+ @param ddl DDL number
+ @param board Board address
+ @param chip Chip #
+ @param channel Channel #
+ @param det On return, Detector # (1-3)
+ @param ring On return, Ring ID ('I' or 'O')
+ @param sec On return, Sector number (0-39)
+ @param str On return, Strip number (0-511)
+ @return @c true on success. */
+ Bool_t Hardware2Detector(UInt_t ddl, UInt_t board,
+ UInt_t chip, UInt_t channel,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, UShort_t& str) const;
/** Translate hardware address to detector coordinates
@param ddl DDL number
@param addr Hardware address
@return @c true on success. */
Bool_t Hardware2Detector(UInt_t ddl, UInt_t addr, UShort_t& det,
Char_t& ring, UShort_t& sec, UShort_t& str) const;
+
+ /** Translate detector coordinates to hardware address
+ @param det Detector # (1-3)
+ @param ring Ring ID ('I' or 'O')
+ @param sec Sector number (0-39)
+ @param str Strip number (0-511)
+ @param ddl On return, DDL number
+ @param board On return, Board address
+ @param chip On return, Chip #
+ @param channel On return, Channel #
+ @return @c true on success. */
+ Bool_t Detector2Hardware(UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t str,
+ UInt_t& ddl, UInt_t& board,
+ UInt_t& chip, UInt_t& channel) const;
/** Translate detector coordinates to hardware address
@param det Detector # (1-3)
@param ring Ring ID ('I' or 'O')
virtual ~AliFMDParameters() {}
/** Singleton instance */
static AliFMDParameters* fgInstance; // Static singleton instance
+ /** Get an entry from either global AliCDBManager or passed
+ AliFMDPreprocessor.
+ @param path Path to CDB object.
+ @param pp AliFMDPreprocessor
+ @param fatal If true, raise a fatal flag if we didn't get the entry.
+ @return AliCDBEntry if found */
+ AliCDBEntry* GetEntry(const char* path, AliFMDPreprocessor* pp,
+ Bool_t fatal=kTRUE) const;
/** Initialize gains. Try to get them from CDB */
- void InitPulseGain();
+ void InitPulseGain(AliFMDPreprocessor* pp=0);
/** Initialize pedestals. Try to get them from CDB */
- void InitPedestal();
+ void InitPedestal(AliFMDPreprocessor* pp=0);
/** Initialize dead map. Try to get it from CDB */
- void InitDeadMap();
+ void InitDeadMap(AliFMDPreprocessor* pp=0);
/** Initialize sample rates. Try to get them from CDB */
- void InitSampleRate();
+ void InitSampleRate(AliFMDPreprocessor* pp=0);
/** Initialize zero suppression thresholds. Try to get them from CDB */
- void InitZeroSuppression();
+ void InitZeroSuppression(AliFMDPreprocessor* pp=0);
/** Initialize hardware map. Try to get it from CDB */
- void InitAltroMap();
+ void InitAltroMap(AliFMDPreprocessor* pp=0);
/** Initialize strip range. Try to get it from CDB */
- void InitStripRange();
+ void InitStripRange(AliFMDPreprocessor* pp=0);
Bool_t fIsInit; // Whether we've been initialised