CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
TTTrack_TrackWord Class Reference

#include <TTTrack_TrackWord.h>

Inheritance diagram for TTTrack_TrackWord:
TTTrack< T >

Public Types

typedef ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
 
typedef ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
 
typedef ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
 
typedef ap_uint< TrackBitWidths::kD0Size > d0_t
 
typedef ap_uint< TrackBitWidths::kHitPatternSize > hit_t
 
typedef ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
 
typedef ap_uint< TrackBitWidths::kPhiSize > phi_t
 
typedef ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
 
typedef ap_uint< TrackBitWidths::kRinvSize > rinv_t
 
typedef ap_uint< TrackBitWidths::kTanlSize > tanl_t
 
typedef std::bitset< TrackBitWidths::kTrackWordSize > tkword_bs_t
 
typedef ap_uint< TrackBitWidths::kTrackWordSize > tkword_t
 
enum  TrackBitLocations {
  kMVAOtherLSB = 0, kMVAOtherMSB = kMVAOtherLSB + TrackBitWidths::kMVAOtherSize - 1, kMVAQualityLSB = kMVAOtherMSB + 1, kMVAQualityMSB = kMVAQualityLSB + TrackBitWidths::kMVAQualitySize - 1,
  kHitPatternLSB = kMVAQualityMSB + 1, kHitPatternMSB = kHitPatternLSB + TrackBitWidths::kHitPatternSize - 1, kBendChi2LSB = kHitPatternMSB + 1, kBendChi2MSB = kBendChi2LSB + TrackBitWidths::kBendChi2Size - 1,
  kD0LSB = kBendChi2MSB + 1, kD0MSB = kD0LSB + TrackBitWidths::kD0Size - 1, kChi2RZLSB = kD0MSB + 1, kChi2RZMSB = kChi2RZLSB + TrackBitWidths::kChi2RZSize - 1,
  kZ0LSB = kChi2RZMSB + 1, kZ0MSB = kZ0LSB + TrackBitWidths::kZ0Size - 1, kTanlLSB = kZ0MSB + 1, kTanlMSB = kTanlLSB + TrackBitWidths::kTanlSize - 1,
  kChi2RPhiLSB = kTanlMSB + 1, kChi2RPhiMSB = kChi2RPhiLSB + TrackBitWidths::kChi2RPhiSize - 1, kPhiLSB = kChi2RPhiMSB + 1, kPhiMSB = kPhiLSB + TrackBitWidths::kPhiSize - 1,
  kRinvLSB = kPhiMSB + 1, kRinvMSB = kRinvLSB + TrackBitWidths::kRinvSize - 1, kValidLSB = kRinvMSB + 1, kValidMSB = kValidLSB + TrackBitWidths::kValidSize - 1
}
 
enum  TrackBitWidths {
  kMVAOtherSize = 6, kMVAQualitySize = 3, kHitPatternSize = 7, kBendChi2Size = 3,
  kD0Size = 13, kChi2RZSize = 4, kZ0Size = 12, kTanlSize = 16,
  kChi2RPhiSize = 4, kPhiSize = 12, kRinvSize = 15, kValidSize = 1,
  kTrackWordSize
}
 
typedef ap_uint< TrackBitWidths::kValidSize > valid_t
 
typedef ap_uint< TrackBitWidths::kZ0Size > z0_t
 

Public Member Functions

double getBendChi2 () const
 
unsigned int getBendChi2Bits () const
 
bendChi2_t getBendChi2Word () const
 
double getChi2RPhi () const
 
unsigned int getChi2RPhiBits () const
 
chi2rphi_t getChi2RPhiWord () const
 
double getChi2RZ () const
 
unsigned int getChi2RZBits () const
 
chi2rz_t getChi2RZWord () const
 
double getD0 () const
 
unsigned int getD0Bits () const
 
d0_t getD0Word () const
 
unsigned int getHitPattern () const
 
unsigned int getHitPatternBits () const
 
hit_t getHitPatternWord () const
 
unsigned int getMVAOther () const
 
unsigned int getMVAOtherBits () const
 
otherMVA_t getMVAOtherWord () const
 
unsigned int getMVAQuality () const
 
unsigned int getMVAQualityBits () const
 
qualityMVA_t getMVAQualityWord () const
 
unsigned int getNStubs () const
 
double getPhi () const
 
unsigned int getPhiBits () const
 
phi_t getPhiWord () const
 
double getRinv () const
 
unsigned int getRinvBits () const
 
rinv_t getRinvWord () const
 
double getTanl () const
 
unsigned int getTanlBits () const
 
tanl_t getTanlWord () const
 
tkword_t getTrackWord () const
 
bool getValid () const
 
unsigned int getValidBits () const
 
valid_t getValidWord () const
 
double getZ0 () const
 
unsigned int getZ0Bits () const
 
z0_t getZ0Word () const
 
TTTrack_TrackWordoperator= (const TTTrack_TrackWord &word)
 
void setTrackWord (unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
 
void setTrackWord (unsigned int valid, unsigned int rInv, unsigned int phi0, unsigned int tanl, unsigned int z0, unsigned int d0, unsigned int chi2RPhi, unsigned int chi2RZ, unsigned int bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther)
 
void setTrackWord (ap_uint< TrackBitWidths::kValidSize > valid, ap_uint< TrackBitWidths::kRinvSize > rInv, ap_uint< TrackBitWidths::kPhiSize > phi0, ap_uint< TrackBitWidths::kTanlSize > tanl, ap_uint< TrackBitWidths::kZ0Size > z0, ap_uint< TrackBitWidths::kD0Size > d0, ap_uint< TrackBitWidths::kChi2RPhiSize > chi2RPhi, ap_uint< TrackBitWidths::kChi2RZSize > chi2RZ, ap_uint< TrackBitWidths::kBendChi2Size > bendChi2, ap_uint< TrackBitWidths::kHitPatternSize > hitPattern, ap_uint< TrackBitWidths::kMVAQualitySize > mvaQuality, ap_uint< TrackBitWidths::kMVAOtherSize > mvaOther)
 
bool singleDigitizationSchemeTest (const double floatingPointValue, const unsigned int nBits, const double lsb) const
 
void testDigitizationScheme () const
 
 TTTrack_TrackWord ()
 
 TTTrack_TrackWord (unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
 
 TTTrack_TrackWord (unsigned int valid, unsigned int rInv, unsigned int phi0, unsigned int tanl, unsigned int z0, unsigned int d0, unsigned int chi2RPhi, unsigned int chi2RZ, unsigned int bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther)
 
 TTTrack_TrackWord (const TTTrack_TrackWord &word)
 

Static Public Attributes

static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
 
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
 
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
 
static constexpr double minD0 = -16.
 
static constexpr double minPhi0 = -0.7853981696
 
static constexpr double minRinv = -0.006
 
static constexpr double minTanl = -8.
 
static constexpr double minZ0 = -20.46912512
 
static constexpr unsigned int nSectors = 9
 
static constexpr double sectorWidth = (2. * M_PI) / nSectors
 
static constexpr double stepD0 = (1. / (1 << 8))
 
static constexpr double stepPhi0 = (2. * std::abs(minPhi0)) / (1 << TrackBitWidths::kPhiSize)
 
static constexpr double stepRinv = (2. * std::abs(minRinv)) / (1 << TrackBitWidths::kRinvSize)
 
static constexpr double stepTanL = (1. / (1 << 12))
 
static constexpr double stepZ0 = (2. * std::abs(minZ0)) / (1 << TrackBitWidths::kZ0Size)
 

Protected Member Functions

float localPhi (float globalPhi, unsigned int sector) const
 

Private Member Functions

unsigned int countSetBits (unsigned int n) const
 
unsigned int digitizeSignedValue (double value, unsigned int nBits, double lsb) const
 
template<typename T >
constexpr unsigned int getBin (double value, const T &bins) const
 
double undigitizeSignedValue (unsigned int twosValue, unsigned int nBits, double lsb) const
 

Private Attributes

tkword_bs_t trackWord_
 

Detailed Description

Definition at line 35 of file TTTrack_TrackWord.h.

Member Typedef Documentation

◆ bendChi2_t

typedef ap_uint<TrackBitWidths::kBendChi2Size> TTTrack_TrackWord::bendChi2_t

Definition at line 124 of file TTTrack_TrackWord.h.

◆ chi2rphi_t

typedef ap_uint<TrackBitWidths::kChi2RPhiSize> TTTrack_TrackWord::chi2rphi_t

Definition at line 122 of file TTTrack_TrackWord.h.

◆ chi2rz_t

typedef ap_uint<TrackBitWidths::kChi2RZSize> TTTrack_TrackWord::chi2rz_t

Definition at line 123 of file TTTrack_TrackWord.h.

◆ d0_t

typedef ap_uint<TrackBitWidths::kD0Size> TTTrack_TrackWord::d0_t

Definition at line 119 of file TTTrack_TrackWord.h.

◆ hit_t

typedef ap_uint<TrackBitWidths::kHitPatternSize> TTTrack_TrackWord::hit_t

Definition at line 125 of file TTTrack_TrackWord.h.

◆ otherMVA_t

typedef ap_uint<TrackBitWidths::kMVAOtherSize> TTTrack_TrackWord::otherMVA_t

Definition at line 127 of file TTTrack_TrackWord.h.

◆ phi_t

typedef ap_uint<TrackBitWidths::kPhiSize> TTTrack_TrackWord::phi_t

Definition at line 116 of file TTTrack_TrackWord.h.

◆ qualityMVA_t

typedef ap_uint<TrackBitWidths::kMVAQualitySize> TTTrack_TrackWord::qualityMVA_t

Definition at line 126 of file TTTrack_TrackWord.h.

◆ rinv_t

typedef ap_uint<TrackBitWidths::kRinvSize> TTTrack_TrackWord::rinv_t

Definition at line 115 of file TTTrack_TrackWord.h.

◆ tanl_t

typedef ap_uint<TrackBitWidths::kTanlSize> TTTrack_TrackWord::tanl_t

Definition at line 117 of file TTTrack_TrackWord.h.

◆ tkword_bs_t

typedef std::bitset<TrackBitWidths::kTrackWordSize> TTTrack_TrackWord::tkword_bs_t

Definition at line 130 of file TTTrack_TrackWord.h.

◆ tkword_t

typedef ap_uint<TrackBitWidths::kTrackWordSize> TTTrack_TrackWord::tkword_t

Definition at line 131 of file TTTrack_TrackWord.h.

◆ valid_t

typedef ap_uint<TrackBitWidths::kValidSize> TTTrack_TrackWord::valid_t

Definition at line 112 of file TTTrack_TrackWord.h.

◆ z0_t

typedef ap_uint<TrackBitWidths::kZ0Size> TTTrack_TrackWord::z0_t

Definition at line 118 of file TTTrack_TrackWord.h.

Member Enumeration Documentation

◆ TrackBitLocations

Enumerator
kMVAOtherLSB 
kMVAOtherMSB 
kMVAQualityLSB 
kMVAQualityMSB 
kHitPatternLSB 
kHitPatternMSB 
kBendChi2LSB 
kBendChi2MSB 
kD0LSB 
kD0MSB 
kChi2RZLSB 
kChi2RZMSB 
kZ0LSB 
kZ0MSB 
kTanlLSB 
kTanlMSB 
kChi2RPhiLSB 
kChi2RPhiMSB 
kPhiLSB 
kPhiMSB 
kRinvLSB 
kRinvMSB 
kValidLSB 
kValidMSB 

Definition at line 58 of file TTTrack_TrackWord.h.

58  {
59  // The location of the least significant bit (LSB) and most significant bit (MSB) in the track word for different fields
60  kMVAOtherLSB = 0,
61  kMVAOtherMSB = kMVAOtherLSB + TrackBitWidths::kMVAOtherSize - 1,
63  kMVAQualityMSB = kMVAQualityLSB + TrackBitWidths::kMVAQualitySize - 1,
65  kHitPatternMSB = kHitPatternLSB + TrackBitWidths::kHitPatternSize - 1,
67  kBendChi2MSB = kBendChi2LSB + TrackBitWidths::kBendChi2Size - 1,
68  kD0LSB = kBendChi2MSB + 1,
69  kD0MSB = kD0LSB + TrackBitWidths::kD0Size - 1,
70  kChi2RZLSB = kD0MSB + 1,
71  kChi2RZMSB = kChi2RZLSB + TrackBitWidths::kChi2RZSize - 1,
72  kZ0LSB = kChi2RZMSB + 1,
73  kZ0MSB = kZ0LSB + TrackBitWidths::kZ0Size - 1,
74  kTanlLSB = kZ0MSB + 1,
75  kTanlMSB = kTanlLSB + TrackBitWidths::kTanlSize - 1,
76  kChi2RPhiLSB = kTanlMSB + 1,
77  kChi2RPhiMSB = kChi2RPhiLSB + TrackBitWidths::kChi2RPhiSize - 1,
78  kPhiLSB = kChi2RPhiMSB + 1,
79  kPhiMSB = kPhiLSB + TrackBitWidths::kPhiSize - 1,
80  kRinvLSB = kPhiMSB + 1,
81  kRinvMSB = kRinvLSB + TrackBitWidths::kRinvSize - 1,
82  kValidLSB = kRinvMSB + 1,
84  };
const unsigned int kValidSize

◆ TrackBitWidths

Enumerator
kMVAOtherSize 
kMVAQualitySize 
kHitPatternSize 
kBendChi2Size 
kD0Size 
kChi2RZSize 
kZ0Size 
kTanlSize 
kChi2RPhiSize 
kPhiSize 
kRinvSize 
kValidSize 
kTrackWordSize 

Definition at line 38 of file TTTrack_TrackWord.h.

38  {
39  // The sizes of the track word components
40  kMVAOtherSize = 6, // Space for two specialized MVA selections
41  kMVAQualitySize = 3, // Width of track quality MVA
42  kHitPatternSize = 7, // Width of the hit pattern for stubs
43  kBendChi2Size = 3, // Width of the bend-chi2/dof
44  kD0Size = 13, // Width of D0
45  kChi2RZSize = 4, // Width of chi2/dof for r-z
46  kZ0Size = 12, // Width of z-position (40cm / 0.1)
47  kTanlSize = 16, // Width of tan(lambda)
48  kChi2RPhiSize = 4, // Width of chi2/dof for r-phi
49  kPhiSize = 12, // Width of phi
50  kRinvSize = 15, // Width of Rinv
51  kValidSize = 1, // Valid bit
52 
55  kMVAOtherSize, // Width of the track word in bits
56  };

Constructor & Destructor Documentation

◆ TTTrack_TrackWord() [1/4]

TTTrack_TrackWord::TTTrack_TrackWord ( )
inline

Definition at line 135 of file TTTrack_TrackWord.h.

135 {}

◆ TTTrack_TrackWord() [2/4]

TTTrack_TrackWord::TTTrack_TrackWord ( unsigned int  valid,
const GlobalVector momentum,
const GlobalPoint POCA,
double  rInv,
double  chi2RPhi,
double  chi2RZ,
double  bendChi2,
unsigned int  hitPattern,
unsigned int  mvaQuality,
unsigned int  mvaOther,
unsigned int  sector 
)

Definition at line 30 of file TTTrack_TrackWord.cc.

References hgcalTBTopologyTester_cfi::sector, setTrackWord(), and validateGeometry_cfg::valid.

40  {
41  setTrackWord(valid, momentum, POCA, rInv, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther, sector);
42 }
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)

◆ TTTrack_TrackWord() [3/4]

TTTrack_TrackWord::TTTrack_TrackWord ( unsigned int  valid,
unsigned int  rInv,
unsigned int  phi0,
unsigned int  tanl,
unsigned int  z0,
unsigned int  d0,
unsigned int  chi2RPhi,
unsigned int  chi2RZ,
unsigned int  bendChi2,
unsigned int  hitPattern,
unsigned int  mvaQuality,
unsigned int  mvaOther 
)

Definition at line 44 of file TTTrack_TrackWord.cc.

References d0, setTrackWord(), validateGeometry_cfg::valid, and HLTMuonOfflineAnalyzer_cfi::z0.

55  {
56  setTrackWord(valid, rInv, phi0, tanl, z0, d0, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther);
57 }
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
static constexpr float d0

◆ TTTrack_TrackWord() [4/4]

TTTrack_TrackWord::TTTrack_TrackWord ( const TTTrack_TrackWord word)
inline

Definition at line 161 of file TTTrack_TrackWord.h.

References trackWord_.

161 { trackWord_ = word.trackWord_; }
uint64_t word

Member Function Documentation

◆ countSetBits()

unsigned int TTTrack_TrackWord::countSetBits ( unsigned int  n) const
inlineprivate

Definition at line 281 of file TTTrack_TrackWord.h.

References submitPVResolutionJobs::count, and dqmiodumpmetadata::n.

Referenced by getNStubs().

281  {
282  // Adapted from: https://www.geeksforgeeks.org/count-set-bits-in-an-integer/
283  unsigned int count = 0;
284  while (n) {
285  n &= (n - 1);
286  count++;
287  }
288  return count;
289  }

◆ digitizeSignedValue()

unsigned int TTTrack_TrackWord::digitizeSignedValue ( double  value,
unsigned int  nBits,
double  lsb 
) const
inlineprivate

Definition at line 291 of file TTTrack_TrackWord.h.

References l1tHGCalVFEProducer_cfi::lsb.

Referenced by setTrackWord(), and singleDigitizationSchemeTest().

291  {
292  // Digitize the incoming value
293  int digitizedValue = std::floor(value / lsb);
294 
295  // Calculate the maxmum possible positive value given an output of nBits in size
296  int digitizedMaximum = (1 << (nBits - 1)) - 1; // The remove 1 bit from nBits to account for the sign
297  int digitizedMinimum = -1. * (digitizedMaximum + 1);
298 
299  // Saturate the digitized value
300  digitizedValue = std::clamp(digitizedValue, digitizedMinimum, digitizedMaximum);
301 
302  // Do the two's compliment encoding
303  unsigned int twosValue = digitizedValue;
304  if (digitizedValue < 0) {
305  twosValue += (1 << nBits);
306  }
307 
308  return twosValue;
309  }
Definition: value.py:1

◆ getBendChi2()

double TTTrack_TrackWord::getBendChi2 ( ) const
inline

Definition at line 224 of file TTTrack_TrackWord.h.

References bendChi2Bins, and getBendChi2Bits().

224 { return bendChi2Bins[getBendChi2Bits()]; }
static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
unsigned int getBendChi2Bits() const

◆ getBendChi2Bits()

unsigned int TTTrack_TrackWord::getBendChi2Bits ( ) const
inline

Definition at line 209 of file TTTrack_TrackWord.h.

References getBendChi2Word().

Referenced by L1TrackQuality::featureTransform(), and getBendChi2().

209 { return getBendChi2Word().to_uint(); }
bendChi2_t getBendChi2Word() const

◆ getBendChi2Word()

bendChi2_t TTTrack_TrackWord::getBendChi2Word ( ) const
inline

Definition at line 184 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getBendChi2Bits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

184  {
185  return getTrackWord()(TrackBitLocations::kBendChi2MSB, TrackBitLocations::kBendChi2LSB);
186  }
tkword_t getTrackWord() const

◆ getBin()

template<typename T >
constexpr unsigned int TTTrack_TrackWord::getBin ( double  value,
const T bins 
) const
inlineprivate

◆ getChi2RPhi()

double TTTrack_TrackWord::getChi2RPhi ( ) const
inline

Definition at line 222 of file TTTrack_TrackWord.h.

References chi2RPhiBins, and getChi2RPhiBits().

222 { return chi2RPhiBins[getChi2RPhiBits()]; }
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
unsigned int getChi2RPhiBits() const

◆ getChi2RPhiBits()

unsigned int TTTrack_TrackWord::getChi2RPhiBits ( ) const
inline

Definition at line 207 of file TTTrack_TrackWord.h.

References getChi2RPhiWord().

Referenced by L1TrackQuality::featureTransform(), and getChi2RPhi().

207 { return getChi2RPhiWord().to_uint(); }
chi2rphi_t getChi2RPhiWord() const

◆ getChi2RPhiWord()

chi2rphi_t TTTrack_TrackWord::getChi2RPhiWord ( ) const
inline

Definition at line 178 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getChi2RPhiBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

178  {
179  return getTrackWord()(TrackBitLocations::kChi2RPhiMSB, TrackBitLocations::kChi2RPhiLSB);
180  }
tkword_t getTrackWord() const

◆ getChi2RZ()

double TTTrack_TrackWord::getChi2RZ ( ) const
inline

Definition at line 223 of file TTTrack_TrackWord.h.

References chi2RZBins, and getChi2RZBits().

223 { return chi2RZBins[getChi2RZBits()]; }
unsigned int getChi2RZBits() const
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins

◆ getChi2RZBits()

unsigned int TTTrack_TrackWord::getChi2RZBits ( ) const
inline

Definition at line 208 of file TTTrack_TrackWord.h.

References getChi2RZWord().

Referenced by L1TrackQuality::featureTransform(), and getChi2RZ().

208 { return getChi2RZWord().to_uint(); }
chi2rz_t getChi2RZWord() const

◆ getChi2RZWord()

chi2rz_t TTTrack_TrackWord::getChi2RZWord ( ) const
inline

Definition at line 181 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getChi2RZBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

181  {
182  return getTrackWord()(TrackBitLocations::kChi2RZMSB, TrackBitLocations::kChi2RZLSB);
183  }
tkword_t getTrackWord() const

◆ getD0()

double TTTrack_TrackWord::getD0 ( ) const
inline

Definition at line 221 of file TTTrack_TrackWord.h.

References getD0Bits(), stepD0, and undigitizeSignedValue().

221 { return undigitizeSignedValue(getD0Bits(), TrackBitWidths::kD0Size, stepD0); }
static constexpr double stepD0
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
unsigned int getD0Bits() const

◆ getD0Bits()

unsigned int TTTrack_TrackWord::getD0Bits ( ) const
inline

Definition at line 206 of file TTTrack_TrackWord.h.

References getD0Word().

Referenced by getD0().

206 { return getD0Word().to_uint(); }
d0_t getD0Word() const

◆ getD0Word()

d0_t TTTrack_TrackWord::getD0Word ( ) const
inline

Definition at line 177 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getD0Bits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

177 { return getTrackWord()(TrackBitLocations::kD0MSB, TrackBitLocations::kD0LSB); }
tkword_t getTrackWord() const

◆ getHitPattern()

unsigned int TTTrack_TrackWord::getHitPattern ( ) const
inline

Definition at line 225 of file TTTrack_TrackWord.h.

References getHitPatternBits().

225 { return getHitPatternBits(); }
unsigned int getHitPatternBits() const

◆ getHitPatternBits()

unsigned int TTTrack_TrackWord::getHitPatternBits ( ) const
inline

Definition at line 210 of file TTTrack_TrackWord.h.

References getHitPatternWord().

Referenced by getHitPattern(), and getNStubs().

210 { return getHitPatternWord().to_uint(); }
hit_t getHitPatternWord() const

◆ getHitPatternWord()

hit_t TTTrack_TrackWord::getHitPatternWord ( ) const
inline

Definition at line 187 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getHitPatternBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

187  {
188  return getTrackWord()(TrackBitLocations::kHitPatternMSB, TrackBitLocations::kHitPatternLSB);
189  }
tkword_t getTrackWord() const

◆ getMVAOther()

unsigned int TTTrack_TrackWord::getMVAOther ( ) const
inline

Definition at line 228 of file TTTrack_TrackWord.h.

References getMVAOtherBits().

228 { return getMVAOtherBits(); }
unsigned int getMVAOtherBits() const

◆ getMVAOtherBits()

unsigned int TTTrack_TrackWord::getMVAOtherBits ( ) const
inline

Definition at line 212 of file TTTrack_TrackWord.h.

References getMVAOtherWord().

Referenced by getMVAOther().

212 { return getMVAOtherWord().to_uint(); }
otherMVA_t getMVAOtherWord() const

◆ getMVAOtherWord()

otherMVA_t TTTrack_TrackWord::getMVAOtherWord ( ) const
inline

Definition at line 193 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getMVAOtherBits().

193  {
194  return getTrackWord()(TrackBitLocations::kMVAOtherMSB, TrackBitLocations::kMVAOtherLSB);
195  }
tkword_t getTrackWord() const

◆ getMVAQuality()

unsigned int TTTrack_TrackWord::getMVAQuality ( ) const
inline

Definition at line 227 of file TTTrack_TrackWord.h.

References getMVAQualityBits().

227 { return getMVAQualityBits(); }
unsigned int getMVAQualityBits() const

◆ getMVAQualityBits()

unsigned int TTTrack_TrackWord::getMVAQualityBits ( ) const
inline

Definition at line 211 of file TTTrack_TrackWord.h.

References getMVAQualityWord().

Referenced by getMVAQuality().

211 { return getMVAQualityWord().to_uint(); }
qualityMVA_t getMVAQualityWord() const

◆ getMVAQualityWord()

qualityMVA_t TTTrack_TrackWord::getMVAQualityWord ( ) const
inline

Definition at line 190 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getMVAQualityBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

190  {
191  return getTrackWord()(TrackBitLocations::kMVAQualityMSB, TrackBitLocations::kMVAQualityLSB);
192  }
tkword_t getTrackWord() const

◆ getNStubs()

unsigned int TTTrack_TrackWord::getNStubs ( ) const
inline

Definition at line 226 of file TTTrack_TrackWord.h.

References countSetBits(), and getHitPatternBits().

226 { return countSetBits(getHitPatternBits()); }
unsigned int countSetBits(unsigned int n) const
unsigned int getHitPatternBits() const

◆ getPhi()

double TTTrack_TrackWord::getPhi ( ) const
inline

Definition at line 218 of file TTTrack_TrackWord.h.

References getPhiBits(), stepPhi0, and undigitizeSignedValue().

218 { return undigitizeSignedValue(getPhiBits(), TrackBitWidths::kPhiSize, stepPhi0); }
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
static constexpr double stepPhi0
unsigned int getPhiBits() const

◆ getPhiBits()

unsigned int TTTrack_TrackWord::getPhiBits ( ) const
inline

Definition at line 203 of file TTTrack_TrackWord.h.

References getPhiWord().

Referenced by getPhi().

203 { return getPhiWord().to_uint(); }
phi_t getPhiWord() const

◆ getPhiWord()

phi_t TTTrack_TrackWord::getPhiWord ( ) const
inline

Definition at line 174 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getPhiBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

174 { return getTrackWord()(TrackBitLocations::kPhiMSB, TrackBitLocations::kPhiLSB); }
tkword_t getTrackWord() const

◆ getRinv()

double TTTrack_TrackWord::getRinv ( ) const
inline

Definition at line 217 of file TTTrack_TrackWord.h.

References getRinvBits(), stepRinv, and undigitizeSignedValue().

217 { return undigitizeSignedValue(getRinvBits(), TrackBitWidths::kRinvSize, stepRinv); }
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
static constexpr double stepRinv
unsigned int getRinvBits() const

◆ getRinvBits()

unsigned int TTTrack_TrackWord::getRinvBits ( ) const
inline

Definition at line 202 of file TTTrack_TrackWord.h.

References getRinvWord().

Referenced by getRinv().

202 { return getRinvWord().to_uint(); }
rinv_t getRinvWord() const

◆ getRinvWord()

rinv_t TTTrack_TrackWord::getRinvWord ( ) const
inline

Definition at line 173 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getRinvBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

173 { return getTrackWord()(TrackBitLocations::kRinvMSB, TrackBitLocations::kRinvLSB); }
tkword_t getTrackWord() const

◆ getTanl()

double TTTrack_TrackWord::getTanl ( ) const
inline

Definition at line 219 of file TTTrack_TrackWord.h.

References getTanlBits(), stepTanL, and undigitizeSignedValue().

219 { return undigitizeSignedValue(getTanlBits(), TrackBitWidths::kTanlSize, stepTanL); }
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
static constexpr double stepTanL
unsigned int getTanlBits() const

◆ getTanlBits()

unsigned int TTTrack_TrackWord::getTanlBits ( ) const
inline

Definition at line 204 of file TTTrack_TrackWord.h.

References getTanlWord().

Referenced by getTanl().

204 { return getTanlWord().to_uint(); }
tanl_t getTanlWord() const

◆ getTanlWord()

tanl_t TTTrack_TrackWord::getTanlWord ( ) const
inline

Definition at line 175 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getTanlBits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

175 { return getTrackWord()(TrackBitLocations::kTanlMSB, TrackBitLocations::kTanlLSB); }
tkword_t getTrackWord() const

◆ getTrackWord()

tkword_t TTTrack_TrackWord::getTrackWord ( ) const
inline

Definition at line 196 of file TTTrack_TrackWord.h.

References trackWord_.

Referenced by getBendChi2Word(), getChi2RPhiWord(), getChi2RZWord(), getD0Word(), getHitPatternWord(), getMVAOtherWord(), getMVAQualityWord(), getPhiWord(), getRinvWord(), getTanlWord(), getValidWord(), and getZ0Word().

196 { return tkword_t(trackWord_.to_string().c_str(), 2); }
ap_uint< TrackBitWidths::kTrackWordSize > tkword_t

◆ getValid()

bool TTTrack_TrackWord::getValid ( ) const
inline

Definition at line 216 of file TTTrack_TrackWord.h.

References getValidWord().

216 { return getValidWord().to_bool(); }
valid_t getValidWord() const

◆ getValidBits()

unsigned int TTTrack_TrackWord::getValidBits ( ) const
inline

Definition at line 201 of file TTTrack_TrackWord.h.

References getValidWord().

201 { return getValidWord().to_uint(); }
valid_t getValidWord() const

◆ getValidWord()

valid_t TTTrack_TrackWord::getValidWord ( ) const
inline

◆ getZ0()

double TTTrack_TrackWord::getZ0 ( ) const
inline

Definition at line 220 of file TTTrack_TrackWord.h.

References getZ0Bits(), stepZ0, and undigitizeSignedValue().

220 { return undigitizeSignedValue(getZ0Bits(), TrackBitWidths::kZ0Size, stepZ0); }
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
unsigned int getZ0Bits() const
static constexpr double stepZ0

◆ getZ0Bits()

unsigned int TTTrack_TrackWord::getZ0Bits ( ) const
inline

Definition at line 205 of file TTTrack_TrackWord.h.

References getZ0Word().

Referenced by getZ0().

205 { return getZ0Word().to_uint(); }
z0_t getZ0Word() const

◆ getZ0Word()

z0_t TTTrack_TrackWord::getZ0Word ( ) const
inline

Definition at line 176 of file TTTrack_TrackWord.h.

References getTrackWord().

Referenced by getZ0Bits(), and l1tpf::PFTrackProducerFromL1Tracks::produce().

176 { return getTrackWord()(TrackBitLocations::kZ0MSB, TrackBitLocations::kZ0LSB); }
tkword_t getTrackWord() const

◆ localPhi()

float TTTrack_TrackWord::localPhi ( float  globalPhi,
unsigned int  sector 
) const
inlineprotected

Definition at line 275 of file TTTrack_TrackWord.h.

References reco::deltaPhi(), hgcalTBTopologyTester_cfi::sector, and sectorWidth.

Referenced by TTTrack< T >::localPhi(), and setTrackWord().

275  {
276  return reco::deltaPhi(globalPhi, (sector * sectorWidth));
277  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
static constexpr double sectorWidth

◆ operator=()

TTTrack_TrackWord& TTTrack_TrackWord::operator= ( const TTTrack_TrackWord word)
inline

Definition at line 164 of file TTTrack_TrackWord.h.

References trackWord_.

164  {
165  trackWord_ = word.trackWord_;
166  return *this;
167  }
uint64_t word

◆ setTrackWord() [1/3]

void TTTrack_TrackWord::setTrackWord ( unsigned int  valid,
const GlobalVector momentum,
const GlobalPoint POCA,
double  rInv,
double  chi2RPhi,
double  chi2RZ,
double  bendChi2,
unsigned int  hitPattern,
unsigned int  mvaQuality,
unsigned int  mvaOther,
unsigned int  sector 
)

Definition at line 60 of file TTTrack_TrackWord.cc.

References bendChi2Bins, chi2RPhiBins, chi2RZBins, digitizeSignedValue(), getBin(), localPhi(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), hgcalTBTopologyTester_cfi::sector, stepD0, stepPhi0, stepRinv, stepTanL, stepZ0, validateGeometry_cfg::valid, sistrip::valid_, and PV3DBase< T, PVType, FrameType >::z().

Referenced by l1t::demo::codecs::decodeTracks(), l1tpf::PFTrackProducerFromL1Tracks::produce(), setTrackWord(), and TTTrack_TrackWord().

70  {
71  // first, derive quantities to be packed
72  float rPhi = localPhi(momentum.phi(), sector); // this needs to be phi relative to the center of the sector
73  float rTanl = momentum.z() / momentum.perp();
74  float rZ0 = POCA.z();
75  float rD0 = POCA.perp();
76 
77  // bin and convert to integers
79  rinv_t rInv_ = digitizeSignedValue(rInv, TrackBitWidths::kRinvSize, stepRinv);
80  phi_t phi0_ = digitizeSignedValue(rPhi, TrackBitWidths::kPhiSize, stepPhi0);
81  tanl_t tanl_ = digitizeSignedValue(rTanl, TrackBitWidths::kTanlSize, stepTanL);
82  z0_t z0_ = digitizeSignedValue(rZ0, TrackBitWidths::kZ0Size, stepZ0);
83  d0_t d0_ = digitizeSignedValue(rD0, TrackBitWidths::kD0Size, stepD0);
84  chi2rphi_t chi2RPhi_ = getBin(chi2RPhi, chi2RPhiBins);
85  chi2rz_t chi2RZ_ = getBin(chi2RZ, chi2RZBins);
86  bendChi2_t bendChi2_ = getBin(bendChi2, bendChi2Bins);
87  hit_t hitPattern_ = hitPattern;
88  qualityMVA_t mvaQuality_ = mvaQuality;
89  otherMVA_t mvaOther_ = mvaOther;
90 
91  // pack the track word
92  //trackWord = ( mvaOther_, mvaQuality_, hitPattern_, bendChi2_, chi2RZ_, chi2RPhi_, d0_, z0_, tanl_, phi0_, rInv_, valid_ );
94  valid_, rInv_, phi0_, tanl_, z0_, d0_, chi2RPhi_, chi2RZ_, bendChi2_, hitPattern_, mvaQuality_, mvaOther_);
95 }
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
T perp() const
Definition: PV3DBase.h:69
ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
static constexpr double stepD0
static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
static const uint16_t valid_
Definition: Constants.h:17
ap_uint< TrackBitWidths::kZ0Size > z0_t
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
static constexpr double stepRinv
ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
ap_uint< TrackBitWidths::kValidSize > valid_t
ap_uint< TrackBitWidths::kRinvSize > rinv_t
static constexpr double stepTanL
ap_uint< TrackBitWidths::kHitPatternSize > hit_t
ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
constexpr unsigned int getBin(double value, const T &bins) const
static constexpr double stepPhi0
unsigned int digitizeSignedValue(double value, unsigned int nBits, double lsb) const
ap_uint< TrackBitWidths::kTanlSize > tanl_t
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
ap_uint< TrackBitWidths::kD0Size > d0_t
static constexpr double stepZ0
ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
float localPhi(float globalPhi, unsigned int sector) const
ap_uint< TrackBitWidths::kPhiSize > phi_t

◆ setTrackWord() [2/3]

void TTTrack_TrackWord::setTrackWord ( unsigned int  valid,
unsigned int  rInv,
unsigned int  phi0,
unsigned int  tanl,
unsigned int  z0,
unsigned int  d0,
unsigned int  chi2RPhi,
unsigned int  chi2RZ,
unsigned int  bendChi2,
unsigned int  hitPattern,
unsigned int  mvaQuality,
unsigned int  mvaOther 
)

Definition at line 98 of file TTTrack_TrackWord.cc.

References d0, setTrackWord(), validateGeometry_cfg::valid, sistrip::valid_, and HLTMuonOfflineAnalyzer_cfi::z0.

109  {
110  // bin and convert to integers
111  valid_t valid_ = valid;
112  rinv_t rInv_ = rInv;
113  phi_t phi0_ = phi0;
114  tanl_t tanl_ = tanl;
115  z0_t z0_ = z0;
116  d0_t d0_ = d0;
117  chi2rphi_t chi2RPhi_ = chi2RPhi;
118  chi2rz_t chi2RZ_ = chi2RZ;
119  bendChi2_t bendChi2_ = bendChi2;
120  hit_t hitPattern_ = hitPattern;
121  qualityMVA_t mvaQuality_ = mvaQuality;
122  otherMVA_t mvaOther_ = mvaOther;
123 
124  // pack the track word
125  //trackWord = ( otherMVA_t(mvaOther), qualityMVA_t(mvaQuality), hit_t(hitPattern),
126  // bendChi2_t(bendChi2), chi2rz_t(chi2RZ), chi2rphi_t(chi2RPhi),
127  // d0_t(d0), z0_t(z0), tanl_t(tanl), phi_t(phi0), rinv_t(rInv), valid_t(valid) );
128  setTrackWord(
129  valid_, rInv_, phi0_, tanl_, z0_, d0_, chi2RPhi_, chi2RZ_, bendChi2_, hitPattern_, mvaQuality_, mvaOther_);
130 }
ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
static const uint16_t valid_
Definition: Constants.h:17
ap_uint< TrackBitWidths::kZ0Size > z0_t
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
ap_uint< TrackBitWidths::kValidSize > valid_t
ap_uint< TrackBitWidths::kRinvSize > rinv_t
ap_uint< TrackBitWidths::kHitPatternSize > hit_t
ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
static constexpr float d0
ap_uint< TrackBitWidths::kTanlSize > tanl_t
ap_uint< TrackBitWidths::kD0Size > d0_t
ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
ap_uint< TrackBitWidths::kPhiSize > phi_t

◆ setTrackWord() [3/3]

void TTTrack_TrackWord::setTrackWord ( ap_uint< TrackBitWidths::kValidSize >  valid,
ap_uint< TrackBitWidths::kRinvSize >  rInv,
ap_uint< TrackBitWidths::kPhiSize >  phi0,
ap_uint< TrackBitWidths::kTanlSize >  tanl,
ap_uint< TrackBitWidths::kZ0Size >  z0,
ap_uint< TrackBitWidths::kD0Size >  d0,
ap_uint< TrackBitWidths::kChi2RPhiSize >  chi2RPhi,
ap_uint< TrackBitWidths::kChi2RZSize >  chi2RZ,
ap_uint< TrackBitWidths::kBendChi2Size >  bendChi2,
ap_uint< TrackBitWidths::kHitPatternSize >  hitPattern,
ap_uint< TrackBitWidths::kMVAQualitySize >  mvaQuality,
ap_uint< TrackBitWidths::kMVAOtherSize >  mvaOther 
)

Definition at line 132 of file TTTrack_TrackWord.cc.

References b, d0, l1tmhtemu::kValidSize, hltrates_dqm_sourceclient-live_cfg::offset, trackWord_, validateGeometry_cfg::valid, and HLTMuonOfflineAnalyzer_cfi::z0.

144  {
145  // pack the track word
146  unsigned int offset = 0;
147  for (unsigned int b = offset; b < (offset + TrackBitWidths::kMVAOtherSize); b++) {
148  trackWord_.set(b, mvaOther[b - offset]);
149  }
150  offset += TrackBitWidths::kMVAOtherSize;
151  for (unsigned int b = offset; b < (offset + TrackBitWidths::kMVAQualitySize); b++) {
152  trackWord_.set(b, mvaQuality[b - offset]);
153  }
154  offset += TrackBitWidths::kMVAQualitySize;
155  for (unsigned int b = offset; b < (offset + TrackBitWidths::kHitPatternSize); b++) {
156  trackWord_.set(b, hitPattern[b - offset]);
157  }
158  offset += TrackBitWidths::kHitPatternSize;
159  for (unsigned int b = offset; b < (offset + TrackBitWidths::kBendChi2Size); b++) {
160  trackWord_.set(b, bendChi2[b - offset]);
161  }
162  offset += TrackBitWidths::kBendChi2Size;
163  for (unsigned int b = offset; b < (offset + TrackBitWidths::kD0Size); b++) {
164  trackWord_.set(b, d0[b - offset]);
165  }
166  offset += TrackBitWidths::kD0Size;
167  for (unsigned int b = offset; b < (offset + TrackBitWidths::kChi2RZSize); b++) {
168  trackWord_.set(b, chi2RZ[b - offset]);
169  }
170  offset += TrackBitWidths::kChi2RZSize;
171  for (unsigned int b = offset; b < (offset + TrackBitWidths::kZ0Size); b++) {
172  trackWord_.set(b, z0[b - offset]);
173  }
174  offset += TrackBitWidths::kZ0Size;
175  for (unsigned int b = offset; b < (offset + TrackBitWidths::kTanlSize); b++) {
176  trackWord_.set(b, tanl[b - offset]);
177  }
178  offset += TrackBitWidths::kTanlSize;
179  for (unsigned int b = offset; b < (offset + TrackBitWidths::kChi2RPhiSize); b++) {
180  trackWord_.set(b, chi2RPhi[b - offset]);
181  }
182  offset += TrackBitWidths::kChi2RPhiSize;
183  for (unsigned int b = offset; b < (offset + TrackBitWidths::kPhiSize); b++) {
184  trackWord_.set(b, phi0[b - offset]);
185  }
186  offset += TrackBitWidths::kPhiSize;
187  for (unsigned int b = offset; b < (offset + TrackBitWidths::kRinvSize); b++) {
188  trackWord_.set(b, rInv[b - offset]);
189  }
190  offset += TrackBitWidths::kRinvSize;
191  for (unsigned int b = offset; b < offset + TrackBitWidths::kValidSize; b++) {
192  trackWord_.set(b, valid[b - offset]);
193  }
194 }
const unsigned int kValidSize
static constexpr float d0
double b
Definition: hdecay.h:118

◆ singleDigitizationSchemeTest()

bool TTTrack_TrackWord::singleDigitizationSchemeTest ( const double  floatingPointValue,
const unsigned int  nBits,
const double  lsb 
) const

Definition at line 196 of file TTTrack_TrackWord.cc.

References funct::abs(), digitizeSignedValue(), tttrack_trackword::infoTestDigitizationScheme(), l1tHGCalVFEProducer_cfi::lsb, and undigitizeSignedValue().

Referenced by testDigitizationScheme().

198  {
199  unsigned int digitizedSignedValue = digitizeSignedValue(floatingPointValue, nBits, lsb);
200  double undigitizedSignedValue = undigitizeSignedValue(digitizedSignedValue, nBits, lsb);
201  unsigned int redigitizedSignedValue = digitizeSignedValue(undigitizedSignedValue, nBits, lsb);
203  nBits, lsb, floatingPointValue, digitizedSignedValue, undigitizedSignedValue, redigitizedSignedValue);
204  return (std::abs(floatingPointValue - undigitizedSignedValue) <= (lsb / 2.0)) &&
205  (digitizedSignedValue == redigitizedSignedValue);
206 }
void infoTestDigitizationScheme(const unsigned int, const double, const double, const unsigned int, const double, const unsigned int)
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int digitizeSignedValue(double value, unsigned int nBits, double lsb) const

◆ testDigitizationScheme()

void TTTrack_TrackWord::testDigitizationScheme ( ) const

Definition at line 208 of file TTTrack_TrackWord.cc.

References cms::cuda::assert(), and singleDigitizationSchemeTest().

208  {
209  /*
210  Expected output:
211  testDigitizationScheme: Floating point value = -4 Digitized value = 4 Un-digitized value = -3.5
212  testDigitizationScheme: Floating point value = 3 Digitized value = 3 Un-digitized value = 3.5
213  testDigitizationScheme: Floating point value = -3.5 Digitized value = 9 Un-digitized value = -3.25
214  testDigitizationScheme: Floating point value = 3.5 Digitized value = 7 Un-digitized value = 3.75
215  */
216  assert(singleDigitizationSchemeTest(-4.0, 3, 1.0));
217  assert(singleDigitizationSchemeTest(3.0, 3, 1.0));
218  assert(singleDigitizationSchemeTest(-3.5, 4, 0.5));
219  assert(singleDigitizationSchemeTest(3.5, 4, 0.5));
220 }
assert(be >=bs)
bool singleDigitizationSchemeTest(const double floatingPointValue, const unsigned int nBits, const double lsb) const

◆ undigitizeSignedValue()

double TTTrack_TrackWord::undigitizeSignedValue ( unsigned int  twosValue,
unsigned int  nBits,
double  lsb 
) const
inlineprivate

Definition at line 317 of file TTTrack_TrackWord.h.

References cms::cuda::assert(), and l1tHGCalVFEProducer_cfi::lsb.

Referenced by getD0(), getPhi(), getRinv(), getTanl(), getZ0(), and singleDigitizationSchemeTest().

317  {
318  // Check that none of the bits above the nBits-1 bit, in a range of [0, nBits-1], are set.
319  // This makes sure that it isn't possible for the value represented by `twosValue` to be
320  // any bigger than ((1 << nBits) - 1).
321  assert((twosValue >> nBits) == 0);
322 
323  // Convert from twos compliment to C++ signed integer (normal digitized value)
324  int digitizedValue = twosValue;
325  if (twosValue & (1 << (nBits - 1))) { // check if the twosValue is negative
326  digitizedValue -= (1 << nBits);
327  }
328 
329  // Convert to floating point value
330  return (double(digitizedValue) + 0.5) * lsb;
331  }
assert(be >=bs)

Member Data Documentation

◆ bendChi2Bins

constexpr std::array<double, 1 << TrackBitWidths::kBendChi2Size> TTTrack_TrackWord::bendChi2Bins
static
Initial value:
= {
{0.0, 0.75, 1.0, 1.5, 2.25, 3.5, 5.0, 20.0}}

Definition at line 104 of file TTTrack_TrackWord.h.

Referenced by getBendChi2(), and setTrackWord().

◆ chi2RPhiBins

constexpr std::array<double, 1 << TrackBitWidths::kChi2RPhiSize> TTTrack_TrackWord::chi2RPhiBins
static
Initial value:
= {
{0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 10.0, 15.0, 20.0, 35.0, 60.0, 200.0}}

Definition at line 100 of file TTTrack_TrackWord.h.

Referenced by getChi2RPhi(), and setTrackWord().

◆ chi2RZBins

constexpr std::array<double, 1 << TrackBitWidths::kChi2RZSize> TTTrack_TrackWord::chi2RZBins
static
Initial value:
= {
{0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 8.0, 10.0, 20.0, 50.0}}

Definition at line 102 of file TTTrack_TrackWord.h.

Referenced by getChi2RZ(), and setTrackWord().

◆ minD0

constexpr double TTTrack_TrackWord::minD0 = -16.
static

Definition at line 91 of file TTTrack_TrackWord.h.

◆ minPhi0

constexpr double TTTrack_TrackWord::minPhi0 = -0.7853981696
static

Definition at line 88 of file TTTrack_TrackWord.h.

◆ minRinv

constexpr double TTTrack_TrackWord::minRinv = -0.006
static

Definition at line 87 of file TTTrack_TrackWord.h.

◆ minTanl

constexpr double TTTrack_TrackWord::minTanl = -8.
static

Definition at line 89 of file TTTrack_TrackWord.h.

◆ minZ0

constexpr double TTTrack_TrackWord::minZ0 = -20.46912512
static

Definition at line 90 of file TTTrack_TrackWord.h.

◆ nSectors

constexpr unsigned int TTTrack_TrackWord::nSectors = 9
static

Definition at line 108 of file TTTrack_TrackWord.h.

◆ sectorWidth

constexpr double TTTrack_TrackWord::sectorWidth = (2. * M_PI) / nSectors
static

Definition at line 109 of file TTTrack_TrackWord.h.

Referenced by localPhi().

◆ stepD0

constexpr double TTTrack_TrackWord::stepD0 = (1. / (1 << 8))
static

Definition at line 97 of file TTTrack_TrackWord.h.

Referenced by getD0(), and setTrackWord().

◆ stepPhi0

constexpr double TTTrack_TrackWord::stepPhi0 = (2. * std::abs(minPhi0)) / (1 << TrackBitWidths::kPhiSize)
static

◆ stepRinv

constexpr double TTTrack_TrackWord::stepRinv = (2. * std::abs(minRinv)) / (1 << TrackBitWidths::kRinvSize)
static

◆ stepTanL

constexpr double TTTrack_TrackWord::stepTanL = (1. / (1 << 12))
static

◆ stepZ0

constexpr double TTTrack_TrackWord::stepZ0 = (2. * std::abs(minZ0)) / (1 << TrackBitWidths::kZ0Size)
static

◆ trackWord_

tkword_bs_t TTTrack_TrackWord::trackWord_
private

Definition at line 334 of file TTTrack_TrackWord.h.

Referenced by getTrackWord(), operator=(), setTrackWord(), and TTTrack_TrackWord().