CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
l1t::TkJetWord Class Reference

#include <TkJetWord.h>

Public Types

typedef ap_int< kGlbEtaSizeglbeta_t
 
typedef ap_int< kGlbPhiSizeglbphi_t
 
typedef ap_uint< kNtSizent_t
 
typedef ap_uint< kXtSizenx_t
 
typedef ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
 
enum  TkJetBitLocations {
  kPtLSB = 0, kPtMSB = kPtLSB + TkJetBitWidths::kPtSize - 1, kGlbEtaLSB = kPtMSB + 1, kGlbEtaMSB = kGlbEtaLSB + TkJetBitWidths::kGlbEtaSize - 1,
  kGlbPhiLSB = kGlbEtaMSB + 1, kGlbPhiMSB = kGlbPhiLSB + TkJetBitWidths::kGlbPhiSize - 1, kZ0LSB = kGlbPhiMSB + 1, kZ0MSB = kZ0LSB + TkJetBitWidths::kZ0Size - 1,
  kNtLSB = kZ0MSB + 1, kNtMSB = kNtLSB + TkJetBitWidths::kNtSize - 1, kXtLSB = kNtMSB + 1, kXtMSB = kXtLSB + TkJetBitWidths::kXtSize - 1,
  kUnassignedLSB = kXtMSB + 1, kUnassignedMSB = kUnassignedLSB + TkJetBitWidths::kUnassignedSize - 1
}
 
enum  TkJetBitWidths {
  kPtSize = 16, kPtMagSize = 11, kGlbEtaSize = 14, kGlbPhiSize = 13,
  kZ0Size = 10, kNtSize = 5, kXtSize = 4, kUnassignedSize = 8,
  kTkJetWordSize = kPtSize + kGlbEtaSize + kGlbPhiSize + kZ0Size + kNtSize + kXtSize + kUnassignedSize
}
 
typedef ap_uint< TkJetBitWidths::kUnassignedSize > tkjetunassigned_t
 
typedef std::bitset< TkJetBitWidths::kTkJetWordSize > tkjetword_bs_t
 
typedef ap_uint< TkJetBitWidths::kTkJetWordSize > tkjetword_t
 
typedef ap_int< kZ0Sizez0_t
 

Public Member Functions

float glbeta () const
 
unsigned int glbEtaBits () const
 
glbeta_t glbEtaWord () const
 
float glbphi () const
 
unsigned int glbPhiBits () const
 
glbphi_t glbPhiWord () const
 
int nt () const
 
unsigned int ntBits () const
 
nt_t ntWord () const
 
TkJetWordoperator= (const TkJetWord &word)
 
float pt () const
 
unsigned int ptBits () const
 
pt_t ptWord () const
 
void setTkJetWord (pt_t pt, glbeta_t eta, glbphi_t phi, z0_t z0, nt_t nt, nx_t nx, tkjetunassigned_t unassigned)
 
 TkJetWord ()
 
 TkJetWord (pt_t pt, glbeta_t eta, glbphi_t phi, z0_t z0, nt_t nt, nx_t nx, tkjetunassigned_t unassigned)
 
 TkJetWord (const TkJetWord &word)
 
tkjetword_t tkJetWord () const
 
unsigned int unassigned () const
 
unsigned int unassignedBits () const
 
tkjetunassigned_t unassignedWord () const
 
int xt () const
 
unsigned int xtBits () const
 
nx_t xtWord () const
 
float z0 () const
 
unsigned int z0Bits () const
 
z0_t z0Word () const
 
 ~TkJetWord ()
 

Public Attributes

float ETAPHI_LSB = M_PI / (1 << 12)
 
int INTPHI_PI = 720
 
int INTPHI_TWOPI = 2 * INTPHI_PI
 
float INTPT_LSB = 1 >> 5
 
float Z0_LSB = 0.05
 

Private Member Functions

double unpackSignedValue (unsigned int bits, unsigned int nBits, double lsb) const
 

Private Attributes

tkjetword_bs_t tkJetWord_
 

Detailed Description

Definition at line 16 of file TkJetWord.h.

Member Typedef Documentation

◆ glbeta_t

Definition at line 55 of file TkJetWord.h.

◆ glbphi_t

Definition at line 56 of file TkJetWord.h.

◆ nt_t

typedef ap_uint<kNtSize> l1t::TkJetWord::nt_t

Definition at line 58 of file TkJetWord.h.

◆ nx_t

typedef ap_uint<kXtSize> l1t::TkJetWord::nx_t

Definition at line 59 of file TkJetWord.h.

◆ pt_t

typedef ap_ufixed<kPtSize, kPtMagSize, AP_TRN, AP_SAT> l1t::TkJetWord::pt_t

Definition at line 54 of file TkJetWord.h.

◆ tkjetunassigned_t

typedef ap_uint<TkJetBitWidths::kUnassignedSize> l1t::TkJetWord::tkjetunassigned_t

Definition at line 60 of file TkJetWord.h.

◆ tkjetword_bs_t

typedef std::bitset<TkJetBitWidths::kTkJetWordSize> l1t::TkJetWord::tkjetword_bs_t

Definition at line 61 of file TkJetWord.h.

◆ tkjetword_t

typedef ap_uint<TkJetBitWidths::kTkJetWordSize> l1t::TkJetWord::tkjetword_t

Definition at line 62 of file TkJetWord.h.

◆ z0_t

typedef ap_int<kZ0Size> l1t::TkJetWord::z0_t

Definition at line 57 of file TkJetWord.h.

Member Enumeration Documentation

◆ TkJetBitLocations

Enumerator
kPtLSB 
kPtMSB 
kGlbEtaLSB 
kGlbEtaMSB 
kGlbPhiLSB 
kGlbPhiMSB 
kZ0LSB 
kZ0MSB 
kNtLSB 
kNtMSB 
kXtLSB 
kXtMSB 
kUnassignedLSB 
kUnassignedMSB 

Definition at line 37 of file TkJetWord.h.

37  {
38  kPtLSB = 0,
39  kPtMSB = kPtLSB + TkJetBitWidths::kPtSize - 1,
40  kGlbEtaLSB = kPtMSB + 1,
41  kGlbEtaMSB = kGlbEtaLSB + TkJetBitWidths::kGlbEtaSize - 1,
42  kGlbPhiLSB = kGlbEtaMSB + 1,
43  kGlbPhiMSB = kGlbPhiLSB + TkJetBitWidths::kGlbPhiSize - 1,
44  kZ0LSB = kGlbPhiMSB + 1,
45  kZ0MSB = kZ0LSB + TkJetBitWidths::kZ0Size - 1,
46  kNtLSB = kZ0MSB + 1,
47  kNtMSB = kNtLSB + TkJetBitWidths::kNtSize - 1,
48  kXtLSB = kNtMSB + 1,
49  kXtMSB = kXtLSB + TkJetBitWidths::kXtSize - 1,
50  kUnassignedLSB = kXtMSB + 1,
52  };
const unsigned int kUnassignedSize

◆ TkJetBitWidths

Enumerator
kPtSize 
kPtMagSize 
kGlbEtaSize 
kGlbPhiSize 
kZ0Size 
kNtSize 
kXtSize 
kUnassignedSize 
kTkJetWordSize 

Definition at line 25 of file TkJetWord.h.

Constructor & Destructor Documentation

◆ TkJetWord() [1/3]

l1t::TkJetWord::TkJetWord ( )
inline

Definition at line 66 of file TkJetWord.h.

66 {}

◆ TkJetWord() [2/3]

l1t::TkJetWord::TkJetWord ( pt_t  pt,
glbeta_t  eta,
glbphi_t  phi,
z0_t  z0,
nt_t  nt,
nx_t  nx,
tkjetunassigned_t  unassigned 
)

Definition at line 7 of file TkJetWord.cc.

References PVValHelper::eta, nt(), pt(), setTkJetWord(), unassigned(), and z0().

7  {
9  }
float pt() const
Definition: TkJetWord.h:129
float z0() const
Definition: TkJetWord.h:132
int nt() const
Definition: TkJetWord.h:133
unsigned int unassigned() const
Definition: TkJetWord.h:135
void setTkJetWord(pt_t pt, glbeta_t eta, glbphi_t phi, z0_t z0, nt_t nt, nx_t nx, tkjetunassigned_t unassigned)
Definition: TkJetWord.cc:11

◆ ~TkJetWord()

l1t::TkJetWord::~TkJetWord ( )
inline

Definition at line 69 of file TkJetWord.h.

69 {}

◆ TkJetWord() [3/3]

l1t::TkJetWord::TkJetWord ( const TkJetWord word)
inline

Definition at line 72 of file TkJetWord.h.

References tkJetWord_.

72 { tkJetWord_ = word.tkJetWord_; }
uint64_t word
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:153

Member Function Documentation

◆ glbeta()

float l1t::TkJetWord::glbeta ( ) const
inline

Definition at line 130 of file TkJetWord.h.

References ETAPHI_LSB, and glbEtaWord().

130 { return glbEtaWord().to_float() * ETAPHI_LSB; }
glbeta_t glbEtaWord() const
Definition: TkJetWord.h:87
float ETAPHI_LSB
Definition: TkJetWord.h:22

◆ glbEtaBits()

unsigned int l1t::TkJetWord::glbEtaBits ( ) const
inline

Definition at line 120 of file TkJetWord.h.

References glbEtaWord().

120 { return glbEtaWord().to_uint(); }
glbeta_t glbEtaWord() const
Definition: TkJetWord.h:87

◆ glbEtaWord()

glbeta_t l1t::TkJetWord::glbEtaWord ( ) const
inline

Definition at line 87 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by glbeta(), and glbEtaBits().

87  {
88  glbeta_t ret;
89  ret.V = tkJetWord()(TkJetBitLocations::kGlbEtaMSB, TkJetBitLocations::kGlbEtaLSB);
90  return ret;
91  }
ap_int< kGlbEtaSize > glbeta_t
Definition: TkJetWord.h:55
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115

◆ glbphi()

float l1t::TkJetWord::glbphi ( ) const
inline

Definition at line 131 of file TkJetWord.h.

References ETAPHI_LSB, and glbPhiWord().

131 { return glbPhiWord().to_float() * ETAPHI_LSB; }
glbphi_t glbPhiWord() const
Definition: TkJetWord.h:92
float ETAPHI_LSB
Definition: TkJetWord.h:22

◆ glbPhiBits()

unsigned int l1t::TkJetWord::glbPhiBits ( ) const
inline

Definition at line 121 of file TkJetWord.h.

References glbPhiWord().

121 { return glbPhiWord().to_uint(); }
glbphi_t glbPhiWord() const
Definition: TkJetWord.h:92

◆ glbPhiWord()

glbphi_t l1t::TkJetWord::glbPhiWord ( ) const
inline

Definition at line 92 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by glbphi(), and glbPhiBits().

92  {
93  glbphi_t ret;
94  ret.V = tkJetWord()(TkJetBitLocations::kGlbPhiMSB, TkJetBitLocations::kGlbPhiLSB);
95  return ret;
96  }
ret
prodAgent to be discontinued
ap_int< kGlbPhiSize > glbphi_t
Definition: TkJetWord.h:56
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115

◆ nt()

int l1t::TkJetWord::nt ( ) const
inline

Definition at line 133 of file TkJetWord.h.

References ntWord().

Referenced by setTkJetWord(), and TkJetWord().

133 { return (ap_ufixed<kNtSize + 2, kNtSize>(ntWord())).to_int(); }
nt_t ntWord() const
Definition: TkJetWord.h:102

◆ ntBits()

unsigned int l1t::TkJetWord::ntBits ( ) const
inline

Definition at line 123 of file TkJetWord.h.

References ntWord().

123 { return ntWord().to_uint(); }
nt_t ntWord() const
Definition: TkJetWord.h:102

◆ ntWord()

nt_t l1t::TkJetWord::ntWord ( ) const
inline

Definition at line 102 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by nt(), and ntBits().

102  {
103  nt_t ret;
104  ret.V = tkJetWord()(TkJetBitLocations::kNtMSB, TkJetBitLocations::kNtLSB);
105  return ret;
106  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115
ap_uint< kNtSize > nt_t
Definition: TkJetWord.h:58

◆ operator=()

TkJetWord& l1t::TkJetWord::operator= ( const TkJetWord word)
inline

Definition at line 75 of file TkJetWord.h.

References tkJetWord_.

75  {
76  tkJetWord_ = word.tkJetWord_;
77  return *this;
78  }
uint64_t word
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:153

◆ pt()

float l1t::TkJetWord::pt ( ) const
inline

◆ ptBits()

unsigned int l1t::TkJetWord::ptBits ( ) const
inline

Definition at line 119 of file TkJetWord.h.

References ptWord().

119 { return ptWord().to_uint(); }
pt_t ptWord() const
Definition: TkJetWord.h:82

◆ ptWord()

pt_t l1t::TkJetWord::ptWord ( ) const
inline

Definition at line 82 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by pt(), and ptBits().

82  {
83  pt_t ret;
84  ret.V = tkJetWord()(TkJetBitLocations::kPtMSB, TkJetBitLocations::kPtLSB);
85  return ret;
86  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115
ap_ufixed< 16, 14 > pt_t
Definition: TauNNIdHW.h:27

◆ setTkJetWord()

void l1t::TkJetWord::setTkJetWord ( pt_t  pt,
glbeta_t  eta,
glbphi_t  phi,
z0_t  z0,
nt_t  nt,
nx_t  nx,
tkjetunassigned_t  unassigned 
)

Definition at line 11 of file TkJetWord.cc.

References b, PVValHelper::eta, l1tmhtemu::kUnassignedSize, nt(), hltrates_dqm_sourceclient-live_cfg::offset, pt(), tkJetWord_, unassigned(), and z0().

Referenced by TkJetWord().

12  {
13  // pack the TkJet word
14  unsigned int offset = 0;
15  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kPtSize); b++) {
16  tkJetWord_.set(b, pt[b - offset]);
17  }
18  offset += TkJetBitWidths::kPtSize;
19  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbEtaSize); b++) {
20  tkJetWord_.set(b, eta[b - offset]);
21  }
22  offset += TkJetBitWidths::kGlbEtaSize;
23  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbPhiSize); b++) {
24  tkJetWord_.set(b, phi[b - offset]);
25  }
26  offset += TkJetBitWidths::kGlbPhiSize;
27  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kZ0Size); b++) {
28  tkJetWord_.set(b, z0[b - offset]);
29  }
30  offset += TkJetBitWidths::kZ0Size;
31  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kNtSize); b++) {
32  tkJetWord_.set(b, nt[b - offset]);
33  }
34  offset += TkJetBitWidths::kNtSize;
35  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kXtSize); b++) {
36  tkJetWord_.set(b, nx[b - offset]);
37  }
38  offset += TkJetBitWidths::kXtSize;
39  for (unsigned int b = offset; b < (offset + TkJetBitWidths::kUnassignedSize); b++) {
40  tkJetWord_.set(b, unassigned[b - offset]);
41  }
42  }
float pt() const
Definition: TkJetWord.h:129
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:153
float z0() const
Definition: TkJetWord.h:132
int nt() const
Definition: TkJetWord.h:133
double b
Definition: hdecay.h:118
unsigned int unassigned() const
Definition: TkJetWord.h:135
const unsigned int kUnassignedSize

◆ tkJetWord()

tkjetword_t l1t::TkJetWord::tkJetWord ( ) const
inline

Definition at line 115 of file TkJetWord.h.

References tkJetWord_.

Referenced by glbEtaWord(), glbPhiWord(), ntWord(), ptWord(), unassignedWord(), xtWord(), and z0Word().

115 { return tkjetword_t(tkJetWord_.to_string().c_str(), 2); }
ap_uint< TkJetBitWidths::kTkJetWordSize > tkjetword_t
Definition: TkJetWord.h:62
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:153

◆ unassigned()

unsigned int l1t::TkJetWord::unassigned ( ) const
inline

Definition at line 135 of file TkJetWord.h.

References unassignedWord().

Referenced by setTkJetWord(), and TkJetWord().

135 { return unassignedWord().to_uint(); }
tkjetunassigned_t unassignedWord() const
Definition: TkJetWord.h:112

◆ unassignedBits()

unsigned int l1t::TkJetWord::unassignedBits ( ) const
inline

Definition at line 125 of file TkJetWord.h.

References unassignedWord().

125 { return unassignedWord().to_uint(); }
tkjetunassigned_t unassignedWord() const
Definition: TkJetWord.h:112

◆ unassignedWord()

tkjetunassigned_t l1t::TkJetWord::unassignedWord ( ) const
inline

◆ unpackSignedValue()

double l1t::TkJetWord::unpackSignedValue ( unsigned int  bits,
unsigned int  nBits,
double  lsb 
) const
inlineprivate

Definition at line 142 of file TkJetWord.h.

References gpuClustering::pixelStatus::bits, and l1tHGCalVFEProducer_cfi::lsb.

142  {
143  int isign = 1;
144  unsigned int digitized_maximum = (1 << nBits) - 1;
145  if (bits & (1 << (nBits - 1))) { // check the sign
146  isign = -1;
147  bits = (1 << (nBits + 1)) - bits; // if negative, flip everything for two's complement encoding
148  }
149  return (double(bits & digitized_maximum) + 0.5) * lsb * isign;
150  }
constexpr uint32_t bits
Definition: gpuClustering.h:23

◆ xt()

int l1t::TkJetWord::xt ( ) const
inline

Definition at line 134 of file TkJetWord.h.

References xtWord().

134 { return (ap_ufixed<kXtSize + 2, kXtSize>(xtWord())).to_int(); }
nx_t xtWord() const
Definition: TkJetWord.h:107

◆ xtBits()

unsigned int l1t::TkJetWord::xtBits ( ) const
inline

Definition at line 124 of file TkJetWord.h.

References xtWord().

124 { return xtWord().to_uint(); }
nx_t xtWord() const
Definition: TkJetWord.h:107

◆ xtWord()

nx_t l1t::TkJetWord::xtWord ( ) const
inline

Definition at line 107 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by xt(), and xtBits().

107  {
108  nx_t ret;
109  ret.V = tkJetWord()(TkJetBitLocations::kXtMSB, TkJetBitLocations::kXtLSB);
110  return ret;
111  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115
ap_uint< kXtSize > nx_t
Definition: TkJetWord.h:59

◆ z0()

float l1t::TkJetWord::z0 ( ) const
inline

Definition at line 132 of file TkJetWord.h.

References Z0_LSB, and z0Word().

Referenced by setTkJetWord(), and TkJetWord().

132 { return z0Word().to_float() * Z0_LSB; }
z0_t z0Word() const
Definition: TkJetWord.h:97
float Z0_LSB
Definition: TkJetWord.h:23

◆ z0Bits()

unsigned int l1t::TkJetWord::z0Bits ( ) const
inline

Definition at line 122 of file TkJetWord.h.

References z0Word().

122 { return z0Word().to_uint(); }
z0_t z0Word() const
Definition: TkJetWord.h:97

◆ z0Word()

z0_t l1t::TkJetWord::z0Word ( ) const
inline

Definition at line 97 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by z0(), and z0Bits().

97  {
98  z0_t ret;
99  ret.V = tkJetWord()(TkJetBitLocations::kZ0MSB, TkJetBitLocations::kZ0LSB);
100  return ret;
101  }
ret
prodAgent to be discontinued
ap_int< kZ0Size > z0_t
Definition: TkJetWord.h:57
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:115

Member Data Documentation

◆ ETAPHI_LSB

float l1t::TkJetWord::ETAPHI_LSB = M_PI / (1 << 12)

Definition at line 22 of file TkJetWord.h.

Referenced by glbeta(), and glbphi().

◆ INTPHI_PI

int l1t::TkJetWord::INTPHI_PI = 720

Definition at line 19 of file TkJetWord.h.

◆ INTPHI_TWOPI

int l1t::TkJetWord::INTPHI_TWOPI = 2 * INTPHI_PI

Definition at line 20 of file TkJetWord.h.

◆ INTPT_LSB

float l1t::TkJetWord::INTPT_LSB = 1 >> 5

Definition at line 21 of file TkJetWord.h.

◆ tkJetWord_

tkjetword_bs_t l1t::TkJetWord::tkJetWord_
private

Definition at line 153 of file TkJetWord.h.

Referenced by operator=(), setTkJetWord(), TkJetWord(), and tkJetWord().

◆ Z0_LSB

float l1t::TkJetWord::Z0_LSB = 0.05

Definition at line 23 of file TkJetWord.h.

Referenced by z0().