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 13 of file TkJetWord.h.

Member Typedef Documentation

◆ glbeta_t

Definition at line 52 of file TkJetWord.h.

◆ glbphi_t

Definition at line 53 of file TkJetWord.h.

◆ nt_t

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

Definition at line 55 of file TkJetWord.h.

◆ nx_t

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

Definition at line 56 of file TkJetWord.h.

◆ pt_t

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

Definition at line 51 of file TkJetWord.h.

◆ tkjetunassigned_t

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

Definition at line 57 of file TkJetWord.h.

◆ tkjetword_bs_t

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

Definition at line 58 of file TkJetWord.h.

◆ tkjetword_t

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

Definition at line 59 of file TkJetWord.h.

◆ z0_t

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

Definition at line 54 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 34 of file TkJetWord.h.

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

◆ TkJetBitWidths

Enumerator
kPtSize 
kPtMagSize 
kGlbEtaSize 
kGlbPhiSize 
kZ0Size 
kNtSize 
kXtSize 
kUnassignedSize 
kTkJetWordSize 

Definition at line 22 of file TkJetWord.h.

Constructor & Destructor Documentation

◆ TkJetWord() [1/3]

l1t::TkJetWord::TkJetWord ( )
inline

Definition at line 63 of file TkJetWord.h.

63 {}

◆ 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 
)
inline

Definition at line 64 of file TkJetWord.h.

References PVValHelper::eta, nt(), pt(), AlCaHLTBitMon_QueryRunRegistry::string, tkJetWord_, createJobs::tmp, unassigned(), and z0().

64  {
65  std::string word = "";
66  word.append(TkJetBitWidths::kUnassignedSize - (unassigned.to_string().length() - 2), '0');
67  word = word + (unassigned.to_string().substr(2, unassigned.to_string().length() - 2));
68  word.append(TkJetBitWidths::kXtSize - (nx.to_string().length() - 2), '0');
69  word = word + (nx.to_string().substr(2, nx.to_string().length() - 2));
70  word.append(TkJetBitWidths::kNtSize - (nt.to_string().length() - 2), '0');
71  word = word + (nt.to_string().substr(2, nt.to_string().length() - 2));
72  word.append(TkJetBitWidths::kZ0Size - (z0.to_string().length() - 2), '0');
73  word = word + (z0.to_string().substr(2, z0.to_string().length() - 2));
74  word.append(TkJetBitWidths::kGlbPhiSize - (phi.to_string().length() - 2), '0');
75  word = word + (phi.to_string().substr(2, phi.to_string().length() - 2));
76  word.append(TkJetBitWidths::kGlbEtaSize - (eta.to_string().length() - 2), '0');
77  word = word + (eta.to_string().substr(2, eta.to_string().length() - 2));
78  ap_ufixed<kPtSize + 5, kPtMagSize + 5, AP_TRN, AP_SAT> pt_2 = pt;
79  ap_uint<kPtSize> pt_temp = pt_2 << 5;
80  word.append(TkJetBitWidths::kPtSize - (pt_temp.to_string().length() - 2), '0');
81  word = word + (pt_temp.to_string().substr(2, pt_temp.to_string().length() - 2));
82 
84  tkJetWord_ = tmp;
85  }
float pt() const
Definition: TkJetWord.h:147
uint64_t word
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:171
float z0() const
Definition: TkJetWord.h:150
int nt() const
Definition: TkJetWord.h:151
unsigned int unassigned() const
Definition: TkJetWord.h:153
std::bitset< TkJetBitWidths::kTkJetWordSize > tkjetword_bs_t
Definition: TkJetWord.h:58
tmp
align.sh
Definition: createJobs.py:716

◆ ~TkJetWord()

l1t::TkJetWord::~TkJetWord ( )
inline

Definition at line 87 of file TkJetWord.h.

87 {}

◆ TkJetWord() [3/3]

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

Definition at line 90 of file TkJetWord.h.

References tkJetWord_.

90 { tkJetWord_ = word.tkJetWord_; }
uint64_t word
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:171

Member Function Documentation

◆ glbeta()

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

Definition at line 148 of file TkJetWord.h.

References ETAPHI_LSB, and glbEtaWord().

148 { return glbEtaWord().to_float() * ETAPHI_LSB; }
glbeta_t glbEtaWord() const
Definition: TkJetWord.h:105
float ETAPHI_LSB
Definition: TkJetWord.h:19

◆ glbEtaBits()

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

Definition at line 138 of file TkJetWord.h.

References glbEtaWord().

138 { return glbEtaWord().to_uint(); }
glbeta_t glbEtaWord() const
Definition: TkJetWord.h:105

◆ glbEtaWord()

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

Definition at line 105 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by glbeta(), and glbEtaBits().

105  {
106  glbeta_t ret;
107  ret.V = tkJetWord()(TkJetBitLocations::kGlbEtaMSB, TkJetBitLocations::kGlbEtaLSB);
108  return ret;
109  }
ap_int< kGlbEtaSize > glbeta_t
Definition: TkJetWord.h:52
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133

◆ glbphi()

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

Definition at line 149 of file TkJetWord.h.

References ETAPHI_LSB, and glbPhiWord().

149 { return glbPhiWord().to_float() * ETAPHI_LSB; }
glbphi_t glbPhiWord() const
Definition: TkJetWord.h:110
float ETAPHI_LSB
Definition: TkJetWord.h:19

◆ glbPhiBits()

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

Definition at line 139 of file TkJetWord.h.

References glbPhiWord().

139 { return glbPhiWord().to_uint(); }
glbphi_t glbPhiWord() const
Definition: TkJetWord.h:110

◆ glbPhiWord()

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

Definition at line 110 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by glbphi(), and glbPhiBits().

110  {
111  glbphi_t ret;
112  ret.V = tkJetWord()(TkJetBitLocations::kGlbPhiMSB, TkJetBitLocations::kGlbPhiLSB);
113  return ret;
114  }
ret
prodAgent to be discontinued
ap_int< kGlbPhiSize > glbphi_t
Definition: TkJetWord.h:53
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133

◆ nt()

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

Definition at line 151 of file TkJetWord.h.

References ntWord().

Referenced by TkJetWord().

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

◆ ntBits()

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

Definition at line 141 of file TkJetWord.h.

References ntWord().

141 { return ntWord().to_uint(); }
nt_t ntWord() const
Definition: TkJetWord.h:120

◆ ntWord()

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

Definition at line 120 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by nt(), and ntBits().

120  {
121  nt_t ret;
122  ret.V = tkJetWord()(TkJetBitLocations::kNtMSB, TkJetBitLocations::kNtLSB);
123  return ret;
124  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133
ap_uint< kNtSize > nt_t
Definition: TkJetWord.h:55

◆ operator=()

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

Definition at line 93 of file TkJetWord.h.

References tkJetWord_.

93  {
94  tkJetWord_ = word.tkJetWord_;
95  return *this;
96  }
uint64_t word
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:171

◆ pt()

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

◆ ptBits()

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

Definition at line 137 of file TkJetWord.h.

References ptWord().

137 { return ptWord().to_uint(); }
pt_t ptWord() const
Definition: TkJetWord.h:100

◆ ptWord()

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

Definition at line 100 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by pt(), and ptBits().

100  {
101  pt_t ret;
102  ret.V = tkJetWord()(TkJetBitLocations::kPtMSB, TkJetBitLocations::kPtLSB);
103  return ret;
104  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133
ap_int< 16 > pt_t
Definition: data.h:6

◆ 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 
)

◆ tkJetWord()

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

Definition at line 133 of file TkJetWord.h.

References tkJetWord_.

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

133 { return tkjetword_t(tkJetWord_.to_string().c_str(), 2); }
ap_uint< TkJetBitWidths::kTkJetWordSize > tkjetword_t
Definition: TkJetWord.h:59
tkjetword_bs_t tkJetWord_
Definition: TkJetWord.h:171

◆ unassigned()

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

Definition at line 153 of file TkJetWord.h.

References unassignedWord().

Referenced by TkJetWord().

153 { return unassignedWord().to_uint(); }
tkjetunassigned_t unassignedWord() const
Definition: TkJetWord.h:130

◆ unassignedBits()

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

Definition at line 143 of file TkJetWord.h.

References unassignedWord().

143 { return unassignedWord().to_uint(); }
tkjetunassigned_t unassignedWord() const
Definition: TkJetWord.h:130

◆ unassignedWord()

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

Definition at line 130 of file TkJetWord.h.

References tkJetWord().

Referenced by unassigned(), and unassignedBits().

130  {
131  return tkJetWord()(TkJetBitLocations::kUnassignedMSB, TkJetBitLocations::kUnassignedLSB);
132  }
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133

◆ unpackSignedValue()

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

Definition at line 160 of file TkJetWord.h.

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

160  {
161  int isign = 1;
162  unsigned int digitized_maximum = (1 << nBits) - 1;
163  if (bits & (1 << (nBits - 1))) { // check the sign
164  isign = -1;
165  bits = (1 << (nBits + 1)) - bits; // if negative, flip everything for two's complement encoding
166  }
167  return (double(bits & digitized_maximum) + 0.5) * lsb * isign;
168  }
constexpr uint32_t bits
Definition: gpuClustering.h:23

◆ xt()

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

Definition at line 152 of file TkJetWord.h.

References xtWord().

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

◆ xtBits()

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

Definition at line 142 of file TkJetWord.h.

References xtWord().

142 { return xtWord().to_uint(); }
nx_t xtWord() const
Definition: TkJetWord.h:125

◆ xtWord()

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

Definition at line 125 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by xt(), and xtBits().

125  {
126  nx_t ret;
127  ret.V = tkJetWord()(TkJetBitLocations::kXtMSB, TkJetBitLocations::kXtLSB);
128  return ret;
129  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133
ap_uint< kXtSize > nx_t
Definition: TkJetWord.h:56

◆ z0()

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

Definition at line 150 of file TkJetWord.h.

References Z0_LSB, and z0Word().

Referenced by TkJetWord().

150 { return z0Word().to_float() * Z0_LSB; }
z0_t z0Word() const
Definition: TkJetWord.h:115
float Z0_LSB
Definition: TkJetWord.h:20

◆ z0Bits()

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

Definition at line 140 of file TkJetWord.h.

References z0Word().

140 { return z0Word().to_uint(); }
z0_t z0Word() const
Definition: TkJetWord.h:115

◆ z0Word()

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

Definition at line 115 of file TkJetWord.h.

References runTheMatrix::ret, and tkJetWord().

Referenced by z0(), and z0Bits().

115  {
116  z0_t ret;
117  ret.V = tkJetWord()(TkJetBitLocations::kZ0MSB, TkJetBitLocations::kZ0LSB);
118  return ret;
119  }
ret
prodAgent to be discontinued
tkjetword_t tkJetWord() const
Definition: TkJetWord.h:133
ap_int< 10 > z0_t
Definition: data.h:10

Member Data Documentation

◆ ETAPHI_LSB

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

Definition at line 19 of file TkJetWord.h.

Referenced by glbeta(), and glbphi().

◆ INTPHI_PI

int l1t::TkJetWord::INTPHI_PI = 720

Definition at line 16 of file TkJetWord.h.

◆ INTPHI_TWOPI

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

Definition at line 17 of file TkJetWord.h.

◆ INTPT_LSB

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

Definition at line 18 of file TkJetWord.h.

◆ tkJetWord_

tkjetword_bs_t l1t::TkJetWord::tkJetWord_
private

Definition at line 171 of file TkJetWord.h.

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

◆ Z0_LSB

float l1t::TkJetWord::Z0_LSB = 0.05

Definition at line 20 of file TkJetWord.h.

Referenced by z0().