2 #include "DSMAlgo_EE102_2013.hh"
4 void DSMAlgo_EE102_2013::operator()(
DSM& dsm)
40 int lowEtaSumA = dsm.channels[1] & 0x3f;
41 int lowEtaSumB = dsm.channels[2] & 0x3f;
42 int lowEtaSumC = dsm.channels[5] & 0x3f;
44 int highEtaSumA = (dsm.channels[1] >> 6 & 0x3f) + (dsm.channels[0] & 0x3f);
45 int highEtaSumB = (dsm.channels[2] >> 6 & 0x3f) + (dsm.channels[3] & 0x3f);
46 int highEtaSumC = (dsm.channels[5] >> 6 & 0x3f) + (dsm.channels[4] & 0x3f);
48 int jpa = lowEtaSumA + highEtaSumA;
49 int jpb = lowEtaSumB + highEtaSumB;
50 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;
83 int highTowerBits = 0;
85 for (
int ch = 0; ch < 6; ++ch)
86 highTowerBits |= dsm.channels[ch] >> 12 & 0x3;
90 int maxA = (lowEtaSumA > lowEtaSumB) && !(lowEtaSumC > lowEtaSumA);
91 int maxB = (lowEtaSumB > lowEtaSumC) && !(lowEtaSumA > lowEtaSumB);
92 int maxC = (lowEtaSumC > lowEtaSumA) && !(lowEtaSumB > lowEtaSumC);
116 if (maxSum > 63) maxSum = 63;
131 out |= jpaDijetBits << 2;
132 out |= jpbDijetBits << 3;
133 out |= jpcDijetBits << 4;
136 out |= highTowerBits << 14;
150 dsm.info[3] = lowEtaSumA;
151 dsm.info[4] = lowEtaSumB;
152 dsm.info[5] = lowEtaSumC;