8 #include "DSMAlgo_EM201_2014_b.hh"
11 void DSMAlgo_EM201_2014_b::operator()(
DSM& dsm)
43 const int R0 = dsm.registers[0];
44 const int R1 = dsm.registers[1];
55 int counterDAQ10K = 0;
57 for (
int ichn = 0; ichn < 6; ++ichn) {
58 bemcHT |= dsm.channels[ichn] >> 10 & 0x3f;
60 bemcTPBit[ichn] = dsm.channels[ichn] >> 8 & 0x1;
61 bemcTP |= bemcTPBit[ichn];
63 bemcHTTPBit[ichn] = dsm.channels[ichn] >> 9 & 0x1;
64 bemcHTTP |= bemcHTTPBit[ichn];
66 bemcHTUPCBit[ichn] = dsm.channels[ichn] >> 15 & 0x1;
68 counterDAQ10K += dsm.channels[ichn] >> 7 & 0x1;
70 int bemcDAQ10K = counterDAQ10K >= R0;
76 for (
int ichn = 6; ichn < 8; ++ichn) {
77 eemcHT |= dsm.channels[ichn] >> 14 & 0x3;
89 for(
int ichn = 0; ichn < 3; ichn++){
90 int jchn = (ichn+3)%12;
91 tpB2B |= bemcTPBit[ichn] && bemcTPBit[jchn];
92 httpB2B |= bemcHTTPBit[ichn] && bemcHTTPBit[jchn];
93 htUPCB2B |= bemcHTUPCBit[ichn] && bemcHTUPCBit[jchn];
96 tpNONADJ = (bemcTPBit[0] && (bemcTPBit[2] || bemcTPBit[3] || bemcTPBit[4]))
97 || (bemcTPBit[1] && (bemcTPBit[3] || bemcTPBit[4] || bemcTPBit[5]))
98 || (bemcTPBit[2] && (bemcTPBit[4] || bemcTPBit[5]))
99 || (bemcTPBit[3] && bemcTPBit[5]);
101 httpNONADJ = (bemcHTTPBit[0] && (bemcHTTPBit[2] || bemcHTTPBit[3] || bemcHTTPBit[4]))
102 || (bemcHTTPBit[1] && (bemcHTTPBit[3] || bemcHTTPBit[4] || bemcHTTPBit[5]))
103 || (bemcHTTPBit[2] && (bemcHTTPBit[4] || bemcHTTPBit[5]))
104 || (bemcHTTPBit[3] && bemcHTTPBit[5]);
106 htUPCNONADJ = (bemcHTUPCBit[0] && (bemcHTUPCBit[2] || bemcHTUPCBit[3] || bemcHTUPCBit[4]))
107 || (bemcHTUPCBit[1] && (bemcHTUPCBit[3] || bemcHTUPCBit[4] || bemcHTUPCBit[5]))
108 || (bemcHTUPCBit[2] && (bemcHTUPCBit[4] || bemcHTUPCBit[5]))
109 || (bemcHTUPCBit[3] && bemcHTUPCBit[5]);
112 if(btest(R1, 0)) tpTopo = tpB2B;
113 else tpTopo = tpNONADJ;
117 httpTopo = httpB2B; }
118 else httpTopo = httpNONADJ;
121 if(btest(R1, 2)) htUPCTopo = htUPCB2B;
122 else htUPCTopo = htUPCNONADJ;
139 out |= (bemcHT & 0x3f);
141 out |= bemcHTTP << 7;
143 out |= httpTopo << 9;
144 out |= htUPCTopo << 10;
146 out |= bemcDAQ10K << 15;