ATLAS Offline Software
Loading...
Searching...
No Matches
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"
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
31template<typename T>
33
34public:
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
46private:
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
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
virtual bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
std::unique_ptr< ICondition > m_acceptingCondition
virtual unsigned int capacity() const override
~MaxCombinationCondition() override=default
virtual std::string toString() const override
MaxCombinationCondition(std::size_t k, std::unique_ptr< ICondition > cond, const T &cmp)