8 #include "l1_fp201_2011_a.hh"
10 void l1_fp201_2011_a(
Board& fp201,
int t){
11 int* channels = (
int*)fp201.channels[t];
13 int fm101out = channels[0];
14 int fm102out = channels[1];
15 int fm103out = channels[2];
16 int fe101out = channels[7];
19 int fpe0 = btest(fe101out,0);
20 int fpe1 = btest(fe101out,1);
27 int HT0 = btest(fm101out,27) | btest(fm102out,27) | btest(fm103out,27);
28 int HT1 = btest(fm101out,28) | btest(fm102out,28) | btest(fm103out,28);
32 int SBS0 = btest(fm101out,24);
33 int SBS1 = btest(fm101out,25);
34 int SBS2 = btest(fm101out,26);
39 int LBS0 = btest(fm102out,24) | btest(fm103out,24);
40 int LBS1 = btest(fm102out,25) | btest(fm103out,25);
41 int LBS2 = btest(fm102out,26) | btest(fm103out,26);
48 const int R0 = fp201.registers[0];
49 const int R1 = fp201.registers[1];
50 const int R2 = fp201.registers[2];
52 int SumST, SumSB, SumNT, SumNB;
53 computeJetPatchSums(fp201,SumST,SumSB,SumNT,SumNB);
58 int JP0 = SumST > R0 || SumSB > R0 || SumNT > R0 || SumNB > R0;
59 int JP1 = SumST > R1 || SumSB > R1 || SumNT > R1 || SumNB > R1;
60 int JP2 = SumST > R2 || SumSB > R2 || SumNT > R2 || SumNB > R2;
64 int dijet = (((SumST > R0) && ((SumSB > R0) || (SumNT > R0) || (SumNB > R0))) ||
65 ((SumSB > R0) && ((SumNT > R0) || (SumNB > R0))) ||
66 ((SumNT > R0) && (SumNB > R0)));
68 fp201.output[t] = HT0 | HT1 << 1 | SBS0 << 2 | SBS1 << 3 | SBS2 << 4 | LBS0 << 5 | LBS1 << 6 | LBS2 << 7 | JP0 << 8 | JP1 << 9 | JP2 << 10 | dijet << 11 | fpe << 14;
71 void computeJetPatchSums(
const Board& fp201,
int& SumST,
int& SumSB,
int& SumNT,
int& SumNB,
int t){
72 int* channels = (
int*)fp201.channels[t];
74 int fm101out = channels[0];
75 int fm102out = channels[1];
76 int fm103out = channels[2];
79 int SumSmST = getbits(fm101out,0 ,6);
80 int SumSmSB = getbits(fm101out,6 ,6);
81 int SumSmNT = getbits(fm101out,12,6);
82 int SumSmNB = getbits(fm101out,18,6);
85 int SumLgST = getbits(fm102out,0,6);
86 int SumLgSB = getbits(fm102out,6,6);
87 int SumLgNT = getbits(fm103out,0,6);
88 int SumLgNB = getbits(fm103out,6,6);
91 SumST = SumSmST + SumLgST;
92 SumSB = SumSmSB + SumLgSB;
93 SumNT = SumSmNT + SumLgNT;
94 SumNB = SumSmNB + SumLgNB;