X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=FMD%2FAliFMDParameters.h;h=c8c05127d486dfa82de704492ba24ee077a29890;hp=9d0a26f500ce31d442aadb306c395c37166ba6d2;hb=dcc2ade075ecd6298757d84b65bdd14ca92f42f6;hpb=f38b16535e46e28a81d875e6a66476b85fe80e8b
diff --git a/FMD/AliFMDParameters.h b/FMD/AliFMDParameters.h
index 9d0a26f500c..c8c05127d48 100644
--- a/FMD/AliFMDParameters.h
+++ b/FMD/AliFMDParameters.h
@@ -93,10 +93,13 @@ public:
/** ALTRO data map */
kAltroMap = 0x20, // Altro channel map
/** Strip Range */
- kStripRange = 0x40 //Strip range
-
+ kStripRange = 0x40 //Strip range,
};
-
+ enum {
+ kAll = (kPulseGain|kPedestal|kDeadMap|kSampleRate|
+ kZeroSuppression|kAltroMap|kStripRange)
+ };
+
/** Singleton access
@return single to */
static AliFMDParameters* Instance();
@@ -104,16 +107,57 @@ public:
/** 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,
- UInt_t what = (kPulseGain|kPedestal|kDeadMap|kSampleRate|
- kZeroSuppression|kAltroMap|kStripRange));
+ void Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll );
/** 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|kStripRange));
+ Bool_t forceReInit=kFALSE,
+ UInt_t what=kAll);
+ /**
+ * Initialize the manager. This will try to read some calibrations
+ * (sample rate, strip range, gains, pedestals) from local comma
+ * separated value (CSV) files in the directory pointed at by @a
+ * path. If they are not found, then they will be retrieved from
+ * OCDB as appropriately. Other calibrations are always read from
+ * OCDB.
+ *
+ * The CSV files should be named as
+ *
+ * - Pedestals: pedsdet_number.csv
+ * - Gains: gainsdet_number.csv
+ * - Sample Rate: conditionsdet_number.csv
+ * - Strip Range: conditionsdet_number.csv
+ *
+ * where det_number is the detector number (1, 2, or 3).
+ *
+ * @param path Where to look for the CSV files
+ * @param forceReInit Always reinitialise
+ * @param what What calibrations to load.
+ */
+ void Init(const char* path,
+ Bool_t forceReInit=kFALSE,
+ UInt_t what=kAll);
+
+ /**
+ * Automatically generate a dead map from the pedestals and gains.
+ * A channel is marked as dead of the noise is too high (currently
+ * more than 10 ADC counts), or the gain is unreasonable (currently
+ * larger than 10, or smaller than 0.1).
+ *
+ * The procedure does not overwrite channels previously marked as
+ * dead - e.g., channels marked as dead in the calibration loaded
+ * from OCDB will continue to be marked as dead. That is, this
+ * procedure will never make a channel un-dead.
+ *
+ * @param maxNoise Maximum noise value before a channel is marked
+ * as dead.
+ * @param minGain Minimum value of the calibrated gain before a
+ * channel is considered dead.
+ * @param maxGain Maximum value of the calibrated gain before a
+ * channel is considered dead.
+ */
+ void MakeDeadMap(Float_t maxNoise=10, Float_t minGain=.1, Float_t maxGain=10);
/** Print all parameters.
@param option Option string */
void Print(Option_t* option="A") const;
@@ -146,6 +190,15 @@ public:
void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
/** @param f Factor to use for accepting a signal. */
void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
+ /** @param n Number of pre-samples to keep during zero-suppression -
+ only used in simulation. */
+ void SetZSPreSamples(UShort_t n=1) { fZSPre = (n & 0x3); }
+ /** @param n Number of post-samples to keep during zero-suppression -
+ only used in simulation. */
+ void SetZSPostSamples(UShort_t n=1) { fZSPost = (n & 0x3); }
+ /** @param use If true, do pedestal subtraction before zero
+ suppression - only used in simulation */
+ void SetZSPedSubtract(Bool_t use=kTRUE) { fZSPedSubtract = use; }
/** @} */
/** @{ */
@@ -157,6 +210,8 @@ public:
void SetSampleRate(AliFMDCalibSampleRate* r) { fSampleRate = r; }
/** @param p Pedestal value in ADC counts */
void SetPedestal(Float_t p=10) { fFixedPedestal = p; }
+ /** @param p Pedestal map */
+ void SetPedestal(AliFMDCalibPedestal* p) { fPedestal = p; }
/** @param w Pedestal width in ADC counts */
void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; }
/** @param t Threshold used for 1 MIP acceptance. */
@@ -170,6 +225,8 @@ public:
the older invalid format (7 32bit words with bogus entries)
@param yes if true the raw data has complete data header */
void UseCompleteHeader(Bool_t yes=kTRUE) { fHasCompleteHeader = yes; }
+ /** @param g Gain map */
+ void SetGain(AliFMDCalibGain* g) { fPulseGain = g; }
/** @} */
/** @{ */
@@ -182,8 +239,19 @@ public:
UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
/** @return The average energy deposited by one MIP */
Float_t GetEdepMip() const;
+ /** @return The conversion factor from DAC to ADC */
+ Float_t GetDACPerMIP() const;
/** @return The factor used of signal acceptance */
Float_t GetPedestalFactor() const { return fPedestalFactor; }
+ /** @param n Number of pre-samples to keep during zero-suppression -
+ only used in simulation. */
+ UShort_t GetZSPreSamples() const { return fZSPre; }
+ /** @param n Number of post-samples to keep during zero-suppression -
+ only used in simulation. */
+ UShort_t GetZSPostSamples() const { return fZSPost; }
+ /** @param use If true, do pedestal subtraction before zero
+ suppression - only used in simulation */
+ Bool_t IsZSPedSubtract() const { return fZSPedSubtract; }
/** @} */
/** @{ */
@@ -296,26 +364,12 @@ public:
@param str On return, the base of strip #
@param sam On return, the sample number for this strip
@return @c true on success, false otherwise */
- Bool_t Hardware2Detector(UInt_t ddl, UInt_t board,
- UInt_t altro, UInt_t chan,
+ Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
+ UShort_t altro, UShort_t chan,
UShort_t timebin,
UShort_t& det, Char_t& ring,
UShort_t& sec, Short_t& str,
UShort_t& sam) 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, Short_t& str) const;
/** Map a hardware address into a detector index.
@param ddl Hardware DDL number
@param hwaddr Hardware address.
@@ -326,11 +380,26 @@ public:
@param str On return, the base of strip #
@param sam On return, the sample number for this strip
@return @c true on success, false otherwise */
- Bool_t Hardware2Detector(UInt_t ddl, UInt_t hwaddr,
+ Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr,
UShort_t timebin,
UShort_t& det, Char_t& ring,
UShort_t& sec, Short_t& str,
UShort_t& sam) const;
+#if 0
+ /** 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(UShort_t ddl, UShort_t board,
+ UShort_t chip, UShort_t channel,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, Short_t& str) const;
/** Translate hardware address to detector coordinates
@param ddl DDL number
@param addr Hardware address
@@ -339,8 +408,9 @@ public:
@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 addr, UShort_t& det,
+ Bool_t Hardware2Detector(UShort_t ddl, UShort_t addr, UShort_t& det,
Char_t& ring, UShort_t& sec, Short_t& str) const;
+#endif
/** Map a detector index into a hardware address.
@param det The detector #
@@ -357,23 +427,9 @@ public:
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
- UInt_t& ddl, UInt_t& board,
- UInt_t& altro, UInt_t& channel,
+ UShort_t& ddl, UShort_t& board,
+ UShort_t& altro, UShort_t& channel,
UShort_t& timebin) 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;
/** Map a detector index into a hardware address.
@param det The detector #
@param ring The ring ID
@@ -387,8 +443,23 @@ public:
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
- UInt_t& ddl, UInt_t& hwaddr,
+ UShort_t& ddl, UShort_t& hwaddr,
UShort_t& timebin) const;
+#if 0
+ /** 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,
+ UShort_t& ddl, UShort_t& board,
+ UShort_t& chip, UShort_t& channel) const;
/** Translate detector coordinates to hardware address
@param det Detector # (1-3)
@param ring Ring ID ('I' or 'O')
@@ -398,7 +469,8 @@ public:
@param addr On return, Hardware address
@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& addr) const;
+ UShort_t str, UShort_t& ddl, UShort_t& addr) const;
+#endif
/** Get the map that translates hardware to detector coordinates
@return Get the map that translates hardware to detector
coordinates */
@@ -420,6 +492,7 @@ public:
static const char* GetPedestalShuttleID() {return fkPedestalShuttleID;}
static const char* GetGainShuttleID() {return fkGainShuttleID;}
static const char* GetConditionsShuttleID() {return fkConditionsShuttleID;}
+
protected:
/** CTOR */
AliFMDParameters();
@@ -432,6 +505,9 @@ protected:
fAltroChannelSize(o.fAltroChannelSize),
fChannelsPerAltro(o.fChannelsPerAltro),
fPedestalFactor(o.fPedestalFactor),
+ fZSPre(o.fZSPre),
+ fZSPost(o.fZSPost),
+ fZSPedSubtract(o.fZSPedSubtract),
fFixedPedestal(o.fFixedPedestal),
fFixedPedestalWidth(o.fFixedPedestalWidth),
fFixedZeroSuppression(o.fFixedZeroSuppression),
@@ -457,6 +533,19 @@ protected:
virtual ~AliFMDParameters() {}
/** Singleton instance */
static AliFMDParameters* fgInstance; // Static singleton instance
+ /**
+ * Check if the file prefixnumber exists in @a path,
+ * and write the full path to @a f.
+ *
+ * @param prefix File prefix (cond, peds, gains, ...)
+ * @param path Path to files
+ * @param number Detector number (1, 2, or 3)
+ * @param f On return full path to file (if found)
+ *
+ * @return @c true if file exists and is readable, @c false otherwise
+ */
+ Bool_t CheckFile(const char* prefix, const char* path,
+ int number, TString& f) const;
/** Get an entry from either global AliCDBManager or passed
AliFMDPreprocessor.
@param path Path to CDB object.
@@ -494,6 +583,9 @@ protected:
UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
Float_t fPedestalFactor; // Number of pedestal widths
+ UShort_t fZSPre; // Number of pre-samples in ZS
+ UShort_t fZSPost; // Number of post-samples in ZS
+ Bool_t fZSPedSubtract; // Pedestal subtraction before ZS
Float_t fFixedPedestal; // Pedestal to subtract
Float_t fFixedPedestalWidth; // Width of pedestal