ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
MaxCombinationCondition.icc
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef MAXCOMBINATIONCONDITION_ICC
5
#define MAXCOMBINATIONCONDITION_ICC
6
7
#include "CombinationsIterator.h"
8
#include <algorithm>
9
10
template<typename T>
11
MaxCombinationCondition<T>::MaxCombinationCondition(std::size_t k,
12
std::unique_ptr<ICondition> cond, const T& cmp):
13
m_k{k},m_acceptingCondition{std::move(cond)}, m_cmp{cmp} {
14
}
15
16
template<typename T>
17
bool
18
MaxCombinationCondition<T>::isSatisfied(const HypoJetVector& hjv,
19
const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
20
auto n = hjv.size();
21
if (n < m_k) {return false;}
22
auto begin = CombinationsIterator(m_k, hjv);
23
auto end = begin.endIter();
24
25
26
return m_acceptingCondition->isSatisfied(*std::max_element(std::move(begin),
27
std::move(end),
28
m_cmp), c);
29
}
30
31
32
template<typename T>
33
std::string MaxCombinationCondition<T>::toString() const {
34
std::stringstream ss;
35
ss << "MaxCombinationCondition:"
36
<< " k " << m_k
37
<< " capacity " << m_k
38
<< " accepting condition " << m_acceptingCondition->toString()
39
<< '\n';
40
return ss.str();
41
42
}
43
#endif
Generated on
for ATLAS Offline Software by
1.17.0