1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// Class to store the 96-bit TkJet word for L1 Track Trigger.
// Author: Benjamin Radburn-Smith (September 2022)
#include "DataFormats/L1Trigger/interface/TkJetWord.h"
namespace l1t {
TkJetWord::TkJetWord(pt_t pt,
glbeta_t eta,
glbphi_t phi,
z0_t z0,
nt_t nt,
nx_t nx,
dispflag_t dispflag,
tkjetunassigned_t unassigned) {
setTkJetWord(pt, eta, phi, z0, nt, nx, dispflag, unassigned);
}
void TkJetWord::setTkJetWord(pt_t pt,
glbeta_t eta,
glbphi_t phi,
z0_t z0,
nt_t nt,
nx_t nx,
dispflag_t dispflag,
tkjetunassigned_t unassigned) {
// pack the TkJet word
unsigned int offset = 0;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kPtSize); b++) {
tkJetWord_.set(b, pt[b - offset]);
}
offset += TkJetBitWidths::kPtSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbPhiSize); b++) {
tkJetWord_.set(b, phi[b - offset]);
}
offset += TkJetBitWidths::kGlbPhiSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbEtaSize); b++) {
tkJetWord_.set(b, eta[b - offset]);
}
offset += TkJetBitWidths::kGlbEtaSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kZ0Size); b++) {
tkJetWord_.set(b, z0[b - offset]);
}
offset += TkJetBitWidths::kZ0Size;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kNtSize); b++) {
tkJetWord_.set(b, nt[b - offset]);
}
offset += TkJetBitWidths::kNtSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kXtSize); b++) {
tkJetWord_.set(b, nx[b - offset]);
}
offset += TkJetBitWidths::kXtSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kDispFlagSize); b++) {
tkJetWord_.set(b, nx[b - offset]);
}
offset += TkJetBitWidths::kDispFlagSize;
for (unsigned int b = offset; b < (offset + TkJetBitWidths::kUnassignedSize); b++) {
tkJetWord_.set(b, unassigned[b - offset]);
}
}
} //namespace l1t
|