File indexing completed on 2024-04-06 12:04:26
0001 #ifndef L1GCTHTMISS_H
0002 #define L1GCTHTMISS_H
0003
0004 #include <ostream>
0005 #include <cstdint>
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 class L1GctHtMiss {
0017 public:
0018
0019
0020
0021
0022
0023 enum numberOfBits {
0024 kHtMissPhiNBits = 5,
0025 kHtMissMagNBits = 7,
0026 kHtMissPhiMask = (1 << kHtMissPhiNBits) - 1,
0027 kHtMissMagMask = (1 << kHtMissMagNBits) - 1,
0028 kHtMissPhiShift = 0,
0029 kHtMissMagShift = kHtMissPhiNBits,
0030 kHtMissOFlowBit = (1 << (kHtMissPhiNBits + kHtMissMagNBits)),
0031 kHtMissPhiNBins = 18,
0032 kRawCtorMask = kHtMissOFlowBit | (kHtMissMagMask << kHtMissMagShift) | (kHtMissPhiMask << kHtMissPhiShift)
0033 };
0034
0035 L1GctHtMiss();
0036
0037
0038 L1GctHtMiss(uint32_t rawData);
0039
0040
0041 L1GctHtMiss(uint32_t rawData, int16_t bx);
0042
0043 L1GctHtMiss(unsigned et, unsigned phi, bool oflow);
0044
0045 L1GctHtMiss(unsigned et, unsigned phi, bool oflow, int16_t bx);
0046
0047 virtual ~L1GctHtMiss();
0048
0049
0050 std::string name() const { return "HtMiss"; }
0051
0052
0053 bool empty() const { return false; }
0054
0055
0056 uint32_t raw() const { return m_data; }
0057
0058
0059 unsigned et() const { return (m_data >> kHtMissMagShift) & kHtMissMagMask; }
0060
0061
0062 bool overFlow() const { return (m_data & kHtMissOFlowBit) != 0; }
0063
0064
0065 unsigned phi() const { return (m_data >> kHtMissPhiShift) & kHtMissPhiMask; }
0066
0067
0068 int16_t bx() const { return m_bx; }
0069
0070
0071 int operator==(const L1GctHtMiss& e) const { return m_data == e.raw(); }
0072
0073
0074 int operator!=(const L1GctHtMiss& e) const { return !(*this == e); }
0075
0076 private:
0077 uint32_t m_data;
0078 int16_t m_bx;
0079 };
0080
0081
0082 std::ostream& operator<<(std::ostream& s, const L1GctHtMiss& c);
0083
0084 #endif