Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
0003 
0004 L1GctEtMiss::L1GctEtMiss() : m_data(0), m_bx(0) {}
0005 
0006 // The raw data is masked off so as only the MET magnitude, overflow + phi bits are stored.
0007 // This is because the raw data stream also contains a BC0 flag on bit 31, and bit 15 is always
0008 // set to 1.  This data is masked off so as to match an L1GctEtMiss object constructed using
0009 // the L1GctEtMiss(unsigned et, unsigned phi, bool oflow) constructor.
0010 L1GctEtMiss::L1GctEtMiss(uint32_t rawData) : m_data(rawData & kRawCtorMask), m_bx(0) {}
0011 
0012 L1GctEtMiss::L1GctEtMiss(uint32_t rawData, int16_t bx) : m_data(rawData & kRawCtorMask), m_bx(bx) {}
0013 
0014 L1GctEtMiss::L1GctEtMiss(unsigned et, unsigned phi, bool oflow) : m_data(0), m_bx(0) {
0015   if ((et <= kEtMissMaxValue) && (phi < kEtMissPhiNBins)) {
0016     m_data = et | (oflow ? kEtMissOFlowBit : 0) | ((phi & kETMissPhiMask) << kEtMissPhiShift);
0017   } else {
0018     m_data = (et & kEtMissMaxValue) | kEtMissOFlowBit;
0019   }
0020 }
0021 
0022 L1GctEtMiss::L1GctEtMiss(unsigned et, unsigned phi, bool oflow, int16_t bx) : m_data(0), m_bx(bx) {
0023   if ((et <= kEtMissMaxValue) && (phi < kEtMissPhiNBins)) {
0024     m_data = et | (oflow ? kEtMissOFlowBit : 0) | ((phi & kETMissPhiMask) << kEtMissPhiShift);
0025   } else {
0026     m_data = (et & kEtMissMaxValue) | kEtMissOFlowBit;
0027   }
0028 }
0029 
0030 L1GctEtMiss::~L1GctEtMiss() {}
0031 
0032 /// Pretty-print operator for L1GctEtMiss
0033 std::ostream& operator<<(std::ostream& s, const L1GctEtMiss& c) {
0034   s << " L1GctEtMiss: ";
0035   s << " mag=" << c.et() << ", phi=" << c.phi();
0036   if (c.overFlow()) {
0037     s << "; overflow set";
0038   }
0039   return s;
0040 }