CMS 3D CMS Logo

List of all members | Static Public Member Functions
L1MuSignedPackingGeneric Class Reference

#include <L1MuPacking.h>

Inheritance diagram for L1MuSignedPackingGeneric:
L1MuPacking

Static Public Member Functions

static int idxFromPacked (unsigned packed, unsigned int nbits)
 get the value from the packed notation (+/-) More...
 
static unsigned packedFromIdx (int idx, unsigned int nbits)
 get the packed notation of a value, check range More...
 
static int signFromPacked (unsigned packed, unsigned int nbits)
 get the sign from the packed notation (0=positive, 1=negative) More...
 

Additional Inherited Members

- Public Member Functions inherited from L1MuPacking
virtual int idxFromPacked (unsigned packed) const =0
 get the value from the packed notation More...
 
virtual unsigned packedFromIdx (int idx) const =0
 get the packed notation of a value More...
 
virtual int signFromPacked (unsigned packed) const =0
 get the sign from the packed notation (0=positive, 1=negative) More...
 
virtual ~L1MuPacking ()
 

Detailed Description

Definition at line 113 of file L1MuPacking.h.

Member Function Documentation

◆ idxFromPacked()

static int L1MuSignedPackingGeneric::idxFromPacked ( unsigned  packed,
unsigned int  nbits 
)
inlinestatic

get the value from the packed notation (+/-)

Definition at line 119 of file L1MuPacking.h.

119  {
120  return packed & (1 << (nbits - 1)) ? (packed - (1 << nbits)) : packed;
121  };

Referenced by L1MuBinnedScale::get_idx().

◆ packedFromIdx()

static unsigned L1MuSignedPackingGeneric::packedFromIdx ( int  idx,
unsigned int  nbits 
)
inlinestatic

get the packed notation of a value, check range

Definition at line 123 of file L1MuPacking.h.

123  {
124  unsigned maxabs = 1U << (nbits - 1);
125  if (idx < -(int)maxabs && idx >= (int)maxabs)
126  edm::LogWarning("ScaleRangeViolation")
127  << "L1MuSignedPacking::packedFromIdx: warning value " << idx << "exceeds " << nbits << "-bit range !!!";
128  return ~(std::numeric_limits<unsigned>::max() << nbits) & (idx < 0 ? (1U << nbits) + idx : idx);
129  };

References training_settings::idx, createfilelist::int, SiStripPI::max, and mitigatedMETSequence_cff::U.

Referenced by L1MuBinnedScale::getPacked().

◆ signFromPacked()

static int L1MuSignedPackingGeneric::signFromPacked ( unsigned  packed,
unsigned int  nbits 
)
inlinestatic

get the sign from the packed notation (0=positive, 1=negative)

Definition at line 116 of file L1MuPacking.h.

116 { return packed & (1 << (nbits - 1)) ? 1 : 0; };
training_settings.idx
idx
Definition: training_settings.py:16
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::LogWarning
Definition: MessageLogger.h:141
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
createfilelist.int
int
Definition: createfilelist.py:10