14 auto muonPhToken =
static_cast<const BMTFTokens*
>(toks)->getInputMuonTokenPh();
15 auto muonThToken =
static_cast<const BMTFTokens*
>(toks)->getInputMuonTokenTh();
20 event.getByToken(muonPhToken, phInputs);
22 event.getByToken(muonThToken, thInputs);
24 uint32_t qualEta_32bit = 0;
25 uint32_t posEta_0_32bit = 0;
26 uint32_t posEta_n2_32bit = 0, posEta_n1_32bit = 0;
27 uint32_t posEta_p2_32bit = 0, posEta_p1_32bit = 0;
29 bool moreBXeta =
false;
30 for (
int link = 0; link <= 35; link++) {
33 if ((link >= 6 && link < 8) || (link >= 14 && link < 16) || (link >= 30 && link < 32))
37 std::vector<uint32_t> payload_0(6, 0);
38 std::vector<uint32_t> payload_p1(6, 0);
39 std::vector<uint32_t> payload_n1(6, 0);
40 std::vector<uint32_t> payload_p2(6, 0);
41 std::vector<uint32_t> payload_n2(6, 0);
43 unsigned int block_id = 2 * link;
45 std::vector<bool> bxPresent(5,
false);
46 bool moreBXphi =
false;
57 if (
iphi.bxNum() != 0)
65 if (
iphi.scNum() + 1 != board_id)
73 bxPresent[2 +
iphi.bxNum()] =
true;
78 payload_n2[
iphi.stNum() - 1] = word_32bit;
79 }
else if (bxPresent[1]) {
80 payload_n1[
iphi.stNum() - 1] = word_32bit;
81 }
else if (bxPresent[2])
82 payload_0[
iphi.stNum() - 1] = word_32bit;
83 else if (bxPresent[3]) {
84 payload_p1[
iphi.stNum() - 1] = word_32bit;
85 }
else if (bxPresent[4]) {
86 payload_p2[
iphi.stNum() - 1] = word_32bit;
89 bxPresent.assign(5,
false);
97 uint32_t phiNull_32bit = 0 | (BC & 0x3) << 30;
99 uint32_t etaNull_32bit = 0 | (BC & 0x3) << 30;
110 posEta_0_32bit = etaNull_32bit;
111 posEta_n2_32bit = etaNull_32bit;
112 posEta_n1_32bit = etaNull_32bit;
113 posEta_p2_32bit = etaNull_32bit;
114 posEta_p1_32bit = etaNull_32bit;
116 qualEta_32bit = etaNull_32bit;
123 if (ithe.bxNum() != 0)
131 if (ithe.scNum() + 1 != board_id)
134 if (link !=
ownLinks_[4 + 2 * (ithe.whNum())])
137 bxPresent[2 + ithe.bxNum()] =
true;
144 qualEta_32bit = qualEta_32bit | ((qualEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
148 payload_n2[4] = qualEta_32bit;
149 payload_n2[5] = etaNull_32bit | (2 & 0x2);
150 posEta_n2_32bit = posEta_n2_32bit | ((posEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
151 }
else if (bxPresent[1]) {
152 payload_n1[4] = qualEta_32bit;
153 payload_n1[5] = etaNull_32bit | (2 & 0x2);
154 posEta_n1_32bit = posEta_n1_32bit | ((posEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
155 }
else if (bxPresent[2]) {
156 payload_0[4] = qualEta_32bit;
157 payload_0[5] = etaNull_32bit | (2 & 0x2);
158 posEta_0_32bit = posEta_0_32bit | ((posEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
159 }
else if (bxPresent[3]) {
160 payload_p1[4] = qualEta_32bit;
161 payload_p1[5] = etaNull_32bit | (2 & 0x2);
162 posEta_p1_32bit = posEta_p1_32bit | ((posEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
163 }
else if (bxPresent[4]) {
164 payload_p2[4] = qualEta_32bit;
165 payload_p2[5] = etaNull_32bit | (2 & 0x2);
166 posEta_p2_32bit = posEta_p2_32bit | ((posEta_7bit & 0x7F) << 7 * (ithe.stNum() - 1));
169 bxPresent.assign(5,
false);
176 payload_n2[4] = posEta_n2_32bit;
177 payload_n2[5] = etaNull_32bit;
179 payload_n1[4] = posEta_n1_32bit;
180 payload_n1[5] = etaNull_32bit;
183 payload_0[4] = posEta_0_32bit;
184 payload_0[5] = etaNull_32bit;
187 payload_p1[4] = posEta_p1_32bit;
188 payload_p1[5] = etaNull_32bit;
190 payload_p2[4] = posEta_p2_32bit;
191 payload_p2[5] = etaNull_32bit;
198 bool moreBX = moreBXphi || moreBXeta;
202 for (
int iSt = 0; iSt <= 3; iSt++) {
203 if (moreBX && payload_n2[iSt] == 0)
204 payload_n2[iSt] = phiNull_32bit;
206 if (moreBX && payload_n1[iSt] == 0)
207 payload_n1[iSt] = phiNull_32bit;
209 if (payload_0[iSt] == 0)
210 payload_0[iSt] = phiNull_32bit;
212 if (moreBX && payload_p1[iSt] == 0)
213 payload_p1[iSt] = phiNull_32bit;
215 if (moreBX && payload_p2[iSt] == 0)
216 payload_p2[iSt] = phiNull_32bit;
221 if (moreBX && payload_n2[
word] == 0)
222 payload_n2[
word] = etaNull_32bit;
224 if (moreBX && payload_n1[
word] == 0)
225 payload_n1[
word] = etaNull_32bit;
227 if (payload_0[
word] == 0)
228 payload_0[
word] = etaNull_32bit;
230 if (moreBX && payload_p1[
word] == 0)
231 payload_p1[
word] = etaNull_32bit;
233 if (moreBX && payload_p2[
word] == 0)
234 payload_p2[
word] = etaNull_32bit;
267 for (
int i = 0;
i < 6;
i++)
269 for (
int i = 0;
i < 6;
i++)
273 for (
int i = 0;
i < 6;
i++)
277 for (
int i = 0;
i < 6;
i++)
279 for (
int i = 0;
i < 6;
i++)
309 for (
int i = 6;
i >= 0;
i--) {
314 for (
int i = 6;
i >= 0;
i--) {
int position(const int i) const
The_Container const * getContainer() const
std::vector< Block > Blocks
Abs< T >::type abs(const T &t)
Phi_Container const * getContainer() const
#define DEFINE_L1T_PACKER(type)
int quality(const int i) const