1 #ifndef FIRMWARE_TkTripletWord_h 2 #define FIRMWARE_TkTripletWord_h 72 typedef ap_ufixed<kPtSize, kPtMagSize, AP_TRN, AP_SAT>
pt_t;
118 ret.V =
tkTripletWord()(TkTripletBitLocations::kPtMSB, TkTripletBitLocations::kPtLSB);
123 ret.V =
tkTripletWord()(TkTripletBitLocations::kGlbEtaMSB, TkTripletBitLocations::kGlbEtaLSB);
128 ret.V =
tkTripletWord()(TkTripletBitLocations::kGlbPhiMSB, TkTripletBitLocations::kGlbPhiLSB);
133 ret.V =
tkTripletWord()(TkTripletBitLocations::kMassMSB, TkTripletBitLocations::kMassLSB);
138 ret.V =
tkTripletWord()(TkTripletBitLocations::kChargeMSB, TkTripletBitLocations::kChargeLSB);
144 ret.V =
tkTripletWord()(TkTripletBitLocations::kDiTrackMinMassMSB, TkTripletBitLocations::kDiTrackMinMassLSB);
149 ret.V =
tkTripletWord()(TkTripletBitLocations::kDiTrackMaxMassMSB, TkTripletBitLocations::kDiTrackMaxMassLSB);
154 ret.V =
tkTripletWord()(TkTripletBitLocations::kDiTrackMinZ0MSB, TkTripletBitLocations::kDiTrackMinZ0LSB);
159 ret.V =
tkTripletWord()(TkTripletBitLocations::kDiTrackMaxZ0MSB, TkTripletBitLocations::kDiTrackMaxZ0LSB);
187 glbEtaWord(), TkTripletBitWidths::kGlbEtaSize, (
MAX_ETA) / (1 << TkTripletBitWidths::kGlbEtaSize));
191 TkTripletBitWidths::kGlbPhiSize,
192 (2. *
std::abs(
M_PI)) / (1 << TkTripletBitWidths::kGlbPhiSize));
196 massWord(), TkTripletBitWidths::kMassSize,
MAX_MASS / (1 << TkTripletBitWidths::kMassSize));
200 chargeWord(), TkTripletBitWidths::kChargeSize,
MAX_CHARGE / (1 << TkTripletBitWidths::kChargeSize));
204 TkTripletBitWidths::kDiTrackMinMassSize,
205 MAX_MASS / (1 << TkTripletBitWidths::kDiTrackMinMassSize));
209 TkTripletBitWidths::kDiTrackMaxMassSize,
210 MAX_MASS / (1 << TkTripletBitWidths::kDiTrackMaxMassSize));
214 TkTripletBitWidths::kDiTrackMinZ0Size,
215 MAX_Z0 / (1 << TkTripletBitWidths::kDiTrackMinZ0Size));
219 TkTripletBitWidths::kDiTrackMaxZ0Size,
220 MAX_Z0 / (1 << TkTripletBitWidths::kDiTrackMaxZ0Size));
237 template <
class packVarType>
238 inline void packIntoWord(
unsigned int& currentOffset,
unsigned int wordChunkSize, packVarType& packVar);
244 unsigned int digitized_maximum = (1 << nBits) - 1;
245 if (
bits & (1 << (nBits - 1))) {
249 return (
double(
bits & digitized_maximum) + 0.5) *
lsb * isign;
unsigned int ptBits() const
ap_int< kChargeSize > charge_t
ret
prodAgent to be discontinued
unsigned int ditrackMaxMassBits() const
charge_t chargeWord() const
double unpackSignedValue(unsigned int bits, unsigned int nBits, double lsb) const
TkTripletWord(const TkTripletWord &word)
glbeta_t glbEtaWord() const
ditrack_minmass_t ditrackMinMassWord() const
void setTkTripletWord(valid_t valid, pt_t pt, glbeta_t eta, glbphi_t phi, mass_t mass, charge_t charge, ditrack_minmass_t ditrack_minmass, ditrack_maxmass_t ditrack_maxmass, ditrack_minz0_t ditrack_minz0, ditrack_maxz0_t ditrack_maxz0, unassigned_t unassigned)
ap_int< kGlbEtaSize > glbeta_t
float ditrackMinZ0() const
static constexpr double MAX_ETA
unsigned int massBits() const
unsigned int ditrackMinZ0Bits() const
unsigned int unassignedBits() const
ap_int< kMassSize > mass_t
ap_int< kDiTrackMinMassSize > ditrack_minmass_t
const unsigned int kValidSize
unsigned int ditrackMaxZ0Bits() const
ditrack_minz0_t ditrackMinZ0Word() const
ap_uint< TkTripletBitWidths::kUnassignedSize > unassigned_t
std::vector< l1t::TkTripletWord > TkTripletWordCollection
unsigned int glbPhiBits() const
Abs< T >::type abs(const T &t)
static constexpr double MAX_MASS
tktripletword_t tkTripletWord() const
unsigned int unassigned() const
static constexpr double MAX_CHARGE
ap_int< kDiTrackMinZ0Size > ditrack_minz0_t
ap_int< kGlbPhiSize > glbphi_t
unsigned int validBits() const
float ditrackMinMass() const
TkTripletWord & operator=(const TkTripletWord &word)
ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
tktripletword_bs_t tkTripletWord_
ap_uint< TkTripletBitWidths::kTkTripletWordSize > tktripletword_t
glbphi_t glbPhiWord() const
unsigned int ditrackMinMassBits() const
static constexpr double MAX_Z0
ap_int< kDiTrackMaxMassSize > ditrack_maxmass_t
ap_int< kDiTrackMaxZ0Size > ditrack_maxz0_t
ditrack_maxmass_t ditrackMaxMassWord() const
const unsigned int kUnassignedSize
valid_t validWord() const
unsigned int glbEtaBits() const
std::bitset< TkTripletBitWidths::kTkTripletWordSize > tktripletword_bs_t
unsigned int chargeBits() const
float ditrackMaxZ0() const
float ditrackMaxMass() const
unassigned_t unassignedWord() const
void packIntoWord(unsigned int ¤tOffset, unsigned int wordChunkSize, packVarType &packVar)
ap_uint< kValidSize > valid_t
ditrack_maxz0_t ditrackMaxZ0Word() const