#include <L1MuPacking.h>
Public Member Functions | |
virtual int | idxFromPacked (unsigned packed) const |
get the value from the packed notation (+/-) | |
virtual unsigned | packedFromIdx (int idx) const |
get the packed notation of a value, check range | |
virtual int | signFromPacked (unsigned packed) const |
get the sign from the packed notation (0=positive, 1=negative) |
Packing of a signed int in a bit field (2's complement)
Definition at line 86 of file L1MuPacking.h.
virtual int L1MuSignedPacking< Bits >::idxFromPacked | ( | unsigned | packed | ) | const [inline, virtual] |
get the value from the packed notation (+/-)
Implements L1MuPacking.
Definition at line 92 of file L1MuPacking.h.
Referenced by L1MuGMTMerger::projectedPhi(), and L1MuGMTLFMatchQualLUT::TheLookupFunction().
{ return packed & (1 << (Bits-1)) ? (packed - (1 << Bits) ) : packed;};
virtual unsigned L1MuSignedPacking< Bits >::packedFromIdx | ( | int | idx | ) | const [inline, virtual] |
get the packed notation of a value, check range
Implements L1MuPacking.
Definition at line 94 of file L1MuPacking.h.
References UserOptions_cff::idx.
Referenced by L1MuGMTMatcher::lookup_mq(), L1MuDTTrack::setEta(), L1MuGMTLFPhiProLUT::TheLookupFunction(), L1MuGMTLFDeltaEtaLUT::TheLookupFunction(), and L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction().
{ unsigned maxabs = 1 << (Bits-1) ; if (idx < -(int)maxabs && idx >= (int)maxabs) edm::LogWarning("ScaleRangeViolation") << "L1MuSignedPacking::packedFromIdx: warning value " << idx << "exceeds " << Bits << "-bit range !!!"; return ~(~0 << Bits) & (idx < 0 ? (1 << Bits) + idx : idx); };
virtual int L1MuSignedPacking< Bits >::signFromPacked | ( | unsigned | packed | ) | const [inline, virtual] |
get the sign from the packed notation (0=positive, 1=negative)
Implements L1MuPacking.
Definition at line 89 of file L1MuPacking.h.
{ return packed & (1 << (Bits-1)) ? 1 : 0;};