2 #include "DSMAlgo_EE101_2013.hh"
4 void DSMAlgo_EE101_2013::operator()(
DSM& dsm)
41 int lowEtaSumA = dsm.channels[0] & 0x3f;
42 int lowEtaSumB = dsm.channels[3] & 0x3f;
43 int lowEtaSumC = dsm.channels[4] & 0x3f;
45 int highEtaSumA = (dsm.channels[0] >> 6 & 0x3f) + (dsm.channels[1] & 0x3f);
46 int highEtaSumB = (dsm.channels[3] >> 6 & 0x3f) + (dsm.channels[2] & 0x3f);
47 int highEtaSumC = (dsm.channels[4] >> 6 & 0x3f) + (dsm.channels[5] & 0x3f);
49 int jpa = lowEtaSumA + highEtaSumA;
50 int jpb = lowEtaSumB + highEtaSumB;
51 int jpc = lowEtaSumC + highEtaSumC;
62 for(
int chn = 0; chn < 3; ++chn)
64 if(jpa > dsm.registers[chn]) jpaBits++;
65 if(jpb > dsm.registers[chn]) jpbBits++;
66 if(jpc > dsm.registers[chn]) jpcBits++;
68 if(jpa > dsm.registers[chn] || jpb > dsm.registers[chn] || jpc > dsm.registers[chn]) jpCmbBits++;
73 int r3 = dsm.registers[3];
75 int jpaDijetBits = jpa > r3;
76 int jpbDijetBits = jpb > r3;
77 int jpcDijetBits = jpc > r3;
81 int highTowerBits = 0;
83 for (
int ch = 0; ch < 6; ++ch)
84 highTowerBits |= dsm.channels[ch] >> 12 & 0x3;
88 int maxA = (lowEtaSumA > lowEtaSumB) && !(lowEtaSumC > lowEtaSumA);
89 int maxB = (lowEtaSumB > lowEtaSumC) && !(lowEtaSumA > lowEtaSumB);
90 int maxC = (lowEtaSumC > lowEtaSumA) && !(lowEtaSumB > lowEtaSumC);
114 if (maxSum > 63) maxSum = 63;
127 dsm.output = jpCmbBits;
128 dsm.output |= jpaDijetBits << 2;
129 dsm.output |= jpbDijetBits << 3;
130 dsm.output |= jpcDijetBits << 4;
131 dsm.output |= maxSum << 6;
132 dsm.output |= maxId << 12;
133 dsm.output |= highTowerBits << 14;
146 dsm.info[3] = lowEtaSumA;
147 dsm.info[4] = lowEtaSumB;
148 dsm.info[5] = lowEtaSumC;