2 #include "sum_eemc_http.hh"
3 #include "DSMAlgo_EE102_2017.hh"
5 void DSMAlgo_EE102_2017::operator()(
DSM& dsm)
44 getEemcUpperHalfJetPatchSums(dsm,jpa,jpb,jpc);
47 int httpa, httpb, httpc;
48 getEemcHTTP(dsm, httpa, httpb, httpc);
54 if(jpa > dsm.registers[2] || jpb > dsm.registers[2] || jpc > dsm.registers[2]){
56 }
else if(jpa > dsm.registers[1] || jpb > dsm.registers[1] || jpc > dsm.registers[1]){
58 }
else if(jpa > dsm.registers[0] || jpb > dsm.registers[0] || jpc > dsm.registers[0]){
66 int highTowerBits = 0;
68 for (
int ch = 0; ch < 6; ++ch)
69 highTowerBits |= dsm.channels[ch] >> 12 & 0xf;
73 int lowEtaSumA = dsm.channels[1] & 0x3f;
74 int lowEtaSumB = dsm.channels[2] & 0x3f;
75 int lowEtaSumC = dsm.channels[5] & 0x3f;
77 int maxA = (lowEtaSumA > lowEtaSumB) && !(lowEtaSumC > lowEtaSumA);
78 int maxB = (lowEtaSumB > lowEtaSumC) && !(lowEtaSumA > lowEtaSumB);
79 int maxC = (lowEtaSumC > lowEtaSumA) && !(lowEtaSumB > lowEtaSumC);
103 if (maxSum > 63) maxSum = 63;
123 out |= highTowerBits << 14;
131 dsm.info[3] = lowEtaSumA;
132 dsm.info[4] = lowEtaSumB;
133 dsm.info[5] = lowEtaSumC;
136 void DSMAlgo_EE102_2017::getEemcUpperHalfJetPatchSums(
const DSM& dsm,
int& jpa,
int& jpb,
int& jpc)
138 int lowEtaSumA = dsm.channels[1] & 0x3f;
139 int lowEtaSumB = dsm.channels[2] & 0x3f;
140 int lowEtaSumC = dsm.channels[5] & 0x3f;
142 int highEtaSumA = (dsm.channels[1] >> 6 & 0x3f) + (dsm.channels[0] & 0x3f);
143 int highEtaSumB = (dsm.channels[2] >> 6 & 0x3f) + (dsm.channels[3] & 0x3f);
144 int highEtaSumC = (dsm.channels[5] >> 6 & 0x3f) + (dsm.channels[4] & 0x3f);
146 jpa = lowEtaSumA + highEtaSumA;
147 jpb = lowEtaSumB + highEtaSumB;
148 jpc = lowEtaSumC + highEtaSumC;