7 #include "qt32b_fms_2009_a.hh"
8 #include "fms_fm001_2011_a.hh"
10 void fms_fm001_2011_a(
Board& fm001,
int t){
11 int A[4], B[4], C[4], D[4], htadc, htid;
13 getQtSumAndHighTower((
int*)fm001.channels[t],A,B,C,D,htadc,htid);
16 const int R0 = fm001.registers[0];
17 const int R1 = fm001.registers[1];
26 int SumA = A[0]+A[1]+A[2]+A[3];
27 int SumAB = A[2]+A[3]+B[0]+B[1];
28 int SumB = B[0]+B[1]+B[2]+B[3];
29 int SumBC = B[2]+B[3]+C[0]+C[1];
30 int SumC = C[0]+C[1]+C[2]+C[3];
31 int SumD = D[0]+D[1]+D[2]+D[3];
36 if (SumA > 31) SumA = 31;
37 if (SumAB > 31) SumAB = 31;
38 if (SumB > 31) SumB = 31;
39 if (SumBC > 31) SumBC = 31;
40 if (SumC > 31) SumC = 31;
41 if (SumD > 31) SumD = 31;
44 fm001.output[t] = SumD | SumC << 5 | SumBC << 10 | SumB << 15 | SumAB << 20 | SumA << 25 | HT0 << 30 | HT1 << 31;