7 #ifndef SUM_TRIGGER_PATCH_CHANNELS_HH
8 #define SUM_TRIGGER_PATCH_CHANNELS_HH
12 inline void sumTriggerPatchChannels(
const DSM& dsm,
int chMin,
int chMax,
int step,
int targetPedestal,
int& sum,
int& highTowerBits)
18 for (
int ch = chMin; ch <= chMax; ch += step) {
19 int highTower = dsm.channels[ch] & 0x3f;
21 for (
int reg = 0; reg < 4; ++reg)
22 highTowerBits |= (highTower > dsm.registers[reg]) << reg;
24 int triggerPatch = dsm.channels[ch] >> 6 & 0x3f;
36 sum -= (nChannels - targetPedestal);
40 if (sum > 63) sum = 63;
43 inline void sumTriggerPatchChannels2015(
const DSM& dsm,
int chMin,
int chMax,
int step,
int targetPedestal,
int& sum,
int& highTowerBits)
49 for (
int ch = chMin; ch <= chMax; ch += step) {
50 int highTower = dsm.channels[ch] & 0x3f;
52 for (
int reg = 0; reg < 3; ++reg)
53 highTowerBits |= (highTower > dsm.registers[reg]) << reg;
55 int triggerPatch = dsm.channels[ch] >> 6 & 0x3f;
57 int ht_tp = (highTower > dsm.registers[3]) && (triggerPatch > dsm.registers[4]);
58 highTowerBits |= ht_tp << 3;
70 sum -= (nChannels - targetPedestal);
74 if (sum > 63) sum = 63;
76 #endif // SUM_TRIGGER_PATCH_CHANNELS_HH