CMS 3D CMS Logo

VertexWord.cc
Go to the documentation of this file.
1 //
3 // class to store the 96-bit track word produced by the L1 Track Trigger. Intended to be inherited by L1 TTTrack.
4 // packing scheme given below.
5 //
6 // author: Alexx Perloff
7 // created: March 17, 2021
8 //
10 
12 
13 namespace l1t {
14 
16  double z0,
17  unsigned int multiplicity,
18  double pt,
19  unsigned int quality,
20  unsigned int inverseMultiplicity,
21  unsigned int unassigned) {
22  // convert directly to AP types
23  vtxvalid_t valid_ap = valid;
24  vtxz0_t z0_ap = z0;
26  vtxsumpt_t pt_ap = pt;
27  vtxquality_t quality_ap = quality;
29  vtxunassigned_t unassigned_ap = unassigned;
30 
31  setVertexWord(valid_ap, z0_ap, mult_ap, pt_ap, quality_ap, invmult_ap, unassigned_ap);
32  }
33 
35  unsigned int z0,
36  unsigned int multiplicity,
37  unsigned int pt,
38  unsigned int quality,
39  unsigned int inverseMultiplicity,
40  unsigned int unassigned) {
41  // convert to AP types
42  vtxvalid_t valid_ap = valid;
43  vtxz0_t z0_ap = unpackSignedValue(
44  z0, VertexBitWidths::kZ0Size, 1.0 / (1 << (VertexBitWidths::kZ0Size - VertexBitWidths::kZ0MagSize)));
47  z0, VertexBitWidths::kSumPtSize, 1.0 / (1 << (VertexBitWidths::kSumPtSize - VertexBitWidths::kSumPtMagSize)));
48  vtxquality_t quality_ap = quality;
50  vtxunassigned_t unassigned_ap = unassigned;
51 
52  setVertexWord(valid_ap, z0_ap, mult_ap, pt_ap, quality_ap, invmult_ap, unassigned_ap);
53  }
54 
56  vtxz0_t z0,
57  vtxmultiplicity_t multiplicity,
58  vtxsumpt_t pt,
60  vtxinversemult_t inverseMultiplicity,
61  vtxunassigned_t unassigned) {
63  }
64 
66  vtxz0_t z0,
67  vtxmultiplicity_t multiplicity,
68  vtxsumpt_t pt,
70  vtxinversemult_t inverseMultiplicity,
71  vtxunassigned_t unassigned) {
72  // pack the vertex word
73  unsigned int offset = 0;
74  for (unsigned int b = offset; b < (offset + VertexBitWidths::kValidSize); b++) {
75  vertexWord_.set(b, valid[b - offset]);
76  }
78  for (unsigned int b = offset; b < (offset + VertexBitWidths::kZ0Size); b++) {
79  vertexWord_.set(b, z0[b - offset]);
80  }
81  offset += VertexBitWidths::kZ0Size;
82 
83  for (unsigned int b = offset; b < (offset + VertexBitWidths::kNTrackInPVSize); b++) {
85  }
86  offset += VertexBitWidths::kNTrackInPVSize;
87  for (unsigned int b = offset; b < (offset + VertexBitWidths::kSumPtSize); b++) {
88  vertexWord_.set(b, pt[b - offset]);
89  }
90  offset += VertexBitWidths::kSumPtSize;
91  for (unsigned int b = offset; b < (offset + VertexBitWidths::kQualitySize); b++) {
92  vertexWord_.set(b, quality[b - offset]);
93  }
94  offset += VertexBitWidths::kQualitySize;
95  for (unsigned int b = offset; b < (offset + VertexBitWidths::kNTrackOutPVSize); b++) {
97  }
98  offset += VertexBitWidths::kNTrackOutPVSize;
99  for (unsigned int b = offset; b < (offset + VertexBitWidths::kUnassignedSize); b++) {
100  vertexWord_.set(b, unassigned[b - offset]);
101  }
102  }
103 
104 } // namespace l1t
vtxword_bs_t vertexWord_
Definition: VertexWord.h:191
ap_uint< VertexBitWidths::kUnassignedSize > vtxunassigned_t
Definition: VertexWord.h:71
unsigned int unassigned() const
Definition: VertexWord.h:161
ap_ufixed< VertexBitWidths::kNTrackInPVSize, VertexBitWidths::kNTrackInPVSize, AP_RND_CONV, AP_SAT > vtxmultiplicity_t
Definition: VertexWord.h:65
unsigned int quality() const
Definition: VertexWord.h:159
void setVertexWord(vtxvalid_t valid, vtxz0_t z0, vtxmultiplicity_t multiplicity, vtxsumpt_t pt, vtxquality_t quality, vtxinversemult_t inverseMultiplicity, vtxunassigned_t unassigned)
Definition: VertexWord.cc:65
delete x;
Definition: CaloConfig.h:22
ap_ufixed< VertexBitWidths::kNTrackOutPVSize, VertexBitWidths::kNTrackOutPVSize, AP_RND_CONV, AP_SAT > vtxinversemult_t
Definition: VertexWord.h:70
ap_fixed< VertexBitWidths::kZ0Size, VertexBitWidths::kZ0MagSize, AP_RND_CONV, AP_SAT > vtxz0_t
Definition: VertexWord.h:63
const unsigned int kValidSize
ap_ufixed< VertexBitWidths::kSumPtSize, VertexBitWidths::kSumPtMagSize, AP_RND_CONV, AP_SAT > vtxsumpt_t
Definition: VertexWord.h:67
ap_uint< VertexBitWidths::kQualitySize > vtxquality_t
Definition: VertexWord.h:68
double pt() const
Definition: VertexWord.h:158
bool valid() const
Definition: VertexWord.h:155
double b
Definition: hdecay.h:118
double z0() const
Definition: VertexWord.h:156
const unsigned int kUnassignedSize
unsigned int multiplicity() const
Definition: VertexWord.h:157
string quality
double unpackSignedValue(unsigned int bits, unsigned int nBits, double lsb) const
Definition: VertexWord.h:180
unsigned int inverseMultiplicity() const
Definition: VertexWord.h:160
ap_uint< VertexBitWidths::kValidSize > vtxvalid_t
Definition: VertexWord.h:62