CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DataFormats/L1GlobalCaloTrigger/interface/L1GctEtHad.h

Go to the documentation of this file.
00001 #ifndef L1GCTETHAD_H
00002 #define L1GCTETHAD_H
00003 
00004 #include <ostream>
00005 #include <stdint.h>
00006 
00015 
00016 
00017 
00018 class L1GctEtHad {
00019  public:
00020 
00021   enum numberOfBits {
00022     kEtHadNBits    = 12,
00023     kEtHadOFlowBit = 1 << kEtHadNBits,
00024     kEtHadMaxValue = kEtHadOFlowBit - 1,
00025     kRawCtorMask   = kEtHadOFlowBit | kEtHadMaxValue
00026   };
00027 
00028   L1GctEtHad();
00029   L1GctEtHad(uint16_t rawData);
00030   L1GctEtHad(uint16_t rawData, int16_t bx);
00031   L1GctEtHad(unsigned et, bool oflow);
00032   L1GctEtHad(unsigned et, bool oflow, int16_t bx);
00033   virtual ~L1GctEtHad();
00034 
00036   std::string name() const { return "EtHad"; }
00037 
00039   bool empty() const { return false; }
00040 
00042   uint16_t raw() const { return m_data; }
00043 
00045   unsigned et() const { return m_data & kEtHadMaxValue; }
00046 
00048   bool overFlow() const { return (m_data & kEtHadOFlowBit)!=0; }
00049 
00051   int16_t bx() const { return m_bx; }
00052 
00054   int operator==(const L1GctEtHad& e) const { return m_data==e.raw(); }
00055 
00057   int operator!=(const L1GctEtHad& e) const { return m_data!=e.raw(); }
00058 
00059  private:
00060 
00061   uint16_t m_data;
00062   int16_t m_bx;
00063 
00064 };
00065 
00067 std::ostream& operator<<(std::ostream& s, const L1GctEtHad& c);
00068 
00069 #endif