8 #include "DSMAlgo_EE102_2009.hh"
10 void DSMAlgo_EE102_2009::operator()(
DSM& dsm)
45 int lowEtaSumA = dsm.channels[1] & 0x3f;
46 int lowEtaSumB = dsm.channels[2] & 0x3f;
47 int lowEtaSumC = dsm.channels[5] & 0x3f;
49 int highEtaSumA = (dsm.channels[1] >> 6 & 0x3f) + (dsm.channels[0] & 0x3f);
50 int highEtaSumB = (dsm.channels[2] >> 6 & 0x3f) + (dsm.channels[3] & 0x3f);
51 int highEtaSumC = (dsm.channels[5] >> 6 & 0x3f) + (dsm.channels[4] & 0x3f);
53 int jpa = lowEtaSumA + highEtaSumA;
54 int jpb = lowEtaSumB + highEtaSumB;
55 int jpc = lowEtaSumC + highEtaSumC;
61 if ((jpa > dsm.registers[0]) && !(jpa > dsm.registers[1]) && !(jpa > dsm.registers[2])) jpaBits = 1;
62 if ((jpa > dsm.registers[0]) && (jpa > dsm.registers[1]) && !(jpa > dsm.registers[2])) jpaBits = 2;
63 if ((jpa > dsm.registers[0]) && (jpa > dsm.registers[1]) && (jpa > dsm.registers[2])) jpaBits = 3;
67 if ((jpb > dsm.registers[0]) && !(jpb > dsm.registers[1]) && !(jpb > dsm.registers[2])) jpbBits = 1;
68 if ((jpb > dsm.registers[0]) && (jpb > dsm.registers[1]) && !(jpb > dsm.registers[2])) jpbBits = 2;
69 if ((jpb > dsm.registers[0]) && (jpb > dsm.registers[1]) && (jpb > dsm.registers[2])) jpbBits = 3;
73 if ((jpc > dsm.registers[0]) && !(jpc > dsm.registers[1]) && !(jpc > dsm.registers[2])) jpcBits = 1;
74 if ((jpc > dsm.registers[0]) && (jpc > dsm.registers[1]) && !(jpc > dsm.registers[2])) jpcBits = 2;
75 if ((jpc > dsm.registers[0]) && (jpc > dsm.registers[1]) && (jpc > dsm.registers[2])) jpcBits = 3;
79 int highTowerBits = 0;
81 for (
int ch = 0; ch < 6; ++ch)
82 highTowerBits |= dsm.channels[ch] >> 12 & 0xf;
86 int maxA = (lowEtaSumA > lowEtaSumB) && !(lowEtaSumC > lowEtaSumA);
87 int maxB = (lowEtaSumB > lowEtaSumC) && !(lowEtaSumA > lowEtaSumB);
88 int maxC = (lowEtaSumC > lowEtaSumA) && !(lowEtaSumB > lowEtaSumC);
112 if (maxSum > 63) maxSum = 63;
130 out |= highTowerBits << 14;
144 dsm.info[3] = lowEtaSumA;
145 dsm.info[4] = lowEtaSumB;
146 dsm.info[5] = lowEtaSumC;