1 #include "DSMAlgo_BC101_2013.hh"
3 void DSMAlgo_BC101_2013::operator()(
DSM& dsm)
36 int highTowerBits = 0;
40 for (
int ch = 0; ch <= 4; ch += 2) {
41 int lowEtaSum = dsm.channels[ch] & 0x3f;
42 int highEtaSum = dsm.channels[ch] >> 6 & 0x3f;
43 jpx += lowEtaSum + highEtaSum;
45 highTowerBits |= dsm.channels[ch] >> 12 & 0xf;
50 for (
int ch = 1; ch <= 5; ch += 2) {
51 int lowEtaSum = dsm.channels[ch] & 0x3f;
52 int highEtaSum = dsm.channels[ch] >> 6 & 0x3f;
54 jpz += lowEtaSum + highEtaSum;
55 jpPartial += highEtaSum;
56 highTowerBits |= dsm.channels[ch] >> 12 & 0xf;
60 if (jpPartial > 63) jpPartial = 63;
70 for (
int reg = 0; reg < 3; ++reg) {
71 if (jpx > dsm.registers[reg]) ++jpxBits;
72 if (jpy > dsm.registers[reg]) ++jpyBits;
73 if (jpz > dsm.registers[reg]) ++jpzBits;
79 int r4 = dsm.registers[4];
80 dijetBits = (jpx > r4) || (jpy > r4) || (jpz > r4);
85 for(
int ibit = 0; ibit < 3; ++ibit)
87 if(highTowerBits & (1 << ibit))
91 fourthHTBits |= highTowerBits >> 3;
107 out |= jpPartial << 6;
108 out |= packedHTBits << 12;
109 out |= fourthHTBits << 14;
110 out |= dijetBits << 15;
119 dsm.info[3] = jpPartial;