8 #include "qt32b_fms_2009_a.hh"
9 #include "fms_fm005_2011_a.hh"
11 void fms_fm005_2011_a(
Board& fm005,
int t){
12 int E[4], F[4], G[4], H[4], htadc, htid;
14 getQtSumAndHighTower((
int*)fm005.channels[t],E,F,G,H,htadc,htid);
17 const int R0 = fm005.registers[0];
18 const int R1 = fm005.registers[1];
27 int SumE = E[0]+E[1]+E[2]+E[3];
28 int SumEF = E[2]+E[3]+F[0]+F[1];
29 int SumF = F[0]+F[1]+F[2]+F[3];
30 int SumG = G[0]+G[1]+G[2]+G[3];
31 int SumGH = G[2]+G[3]+H[0]+H[1];
32 int SumH = H[0]+H[1]+H[2]+H[3];
36 if (SumE > 31) SumE = 31;
37 if (SumEF > 31) SumEF = 31;
38 if (SumF > 31) SumF = 31;
39 if (SumG > 31) SumG = 31;
40 if (SumGH > 31) SumGH = 31;
41 if (SumH > 31) SumH = 31;
44 fm005.output[t] = SumH | SumGH << 5 | SumG << 10 | SumF << 15 | SumEF << 20 | SumE << 25 | HT0 << 30 | HT1 << 31;
47 if (strcmp(fm005.name,
"FM007") == 0) {
48 int* channels = (
int*)fm005.channels;
49 printf(
"%08x %08x %08x %08x\n",channels[0],channels[1],channels[2],channels[3]);