CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/L1GlobalCaloTrigger/interface/L1GctHtMiss.h

Go to the documentation of this file.
00001 #ifndef L1GCTHTMISS_H
00002 #define L1GCTHTMISS_H
00003 
00004 #include <ostream>
00005 #include <stdint.h>
00006 
00013 
00014 
00015 
00016 class L1GctHtMiss {
00017  public:
00018 
00024   enum numberOfBits {
00025     kHtMissPhiNBits  = 5,
00026     kHtMissMagNBits  = 7,
00027     kHtMissPhiMask   = (1 << kHtMissPhiNBits) - 1,
00028     kHtMissMagMask   = (1 << kHtMissMagNBits) - 1,
00029     kHtMissPhiShift  = 0,
00030     kHtMissMagShift  = kHtMissPhiNBits,
00031     kHtMissOFlowBit  = (1 << (kHtMissPhiNBits + kHtMissMagNBits)),
00032     kHtMissPhiNBins  = 18,
00033     kRawCtorMask     = kHtMissOFlowBit | (kHtMissMagMask << kHtMissMagShift) | (kHtMissPhiMask << kHtMissPhiShift)
00034   };
00035 
00036   L1GctHtMiss();
00037   
00039   L1GctHtMiss(uint32_t rawData);
00040   
00042   L1GctHtMiss(uint32_t rawData, int16_t bx);
00043   
00044   L1GctHtMiss(unsigned et, unsigned phi, bool oflow);
00045 
00046   L1GctHtMiss(unsigned et, unsigned phi, bool oflow, int16_t bx);
00047 
00048   virtual ~L1GctHtMiss();
00049 
00051   std::string name() const { return "HtMiss"; }
00052 
00054   bool empty() const { return false; }
00055 
00057   uint32_t raw() const { return m_data; }
00058 
00060   unsigned et() const { return (m_data >> kHtMissMagShift) & kHtMissMagMask; }
00061 
00063   bool overFlow() const { return (m_data & kHtMissOFlowBit)!=0; }
00064 
00066   unsigned phi() const { return (m_data >> kHtMissPhiShift) & kHtMissPhiMask; }
00067 
00069   int16_t bx() const { return m_bx; }
00070 
00072   int operator==(const L1GctHtMiss& e) const { return m_data==e.raw(); }
00073 
00075   int operator!=(const L1GctHtMiss& e) const { return !(*this == e); }
00076 
00077  private:
00078 
00079   uint32_t m_data;
00080   int16_t m_bx;
00081 
00082 };
00083 
00085 std::ostream& operator<<(std::ostream& s, const L1GctHtMiss& c);
00086 
00087 
00088 #endif