#include <L1MuPacking.h>
Static Public Member Functions | |
static int | idxFromPacked (unsigned packed, unsigned int nbits) |
get the value from the packed notation (+/-) | |
static unsigned | packedFromIdx (int idx, unsigned int nbits) |
get the packed notation of a value, check range | |
static int | signFromPacked (unsigned packed, unsigned int nbits) |
get the sign from the packed notation (0=positive, 1=negative) |
Definition at line 103 of file L1MuPacking.h.
static int L1MuSignedPackingGeneric::idxFromPacked | ( | unsigned | packed, |
unsigned int | nbits | ||
) | [inline, static] |
get the value from the packed notation (+/-)
Definition at line 109 of file L1MuPacking.h.
Referenced by L1MuBinnedScale::get_idx().
{ return packed & (1 << (nbits-1)) ? (packed - (1 << nbits) ) : packed;};
static unsigned L1MuSignedPackingGeneric::packedFromIdx | ( | int | idx, |
unsigned int | nbits | ||
) | [inline, static] |
get the packed notation of a value, check range
Definition at line 111 of file L1MuPacking.h.
References UserOptions_cff::idx.
Referenced by L1MuBinnedScale::getPacked().
{ unsigned maxabs = 1 << (nbits-1) ; if (idx < -(int)maxabs && idx >= (int)maxabs) edm::LogWarning("ScaleRangeViolation") << "L1MuSignedPacking::packedFromIdx: warning value " << idx << "exceeds " << nbits << "-bit range !!!"; return ~(~0 << nbits) & (idx < 0 ? (1 << nbits) + idx : idx); };
static int L1MuSignedPackingGeneric::signFromPacked | ( | unsigned | packed, |
unsigned int | nbits | ||
) | [inline, static] |
get the sign from the packed notation (0=positive, 1=negative)
Definition at line 106 of file L1MuPacking.h.
{ return packed & (1 << (nbits-1)) ? 1 : 0;};