1 #ifndef FIRMWARE_TkJetWord_h 2 #define FIRMWARE_TkJetWord_h 51 typedef ap_ufixed<kPtSize, kPtMagSize, AP_TRN, AP_SAT>
pt_t;
54 typedef ap_int<kZ0Size>
z0_t;
55 typedef ap_uint<kNtSize>
nt_t;
56 typedef ap_uint<kXtSize>
nx_t;
66 word.append(TkJetBitWidths::kUnassignedSize - (
unassigned.to_string().length() - 2),
'0');
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));
102 ret.V =
tkJetWord()(TkJetBitLocations::kPtMSB, TkJetBitLocations::kPtLSB);
107 ret.V =
tkJetWord()(TkJetBitLocations::kGlbEtaMSB, TkJetBitLocations::kGlbEtaLSB);
112 ret.V =
tkJetWord()(TkJetBitLocations::kGlbPhiMSB, TkJetBitLocations::kGlbPhiLSB);
117 ret.V =
tkJetWord()(TkJetBitLocations::kZ0MSB, TkJetBitLocations::kZ0LSB);
122 ret.V =
tkJetWord()(TkJetBitLocations::kNtMSB, TkJetBitLocations::kNtLSB);
127 ret.V =
tkJetWord()(TkJetBitLocations::kXtMSB, TkJetBitLocations::kXtLSB);
131 return tkJetWord()(TkJetBitLocations::kUnassignedMSB, TkJetBitLocations::kUnassignedLSB);
151 int nt()
const {
return (ap_ufixed<kNtSize + 2, kNtSize>(
ntWord())).to_int(); }
152 int xt()
const {
return (ap_ufixed<kXtSize + 2, kXtSize>(
xtWord())).to_int(); }
162 unsigned int digitized_maximum = (1 << nBits) - 1;
163 if (
bits & (1 << (nBits - 1))) {
167 return (
double(
bits & digitized_maximum) + 0.5) *
lsb * isign;
unsigned int xtBits() const
std::vector< l1t::TkJetWord > TkJetWordCollection
unsigned int z0Bits() const
ap_int< kGlbEtaSize > glbeta_t
double unpackSignedValue(unsigned int bits, unsigned int nBits, double lsb) const
ret
prodAgent to be discontinued
ap_int< kGlbPhiSize > glbphi_t
ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
ap_uint< TkJetBitWidths::kUnassignedSize > tkjetunassigned_t
ap_uint< TkJetBitWidths::kTkJetWordSize > tkjetword_t
tkjetword_t tkJetWord() const
TkJetWord & operator=(const TkJetWord &word)
TkJetWord(pt_t pt, glbeta_t eta, glbphi_t phi, z0_t z0, nt_t nt, nx_t nx, tkjetunassigned_t unassigned)
tkjetword_bs_t tkJetWord_
glbeta_t glbEtaWord() const
unsigned int glbPhiBits() const
unsigned int glbEtaBits() const
unsigned int ntBits() const
unsigned int unassignedBits() const
unsigned int unassigned() const
glbphi_t glbPhiWord() const
std::bitset< TkJetBitWidths::kTkJetWordSize > tkjetword_bs_t
TkJetWord(const TkJetWord &word)
tkjetunassigned_t unassignedWord() const
void setTkJetWord(pt_t pt, glbeta_t eta, glbphi_t phi, z0_t z0, nt_t nt, nx_t nx, tkjetunassigned_t unassigned)
unsigned int ptBits() const