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