ATLAS Offline Software
Loading...
Searching...
No Matches
TrigJetHypoToolHelperNoGrouper Class Reference

#include <TrigJetHypoToolHelperNoGrouper.h>

Inheritance diagram for TrigJetHypoToolHelperNoGrouper:
Collaboration diagram for TrigJetHypoToolHelperNoGrouper:

Public Member Functions

 TrigJetHypoToolHelperNoGrouper (const std::string &type, const std::string &name, const IInterface *parent)
StatusCode initialize () override
virtual bool pass (HypoJetVector &, xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
virtual std::size_t requiresNJets () const override
virtual StatusCode getDescription (ITrigJetHypoInfoCollector &) const override

Private Member Functions

virtual std::string toString () const override

Private Attributes

std::vector< std::unique_ptr< IJetsMatcher > > m_matchers
ToolHandleArray< ITrigJetHypoToolNoGrouperConfigm_configs
ToolHandleArray< ITrigHypoJetVectorFilterConfigm_prefilterMakers
Gaudi::Property< bool > m_debug {this, "debug", false, "instantantiate helpers with this debug flag"}

Detailed Description

Definition at line 35 of file TrigJetHypoToolHelperNoGrouper.h.

Constructor & Destructor Documentation

◆ TrigJetHypoToolHelperNoGrouper()

TrigJetHypoToolHelperNoGrouper::TrigJetHypoToolHelperNoGrouper ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 15 of file TrigJetHypoToolHelperNoGrouper.cxx.

17 :
18 base_class(type, name, parent){
19}

Member Function Documentation

◆ getDescription()

StatusCode TrigJetHypoToolHelperNoGrouper::getDescription ( ITrigJetHypoInfoCollector & c) const
overridevirtual

Definition at line 123 of file TrigJetHypoToolHelperNoGrouper.cxx.

123 {
124 c.collect(name(), toString());
125 return StatusCode::SUCCESS;
126}
virtual std::string toString() const override

◆ initialize()

StatusCode TrigJetHypoToolHelperNoGrouper::initialize ( )
override

Definition at line 21 of file TrigJetHypoToolHelperNoGrouper.cxx.

21 {
22
23 for (const auto& config : m_configs) {
24 auto matcher = config->getMatcher();
25 if (!matcher->valid()) {
26 ATH_MSG_ERROR(matcher->msg());
27 return StatusCode::FAILURE;
28 }
29
30 m_matchers.push_back(std::move(matcher));
31 }
32
33 return StatusCode::SUCCESS;
34}
#define ATH_MSG_ERROR(x)
std::vector< std::unique_ptr< IJetsMatcher > > m_matchers
ToolHandleArray< ITrigJetHypoToolNoGrouperConfig > m_configs

◆ pass()

bool TrigJetHypoToolHelperNoGrouper::pass ( HypoJetVector & jetsIn,
xAODJetCollector & jetCollector,
const std::unique_ptr< ITrigJetHypoInfoCollector > & collector ) const
overridevirtual

Definition at line 37 of file TrigJetHypoToolHelperNoGrouper.cxx.

39 {
40
41 if(collector){
42 std::stringstream ss;
43 ss << "No of jets " + std::to_string(jetsIn.size()) + '\n';
44 ss << jetsIn;
45 collector->collect(name(), ss.str());
46 }
47
48 if(jetsIn.empty()){
49 if (collector){
50 collector->collect(name(), "empty input jet collection");
51 }
52 bool pass = false;
53 return pass;
54 }
55
56 // prefilters are now local variables
57 std::vector<FilterPtr> prefilters{};
58 prefilters.reserve(m_prefilterMakers.size());
59 for (const auto& pf_maker : m_prefilterMakers){
60 prefilters.push_back(pf_maker->getHypoJetVectorFilter());
61 }
62
63 auto hjv = jetsIn;
64 for (const auto& pf : prefilters) {
65 hjv = pf->filter(hjv, collector);
66 }
67
68 // see if matchers pass. Each matcher conatains a FastReducer tree.
69 // if > matcher, this means the conditions of different trees may
70 // share jets.
71 bool pass = true;
72 for (const auto& matcher : m_matchers){
73 auto matcher_pass = matcher->match(hjv,
74 jetCollector,
75 collector);
76 if (!matcher_pass.has_value()) {
77 ATH_MSG_ERROR("Matcher cannot determine result. Config error?");
78 return false;
79 }
80
81 if (!(*matcher_pass)){
82 pass = false;
83 break;
84 }
85 }
86
87 return pass;
88}
static Double_t ss
virtual void collect(const std::string &, const std::string &)=0
virtual bool pass(HypoJetVector &, xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
ToolHandleArray< ITrigHypoJetVectorFilterConfig > m_prefilterMakers

◆ requiresNJets()

std::size_t TrigJetHypoToolHelperNoGrouper::requiresNJets ( ) const
overridevirtual

Definition at line 129 of file TrigJetHypoToolHelperNoGrouper.cxx.

129 {
130 return m_configs[0]->requiresNJets();
131}

◆ toString()

std::string TrigJetHypoToolHelperNoGrouper::toString ( ) const
overrideprivatevirtual

Definition at line 90 of file TrigJetHypoToolHelperNoGrouper.cxx.

90 {
91
92 std::stringstream ss;
93 ss << name();
94
95
96
97 std::vector<FilterPtr> prefilters{};
98 prefilters.reserve(m_prefilterMakers.size());
99 for (const auto& pf_maker : m_prefilterMakers){
100 prefilters.push_back(pf_maker->getHypoJetVectorFilter());
101 }
102
103
104 ss << "prefilters: [" << prefilters.size() << "]:\n";
105 for (const auto& pf : prefilters){
106 ss << '\n'<< *pf;
107 }
108
109 ss << '\n';
110
111 ss << "\nMatchers [" << m_matchers.size() << "]:\n\n";
112 unsigned int imatcher{0};
113 for (const auto & matcher : m_matchers) {
114 ss << "matcher " << imatcher++ << '\n';
115 ss << matcher -> toString();
116 }
117
118 return ss.str();
119}

Member Data Documentation

◆ m_configs

ToolHandleArray<ITrigJetHypoToolNoGrouperConfig> TrigJetHypoToolHelperNoGrouper::m_configs
private
Initial value:
{
this, "HypoConfigurers", {},
"Configurers to set up TrigJetHypoHelperNoGrouper"}

Definition at line 65 of file TrigJetHypoToolHelperNoGrouper.h.

65 {
66 this, "HypoConfigurers", {},
67 "Configurers to set up TrigJetHypoHelperNoGrouper"};

◆ m_debug

Gaudi::Property<bool> TrigJetHypoToolHelperNoGrouper::m_debug {this, "debug", false, "instantantiate helpers with this debug flag"}
private

Definition at line 74 of file TrigJetHypoToolHelperNoGrouper.h.

74{this, "debug", false, "instantantiate helpers with this debug flag"};

◆ m_matchers

std::vector<std::unique_ptr<IJetsMatcher> > TrigJetHypoToolHelperNoGrouper::m_matchers
private

Definition at line 59 of file TrigJetHypoToolHelperNoGrouper.h.

◆ m_prefilterMakers

ToolHandleArray<ITrigHypoJetVectorFilterConfig> TrigJetHypoToolHelperNoGrouper::m_prefilterMakers
private
Initial value:
{this, "prefilterMakers", {},
"configuration tool to create prefilter"}

Definition at line 70 of file TrigJetHypoToolHelperNoGrouper.h.

70 {this, "prefilterMakers", {},
71 "configuration tool to create prefilter"};

The documentation for this class was generated from the following files: