00001 #ifndef L1GCTHFLUTSETUP_H_
00002 #define L1GCTHFLUTSETUP_H_
00003
00009 #include <vector>
00010 #include <map>
00011
00024 class L1GctHfLutSetup
00025 {
00026 public:
00027
00029 enum hfLutType { bitCountPosEtaRing1, bitCountPosEtaRing2, bitCountNegEtaRing1, bitCountNegEtaRing2,
00030 etSumPosEtaRing1, etSumPosEtaRing2, etSumNegEtaRing1, etSumNegEtaRing2,
00031 numberOfLutTypes};
00033 enum numberOfEtSumBits {
00034 kHfEtSumBits = 8,
00035 kHfEtSumNumValues = 1 << kHfEtSumBits,
00036 kHfEtSumMaxValue = kHfEtSumNumValues - 1
00037 };
00038
00039 enum numberOfCountBits {
00040 kHfCountBits = 5,
00041 kHfCountNumValues = 1 << kHfCountBits,
00042 kHfCountMaxValue = kHfCountNumValues - 1
00043 };
00044
00045 enum numberOfOutputBits {
00046 kHfOutputBits = 3,
00047 kHfOutputNumValues = 1 << kHfOutputBits,
00048 kHfOutputMaxValue = kHfOutputNumValues - 1
00049 };
00050
00051
00052 L1GctHfLutSetup();
00053 ~L1GctHfLutSetup();
00054
00055
00056 void setThresholds(const hfLutType type, const std::vector<unsigned> thr);
00057
00058
00059 std::vector<unsigned> getThresholds(const hfLutType type) const;
00060
00061 std::vector<unsigned> getCountThresholdsPosEtaRing1() const { return getThresholds(bitCountPosEtaRing1); }
00062 std::vector<unsigned> getCountThresholdsPosEtaRing2() const { return getThresholds(bitCountPosEtaRing2); }
00063 std::vector<unsigned> getCountThresholdsNegEtaRing1() const { return getThresholds(bitCountNegEtaRing1); }
00064 std::vector<unsigned> getCountThresholdsNegEtaRing2() const { return getThresholds(bitCountNegEtaRing2); }
00065 std::vector<unsigned> getEtSumThresholdsPosEtaRing1() const { return getThresholds(etSumPosEtaRing1); }
00066 std::vector<unsigned> getEtSumThresholdsPosEtaRing2() const { return getThresholds(etSumPosEtaRing2); }
00067 std::vector<unsigned> getEtSumThresholdsNegEtaRing1() const { return getThresholds(etSumNegEtaRing1); }
00068 std::vector<unsigned> getEtSumThresholdsNegEtaRing2() const { return getThresholds(etSumNegEtaRing2); }
00069
00070
00071 uint16_t outputValue(const hfLutType type, const uint16_t inputValue) const;
00072
00073 private:
00074
00075 std::map<hfLutType, std::vector<uint16_t> > m_thresholds;
00076
00077 };
00078
00079 std::ostream& operator << (std::ostream& os, const L1GctHfLutSetup& fn);
00080
00081 #endif