151{
152
153
154
155
157 unsigned int next_channel = 0;
158 unsigned int next = 0;
159 unsigned int tol_count = 0;
160
161
162 std::vector<std::pair<int, TriggerPrimitive>> chanTPList;
164 chanTPList.push_back(std::make_pair(
channel_t(tp.channel), tp));
165 }
166 std::sort(chanTPList.begin(),
167 chanTPList.end(),
168 [](const std::pair<int, TriggerPrimitive>& a, const std::pair<int, TriggerPrimitive>& b) {
169 return (a.first < b.first);
170 });
171
172
173
174
175
176
177
180
181 for (int i = 0; i < chanTPList.size(); ++i) {
182
184
185 next = (i + 1) % chanTPList.size();
186 channel = chanTPList.at(i).first;
187 next_channel = chanTPList.at(next).first;
188
189
190 if (next == 0) {
192 }
193
194
195 if (next_channel == channel)
196 continue;
197
198
199 if (win_adj.
inputs.size() == 0)
200 win_adj.
add(chanTPList[i].second);
201
202
203 if (next_channel - channel == 1) {
204 win_adj.
add(chanTPList[next].second);
205 }
206
207
208
209 else if (next_channel - channel > 0 && next_channel - channel <= 5 && tol_count <
m_adj_tolerance) {
210 win_adj.
add(chanTPList[next].second);
211 tol_count += next_channel -
channel - 1;
212 }
213
214
216 win_adj_max = win_adj;
217 break;
218 }
219
220
221 else {
222 tol_count = 0;
224 }
225 }
226
227 return win_adj_max;
228}
uint16_t m_adjacency_threshold
TPWindow m_current_window
void add(TriggerPrimitive const &input_tp)
std::vector< TriggerPrimitive > inputs
dunedaq::trgdataformats::channel_t channel_t