ATLAS Offline Software
MaxCombinationCondition.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGHLTJETHYPO_MAXCOMBINATIONCONDITION_H
6 #define TRIGHLTJETHYPO_MAXCOMBINATIONCONDITION_H
7 
8 #include "./ICondition.h"
9 #include "CombinationsIterator.h"
10 #include <vector>
11 #include <memory>
12 
13 /*
14  * The Condition is initialised with an integer value k.
15  * isSatisfied() iterates over all n choose k combinations of the n
16  * The combination with the max value of a user supplied function
17  * is tested with an ICondition object.
18  *
19  * Taking the first use case as an example:
20  * - a hypojet vector of size n is passes to this Condition
21  * - combinatorial machinery is used to find the (n choose k) combinations
22  * - These combinations are iterated over. std::max_element is used
23  * to find the combination with the highest DIPz defined likelihood. The
24  * comparator used by std::max_element is provided as a template parameter.
25  * - The combination with the highest likelihood is passed to the HT Condition
26  * which is the m_accepringCondition attribute of this class.
27  * This Condition passes the event if the HT of the maximising
28  * combination exceeds a threshold value.
29  */
30 
31 template<typename T>
33 
34 public:
35  MaxCombinationCondition(std::size_t k, std::unique_ptr<ICondition> cond, const T& cmp);
36  ~MaxCombinationCondition() override = default;
37 
38  virtual bool
40  const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
41 
42  virtual unsigned int capacity() const override {return m_k;}
43 
44  virtual std::string toString() const override;
45 
46 private:
47  // k as in n choose k. n is given by th number of incoming jets.
48  std::size_t m_k;
49 
50  // the Condition which decides whether the particular n choose k
51  // set of jets choosen my the maximising function passes.
52  std::unique_ptr<ICondition> m_acceptingCondition;
53 
55 };
56 
57 #endif
58 
59 
python.EI_Lib.cmp
def cmp(x, y)
Definition: EI_Lib.py:6
MaxCombinationCondition.icc
MaxCombinationCondition
Definition: MaxCombinationCondition.h:32
MaxCombinationCondition::m_cmp
T m_cmp
Definition: MaxCombinationCondition.h:54
MaxCombinationCondition::m_k
std::size_t m_k
Definition: MaxCombinationCondition.h:48
MaxCombinationCondition::m_acceptingCondition
std::unique_ptr< ICondition > m_acceptingCondition
Definition: MaxCombinationCondition.h:52
MaxCombinationCondition::~MaxCombinationCondition
~MaxCombinationCondition() override=default
ICondition
Definition: ICondition.h:22
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
MaxCombinationCondition::toString
virtual std::string toString() const override
MaxCombinationCondition::MaxCombinationCondition
MaxCombinationCondition(std::size_t k, std::unique_ptr< ICondition > cond, const T &cmp)
MaxCombinationCondition::capacity
virtual unsigned int capacity() const override
Definition: MaxCombinationCondition.h:42
CombinationsIterator.h
ICondition.h
MaxCombinationCondition::isSatisfied
virtual bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
fitman.k
k
Definition: fitman.py:528