13 static const int dPhiNLBMap_4bit_256Max[16] = {0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 20, 25, 31, 46, 68, 136};
16 static const int dPhiNLBMap_5bit_256Max[32] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
17 16, 17, 19, 20, 21, 23, 25, 28, 31, 34, 39, 46, 55, 68, 91, 136};
21 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
23 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
24 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 83, 84, 86, 87, 89, 91, 92, 94,
25 96, 98, 100, 102, 105, 107, 110, 112, 115, 118, 121, 124, 127, 131, 135, 138, 143, 147, 152, 157, 162, 168,
26 174, 181, 188, 196, 204, 214, 224, 235, 247, 261, 276, 294, 313, 336, 361, 391, 427, 470};
29 if (not((bits == 4 && max == 256) || (bits == 5 && max == 256) || (bits == 7 && max == 512))) {
43 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
52 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
61 else if (max == 512) {
64 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
73 if (not(
abs(sign_) == 1 && dPhi_ >= 0 && dPhi_ <
max)) {
74 edm::LogError(
"L1T") <<
"sign_ = " << sign_ <<
", dPhi_ = " << dPhi_ <<
", max = " <<
max;
77 return (sign_ * dPhi_);
81 if (not((bits == 4 && max == 256) || (bits == 5 && max == 256) || (bits == 7 && max == 512))) {
86 int dPhiBin_ = (1 <<
bits) - 1;
94 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
102 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
111 else if (max == 512) {
113 for (
int edge = 0; edge < (1 <<
bits) - 1; edge++) {
122 if (not(dPhiBin_ >= 0 && dPhiBin_ <
pow(2, bits))) {
130 if (not((bits == 4 && max == 256) || (bits == 5 && max == 256) || (bits == 7 && max == 512))) {
135 int dPhi_ = (1 <<
bits) - 1;
137 if (dPhiBin > (1 << bits) - 1)
138 dPhiBin = (1 << bits) - 1;
147 else if (max == 512) {
152 if (not(dPhi_ >= 0 && dPhi_ < max)) {
163 if (not(clct >= 0 && clct <= 10 &&
abs(endcap) == 1 &&
abs(dPhiSign) == 1 && (bits == 2 || bits == 3))) {
164 edm::LogError(
"L1T") <<
"clct = " << clct <<
", endcap = " << endcap <<
", dPhiSign = " << dPhiSign
165 <<
", bits = " <<
bits;
171 int sign_ = -1 * endcap * dPhiSign;
187 clct_ = (sign_ > 0 ? 1 : 2);
190 clct_ = (sign_ > 0 ? 2 : 1);
193 clct_ = (sign_ > 0 ? 0 : 3);
196 clct_ = (sign_ > 0 ? 3 : 0);
199 clct_ = (sign_ > 0 ? 0 : 3);
202 clct_ = (sign_ > 0 ? 3 : 0);
205 clct_ = (sign_ > 0 ? 0 : 3);
208 clct_ = (sign_ > 0 ? 3 : 0);
211 clct_ = (sign_ > 0 ? 0 : 3);
224 else if (bits == 3) {
230 clct_ = (sign_ > 0 ? 3 : 5);
233 clct_ = (sign_ > 0 ? 5 : 3);
236 clct_ = (sign_ > 0 ? 2 : 6);
239 clct_ = (sign_ > 0 ? 6 : 2);
242 clct_ = (sign_ > 0 ? 1 : 7);
245 clct_ = (sign_ > 0 ? 7 : 1);
248 clct_ = (sign_ > 0 ? 1 : 7);
251 clct_ = (sign_ > 0 ? 7 : 1);
254 clct_ = (sign_ > 0 ? 1 : 7);
267 if (not(clct_ >= 0 && clct_ <
pow(2, bits))) {
278 if (not(bits == 2 || bits == 3)) {
282 if (not(clct >= 0 && clct <
pow(2, bits))) {
283 edm::LogError(
"L1T") <<
"bits = " << bits <<
", clct = " << clct;
286 if (not(
abs(dPhiSign) == 1)) {
293 int sign_ = -1 * endcap * dPhiSign;
301 clct_ = (sign_ > 0 ? 8 : 9);
304 clct_ = (sign_ > 0 ? 4 : 5);
312 }
else if (bits == 3) {
318 clct_ = (sign_ > 0 ? 8 : 9);
321 clct_ = (sign_ > 0 ? 9 : 8);
324 clct_ = (sign_ > 0 ? 6 : 7);
327 clct_ = (sign_ > 0 ? 7 : 6);
330 clct_ = (sign_ > 0 ? 4 : 5);
333 clct_ = (sign_ > 0 ? 5 : 4);
345 if (not(clct_ >= 0 && clct_ <= 10)) {
353 if (not(bits == 2 || bits == 3)) {
362 if (
abs(dTheta) <= 1)
364 else if (
abs(dTheta) <= 2)
366 else if (dTheta <= -3)
373 else if (bits == 3) {
376 else if (dTheta == -3)
378 else if (dTheta == -2)
380 else if (dTheta == -1)
382 else if (dTheta == 0)
384 else if (dTheta == +1)
386 else if (dTheta == +2)
392 if (not(dTheta_ >= 0 && dTheta_ <
pow(2, bits))) {
400 if (not(bits == 2 || bits == 3)) {
423 }
else if (bits == 3) {
454 if (not(dTheta_ >= -4 && dTheta_ <= 3)) {
462 if (not(theta >= 5 && theta < 128 && (st1_ring2 == 0 || st1_ring2 == 1) && (bits == 4 || bits == 5))) {
463 edm::LogError(
"L1T") <<
"theta = " << theta <<
", st1_ring2 = " << st1_ring2 <<
", bits = " <<
bits;
471 if (st1_ring2 == 0) {
477 }
else if (st1_ring2 == 1) {
479 if (theta < 46 || theta > 87) {
487 else if (bits == 5) {
488 if (st1_ring2 == 0) {
489 theta_ = (
std::max(theta, 1) - 1) / 4;
490 }
else if (st1_ring2 == 1) {
491 theta_ = ((
std::min(theta, 104) - 1) / 4) + 6;
495 if (not(theta_ >= 0 && ((bits == 4 && theta_ <= 13) || (bits == 5 && theta_ <
pow(2, bits))))) {
503 if (not(bits == 4 || bits == 5)) {
507 if (not(theta >= 0 && theta <
pow(2, bits))) {
516 theta = (theta * 6) + 5;
519 theta = ((theta - 8) * 7) + 46;
521 }
else if (bits == 5) {
524 theta = (theta * 4) + 1;
527 theta = ((theta - 6) * 4) + 1;
531 if (not(theta >= 5 && theta <= 104)) {
539 if (not(bits == 4 || bits == 5)) {
543 if (not(theta >= 0 && theta <
pow(2, bits))) {
575 if (not(rpc_2b >= 0 && rpc_2b < 4)) {
583 if (not(rpc_2b >= 0 && rpc_2b < 4)) {
594 else if (rpc_2b == 1)
596 else if (rpc_2b == 2)
602 int theta,
int st1_ring2,
int endcap,
int sPhiAB,
int clctA,
int clctB,
int clctC,
int clctD)
const {
610 if (not(theta >= 0 && theta < 10)) {
615 int clctA_2b =
getCLCT(clctA, endcap, sPhiAB, 2);
617 int nRPC = (clctA == 0) + (clctB == 0) + (clctC == 0) + (clctD == 0);
618 int rpc_word, rpc_clct, mode15_8b;
621 if (nRPC >= 2 && clctA == 0 && clctB == 0)
623 else if (nRPC >= 2 && clctA == 0 && clctC == 0)
625 else if (nRPC >= 2 && clctA == 0 && clctD == 0)
627 else if (nRPC == 1 && clctA == 0)
629 else if (nRPC >= 2 && clctD == 0 && clctB == 0)
631 else if (nRPC >= 2 && clctD == 0 && clctC == 0)
633 else if (nRPC >= 2 && clctB == 0 && clctC == 0)
635 else if (nRPC == 1 && clctD == 0)
637 else if (nRPC == 1 && clctB == 0)
639 else if (nRPC == 1 && clctC == 0)
643 rpc_clct = rpc_word + clctA_2b;
644 mode15_8b = (theta * 32) + rpc_clct + 64;
646 if (theta >= 4 && clctD == 0)
648 else if (theta >= 4 && clctC == 0)
654 rpc_clct = rpc_word * 4 + clctA_2b;
655 mode15_8b = ((theta % 4) * 16) + rpc_clct;
660 if (not(mode15_8b >= 0 && mode15_8b <
pow(2, 8))) {
682 if (not(mode15_8b >= 0 && mode15_8b <
pow(2, 8))) {
686 if (not(
abs(endcap) == 1 &&
abs(sPhiAB) == 1)) {
687 edm::LogError(
"L1T") <<
"endcap = " << endcap <<
", sPhiAB = " << sPhiAB;
701 int rpc_clct, rpc_word, clctA_2b, nRPC = -1;
704 rpc_clct = (mode15_8b % 32);
705 theta = (mode15_8b - 64 - rpc_clct) / 32;
711 clctA_2b = (rpc_clct % 4);
712 rpc_word = rpc_clct - clctA_2b;
772 rpc_clct = (mode15_8b % 16);
773 theta = (mode15_8b - rpc_clct) / 16;
774 clctA_2b = (rpc_clct % 4);
775 rpc_word = (rpc_clct - clctA_2b) / 4;
806 if (not(nRPC >= 0)) {
int getTheta(int theta, int ring2, int bits=5) const
static const int dPhiNLBMap_7bit_512Max[128]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
static const int dPhiNLBMap_5bit_256Max[32]
Geom::Theta< T > theta() const
static const int dPhiNLBMap_4bit_256Max[16]
void unpack8bMode15(int mode15_8b, int &theta, int &st1_ring2, int endcap, int sPhiAB, int &clctA, int &rpcA, int &rpcB, int &rpcC, int &rpcD) const
int get2bRPC(int clctA, int clctB, int clctC) const
void unpack2bRPC(int rpc_2b, int &rpcA, int &rpcB, int &rpcC) const
int getNLBdPhi(int dPhi, int bits=7, int max=512) const
int unpackdTheta(int dTheta, int bits) const
Abs< T >::type abs(const T &t)
int getCLCT(int clct, int endcap, int dPhiSign, int bits=3) const
void unpackTheta(int &theta, int &st1_ring2, int bits) const
int getdPhiFromBin(int dPhiBin, int bits=7, int max=512) const
int getdTheta(int dTheta, int bits=3) const
int get8bMode15(int theta, int st1_ring2, int endcap, int sPhiAB, int clctA, int clctB, int clctC, int clctD) const
int unpackSt1Ring2(int theta, int bits) const
int unpackCLCT(int clct, int endcap, int dPhiSign, int bits) const
int getNLBdPhiBin(int dPhi, int bits=7, int max=512) const
Power< A, B >::type pow(const A &a, const B &b)