CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
L1MuSignedPacking< Bits > Class Template Reference

#include <L1MuPacking.h>

Inheritance diagram for L1MuSignedPacking< Bits >:
L1MuPacking

Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from L1MuPacking
 COND_SERIALIZABLE
 

Detailed Description

template<unsigned int Bits>
class L1MuSignedPacking< Bits >

Packing of a signed int in a bit field (2's complement)

Definition at line 92 of file L1MuPacking.h.

Member Function Documentation

template<unsigned int Bits>
virtual int L1MuSignedPacking< Bits >::idxFromPacked ( unsigned  packed) const
inlinevirtual

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

Implements L1MuPacking.

Definition at line 98 of file L1MuPacking.h.

Referenced by L1MuGMTMerger::projectedPhi(), and L1MuGMTLFMatchQualLUT::TheLookupFunction().

98 { return packed & (1 << (Bits-1)) ? (packed - (1 << Bits) ) : packed;};
template<unsigned int Bits>
virtual unsigned L1MuSignedPacking< Bits >::packedFromIdx ( int  idx) const
inlinevirtual

get the packed notation of a value, check range

Implements L1MuPacking.

Definition at line 100 of file L1MuPacking.h.

References customizeTrackingMonitorSeedNumber::idx.

Referenced by L1MuGMTMatcher::lookup_mq(), L1MuDTTrack::setEta(), L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction(), L1MuGMTLFDeltaEtaLUT::TheLookupFunction(), and L1MuGMTLFPhiProLUT::TheLookupFunction().

100  {
101  unsigned maxabs = 1 << (Bits-1) ;
102  if (idx < -(int)maxabs && idx >= (int)maxabs) edm::LogWarning("ScaleRangeViolation")
103  << "L1MuSignedPacking::packedFromIdx: warning value " << idx
104  << "exceeds " << Bits << "-bit range !!!";
105  return ~(~0 << Bits) & (idx < 0 ? (1 << Bits) + idx : idx);
106  };
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
template<unsigned int Bits>
virtual int L1MuSignedPacking< Bits >::signFromPacked ( unsigned  packed) const
inlinevirtual

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

Implements L1MuPacking.

Definition at line 95 of file L1MuPacking.h.

95 { return packed & (1 << (Bits-1)) ? 1 : 0;};