CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DataFormats/L1GlobalCaloTrigger/src/L1GctEtMiss.cc

Go to the documentation of this file.
00001 
00002 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
00003 
00004 L1GctEtMiss::L1GctEtMiss() : m_data(0), m_bx(0) { } 
00005 
00006 // The raw data is masked off so as only the MET magnitude, overflow + phi bits are stored.
00007 // This is because the raw data stream also contains a BC0 flag on bit 31, and bit 15 is always
00008 // set to 1.  This data is masked off so as to match an L1GctEtMiss object constructed using
00009 // the L1GctEtMiss(unsigned et, unsigned phi, bool oflow) constructor.
00010 L1GctEtMiss::L1GctEtMiss(uint32_t rawData) : m_data(rawData & kRawCtorMask), m_bx(0) { }
00011 
00012 L1GctEtMiss::L1GctEtMiss(uint32_t rawData, int16_t bx) : m_data(rawData & kRawCtorMask), m_bx(bx) { }
00013 
00014 L1GctEtMiss::L1GctEtMiss(unsigned et, unsigned phi, bool oflow) : m_data(0),
00015                                                                   m_bx(0)
00016 {
00017   if ((et <= kEtMissMaxValue) && (phi < kEtMissPhiNBins)) {
00018     m_data = et | (oflow ? kEtMissOFlowBit : 0) | ((phi & kETMissPhiMask)<<kEtMissPhiShift) ;
00019   } else {
00020     m_data = (et & kEtMissMaxValue) | kEtMissOFlowBit ;
00021   }
00022 }
00023 
00024 L1GctEtMiss::L1GctEtMiss(unsigned et, unsigned phi, bool oflow, int16_t bx) : m_data(0),
00025                                                                               m_bx(bx)
00026 {
00027   if ((et <= kEtMissMaxValue) && (phi < kEtMissPhiNBins)) {
00028     m_data = et | (oflow ? kEtMissOFlowBit : 0) | ((phi & kETMissPhiMask)<<kEtMissPhiShift) ;
00029   } else {
00030     m_data = (et & kEtMissMaxValue) | kEtMissOFlowBit ;
00031   }
00032 }
00033 
00034 L1GctEtMiss::~L1GctEtMiss() { } 
00035 
00037 std::ostream& operator<<(std::ostream& s, const L1GctEtMiss& c) {
00038   s << " L1GctEtMiss: ";
00039   s << " mag=" << c.et() << ", phi=" << c.phi();
00040   if (c.overFlow()) { s << "; overflow set"; }
00041   return s;
00042 }
00043