CMS 3D CMS Logo

TkTripletWord.cc
Go to the documentation of this file.
1 // Class to store the 128-bit TkTriplet word for L1 Track Trigger.
2 // Author: George Krathanasis, CU Boulder (December 2023)
3 
5 
6 namespace l1t {
8  pt_t pt,
10  glbphi_t phi,
11  mass_t mass,
13  ditrack_minmass_t ditrack_minmass,
14  ditrack_maxmass_t ditrack_maxmass,
15  ditrack_minz0_t ditrack_minz0,
16  ditrack_maxz0_t ditrack_maxz0,
17  unassigned_t unassigned) {
19  valid, pt, eta, phi, mass, charge, ditrack_minmass, ditrack_maxmass, ditrack_minz0, ditrack_maxz0, unassigned);
20  }
21 
22  template <class packVarType>
23  inline void TkTripletWord::packIntoWord(unsigned int& currentOffset,
24  unsigned int wordChunkSize,
25  packVarType& packVar) {
26  for (unsigned int b = currentOffset; b < (currentOffset + wordChunkSize); ++b) {
27  tkTripletWord_.set(b, packVar[b - currentOffset]);
28  }
29  currentOffset += wordChunkSize;
30  }
31 
33  pt_t pt,
34  glbeta_t eta,
35  glbphi_t phi,
36  mass_t mass,
38  ditrack_minmass_t ditrack_minmass,
39  ditrack_maxmass_t ditrack_maxmass,
40  ditrack_minz0_t ditrack_minz0,
41  ditrack_maxz0_t ditrack_maxz0,
42  unassigned_t unassigned) {
43  // pack the TkTriplet word
44  unsigned int offset = 0;
46  packIntoWord(offset, TkTripletBitWidths::kPtSize, pt);
47  packIntoWord(offset, TkTripletBitWidths::kGlbPhiSize, phi);
48  packIntoWord(offset, TkTripletBitWidths::kGlbEtaSize, eta);
49  packIntoWord(offset, TkTripletBitWidths::kMassSize, mass);
50  packIntoWord(offset, TkTripletBitWidths::kChargeSize, charge);
51  packIntoWord(offset, TkTripletBitWidths::kDiTrackMinMassSize, ditrack_minmass);
52  packIntoWord(offset, TkTripletBitWidths::kDiTrackMaxMassSize, ditrack_maxmass);
53  packIntoWord(offset, TkTripletBitWidths::kDiTrackMinZ0Size, ditrack_minz0);
54  packIntoWord(offset, TkTripletBitWidths::kDiTrackMaxZ0Size, ditrack_maxz0);
55  }
56 
57 } //namespace l1t
ap_int< kChargeSize > charge_t
Definition: TkTripletWord.h:76
float pt() const
delete x;
Definition: CaloConfig.h:22
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
Definition: TkTripletWord.h:73
ap_int< kMassSize > mass_t
Definition: TkTripletWord.h:75
ap_int< kDiTrackMinMassSize > ditrack_minmass_t
Definition: TkTripletWord.h:77
const unsigned int kValidSize
ap_uint< TkTripletBitWidths::kUnassignedSize > unassigned_t
Definition: TkTripletWord.h:81
bool valid() const
unsigned int unassigned() const
ap_int< kDiTrackMinZ0Size > ditrack_minz0_t
Definition: TkTripletWord.h:79
ap_int< kGlbPhiSize > glbphi_t
Definition: TkTripletWord.h:74
ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
Definition: TkTripletWord.h:72
tktripletword_bs_t tkTripletWord_
double b
Definition: hdecay.h:120
ap_int< kDiTrackMaxMassSize > ditrack_maxmass_t
Definition: TkTripletWord.h:78
ap_int< kDiTrackMaxZ0Size > ditrack_maxz0_t
Definition: TkTripletWord.h:80
int charge() const
float mass() const
void packIntoWord(unsigned int &currentOffset, unsigned int wordChunkSize, packVarType &packVar)
ap_uint< kValidSize > valid_t
Definition: TkTripletWord.h:71