CMS 3D CMS Logo

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

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