Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:47

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