7 #include "qt32b_fms_2009_a.hh"
8 #include "fms_fm001_2012_a.hh"
11 void fms_fm001_2012_a(
Board& fm001,
int t){
12 int A[4], B[4], C[4], D[4], htadc, htid;
14 getQtSumAndHighTower((
int*)fm001.channels[t],A,B,C,D,htadc,htid);
17 const int R0 = fm001.registers[0];
18 const int R1 = fm001.registers[1];
27 int SumA = A[0]+A[1]+A[2]+A[3];
28 int SumAB = A[2]+A[3]+B[0]+B[1];
29 int SumB = B[0]+B[1]+B[2]+B[3];
30 int SumBC = B[2]+B[3]+C[0]+C[1];
31 int SumC = C[0]+C[1]+C[2]+C[3];
32 int SumCD = C[2]+C[3]+D[0]+D[1];
33 int SumD = D[0]+D[1]+D[2]+D[3];
38 if (SumA > 31) SumA = 31;
39 if (SumAB > 31) SumAB = 31;
40 if (SumB > 31) SumB = 31;
41 if (SumBC > 31) SumBC = 31;
42 if (SumC > 31) SumC = 31;
43 if (SumCD > 31) SumCD = 31;
44 if (SumD > 31) SumD = 31;
47 fm001.output[t] = SumD | SumC << 5 | SumBC << 10 | SumB << 15 | SumCD << 20 | SumA << 25 | HT0 << 30 | HT1 << 31;
49 printf(
"%10s HTADC=%4d sum=%2d %2d %2d %2d %2d %2d %2d\n",fm001.name,htadc,SumA,SumAB,SumB,SumBC,SumC,SumCD,SumD);