Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:26

0001 #ifndef L1GCTETHAD_H
0002 #define L1GCTETHAD_H
0003 
0004 #include <ostream>
0005 #include <cstdint>
0006 
0007 /*! \file L1GctEtHad.h
0008  * \Header file for the GCT energy sum output
0009  * 
0010  * \author: Jim Brooke
0011  *
0012  */
0013 
0014 /// \class L1GctEtHad
0015 /// \brief Persistable copy of total Ht measured at Level-1
0016 
0017 class L1GctEtHad {
0018 public:
0019   enum numberOfBits {
0020     kEtHadNBits = 12,
0021     kEtHadOFlowBit = 1 << kEtHadNBits,
0022     kEtHadMaxValue = kEtHadOFlowBit - 1,
0023     kRawCtorMask = kEtHadOFlowBit | kEtHadMaxValue
0024   };
0025 
0026   L1GctEtHad();
0027   L1GctEtHad(uint16_t rawData);
0028   L1GctEtHad(uint16_t rawData, int16_t bx);
0029   L1GctEtHad(unsigned et, bool oflow);
0030   L1GctEtHad(unsigned et, bool oflow, int16_t bx);
0031   virtual ~L1GctEtHad();
0032 
0033   /// name method
0034   std::string name() const { return "EtHad"; }
0035 
0036   /// empty method (= false; hadronic Et is always calculated)
0037   bool empty() const { return false; }
0038 
0039   /// get the data
0040   uint16_t raw() const { return m_data; }
0041 
0042   /// get the Et
0043   unsigned et() const { return m_data & kEtHadMaxValue; }
0044 
0045   /// get the overflow
0046   bool overFlow() const { return (m_data & kEtHadOFlowBit) != 0; }
0047 
0048   /// get bunch-crossing index
0049   int16_t bx() const { return m_bx; }
0050 
0051   /// equality operator
0052   int operator==(const L1GctEtHad& e) const { return m_data == e.raw(); }
0053 
0054   /// inequality operator
0055   int operator!=(const L1GctEtHad& e) const { return m_data != e.raw(); }
0056 
0057 private:
0058   uint16_t m_data;
0059   int16_t m_bx;
0060 };
0061 
0062 /// Pretty-print operator for L1GctEtHad
0063 std::ostream& operator<<(std::ostream& s, const L1GctEtHad& c);
0064 
0065 #endif