8 #include "l1_fp201_2012_b.hh"
11 void l1_fp201_2012_b(
Board& fp201,
int t){
12 int* channels = (
int*)fp201.channels[t];
14 const int R0 = fp201.registers[0];
15 const int R1 = fp201.registers[1];
16 const int R2 = fp201.registers[2];
17 const int R3 = fp201.registers[3];
18 const int R4 = fp201.registers[4];
19 const int R5 = fp201.registers[5];
21 int fm101out = channels[0];
22 int fm102out = channels[1];
23 int fm103out = channels[2];
24 int fe101out = channels[7];
27 int fpe0 = btest(fe101out,0);
28 int fpe1 = btest(fe101out,1);
33 int HT0 = btest(fm102out,27) | btest(fm103out,27);
34 int HT1 = btest(fm102out,28) | btest(fm103out,28);
37 HT0 |= btest(fm101out,20);
38 HT1 |= btest(fm101out,21);
43 int SBS0 = btest(fm101out,30);
44 int SBS1 = btest(fm101out,31);
49 int LBS0 = btest(fm102out,24) | btest(fm103out,24);
50 int LBS1 = btest(fm102out,25) | btest(fm103out,25);
51 int LBS2 = btest(fm102out,26) | btest(fm103out,26);
55 int SumST, SumSB, SumNT, SumNB, SumS, SumN;
56 computeJetPatchSums(fp201,SumST,SumSB,SumNT,SumNB,SumS,SumN);
61 int JP0 = SumST > R0 || SumSB > R0 || SumNT > R0 || SumNB > R0 || SumS > R0;
62 int JP1 = SumST > R1 || SumSB > R1 || SumNT > R1 || SumNB > R1 || SumS > R1;
63 int JP2 = SumST > R2 || SumSB > R2 || SumNT > R2 || SumNB > R2 || SumS > R2;
73 int dijet = (((SumST > R0) && ((SumSB > R0) || (SumNT > R0) || (SumNB > R0))) ||
74 ((SumSB > R0) && ((SumNT > R0) || (SumNB > R0))) ||
75 ((SumNT > R0) && (SumNB > R0)) ||
76 ((SumN > R0) && (SumST > R0)) ||
77 ((SumN > R0) && (SumS > R0)) ||
78 ((SumN > R0) && (SumSB > R0)) ||
79 ((SumS > R0) && (SumNT > R0)) ||
80 ((SumS > R0) && (SumNB > R0)));
82 int combo1 = ((SBS0 && btest(R4,0)) ||
83 (SBS1 && btest(R4,1)) ||
84 (LBS0 && btest(R4,2)) ||
85 (LBS1 && btest(R4,3)) ||
86 (LBS2 && btest(R4,4)) ||
87 (JP0 && btest(R4,5)) ||
88 (JP1 && btest(R4,6)) ||
89 (JP2 && btest(R4,7)) ||
90 (dijet && btest(R4,8)) ||
91 (fpe && btest(R4,9)));
93 int combo2 = ((SBS0 && btest(R5,0)) ||
94 (SBS1 && btest(R5,1)) ||
95 (LBS0 && btest(R5,2)) ||
96 (LBS1 && btest(R5,3)) ||
97 (LBS2 && btest(R5,4)) ||
98 (JP0 && btest(R5,5)) ||
99 (JP1 && btest(R5,6)) ||
100 (JP2 && btest(R5,7)) ||
101 (dijet && btest(R5,8)) ||
102 (fpe && btest(R5,9)));
106 fp201.output[t] |= HT0 << 0;
107 fp201.output[t] |= HT1 << 1;
108 fp201.output[t] |= SBS0 << 2;
109 fp201.output[t] |= SBS1 << 3;
110 fp201.output[t] |= LBS0 << 5;
111 fp201.output[t] |= LBS1 << 6;
112 fp201.output[t] |= LBS2 << 7;
113 fp201.output[t] |= JP0 << 8;
114 fp201.output[t] |= JP1 << 9;
115 fp201.output[t] |= JP2 << 10;
116 fp201.output[t] |= dijet << 11;
117 fp201.output[t] |= combo1 << 12;
118 fp201.output[t] |= combo2 << 13;
119 fp201.output[t] |= fpe << 14;
122 void computeJetPatchSums(
const Board& fp201,
int& SumST,
int& SumSB,
int& SumNT,
int& SumNB,
int& SumS,
int& SumN,
int t)
124 int* channels = (
int*)fp201.channels[t];
126 int fm101out = channels[0];
127 int fm102out = channels[1];
128 int fm103out = channels[2];
131 int SumSmST = getbits(fm101out,0 ,5);
132 int SumSmS = getbits(fm101out,5 ,5);
133 int SumSmSB = getbits(fm101out,10,5);
134 int SumSmNT = getbits(fm101out,15,5);
135 int SumSmN = getbits(fm101out,20,5);
136 int SumSmNB = getbits(fm101out,25,5);
139 int SumLgST = getbits(fm102out,0 ,5);
140 int SumLgS = getbits(fm102out,5 ,5);
141 int SumLgSB = getbits(fm102out,10,5);
142 int SumLgNT = getbits(fm103out,0 ,5);
143 int SumLgN = getbits(fm103out,5 ,5);
144 int SumLgNB = getbits(fm103out,10,5);
147 SumST = SumSmST + SumLgST;
148 SumSB = SumSmSB + SumLgSB;
149 SumNT = SumSmNT + SumLgNT;
150 SumNB = SumSmNB + SumLgNB;
151 SumS = SumSmS+SumLgS;
152 SumN = SumSmN+SumLgN;