File indexing completed on 2024-04-06 12:04:26
0001 #ifndef L1GCTETTOTAL_H
0002 #define L1GCTETTOTAL_H
0003
0004 #include <ostream>
0005 #include <cstdint>
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 class L1GctEtTotal {
0018 public:
0019 enum numberOfBits {
0020 kEtTotalNBits = 12,
0021 kEtTotalOFlowBit = 1 << kEtTotalNBits,
0022 kEtTotalMaxValue = kEtTotalOFlowBit - 1,
0023 kRawCtorMask = kEtTotalOFlowBit | kEtTotalMaxValue
0024 };
0025
0026 L1GctEtTotal();
0027 L1GctEtTotal(uint16_t rawData);
0028 L1GctEtTotal(uint16_t rawData, int16_t bx);
0029 L1GctEtTotal(unsigned et, bool oflow);
0030 L1GctEtTotal(unsigned et, bool oflow, int16_t bx);
0031 virtual ~L1GctEtTotal();
0032
0033
0034 std::string name() const { return "EtTotal"; }
0035
0036
0037 bool empty() const { return false; }
0038
0039
0040 uint16_t raw() const { return m_data; }
0041
0042
0043 unsigned et() const { return m_data & kEtTotalMaxValue; }
0044
0045
0046 bool overFlow() const { return (m_data & kEtTotalOFlowBit) != 0; }
0047
0048
0049 int16_t bx() const { return m_bx; }
0050
0051
0052 int operator==(const L1GctEtTotal& e) const { return m_data == e.raw(); }
0053
0054
0055 int operator!=(const L1GctEtTotal& e) const { return m_data != e.raw(); }
0056
0057 private:
0058 uint16_t m_data;
0059 int16_t m_bx;
0060 };
0061
0062
0063 std::ostream& operator<<(std::ostream& s, const L1GctEtTotal& c);
0064
0065 #endif