ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 }

◆ 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 }

◆ 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 }

◆ 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.

◆ 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.

◆ 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.


The documentation for this class was generated from the following files:
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
TrigJetHypoToolHelperNoGrouper::toString
virtual std::string toString() const override
Definition: TrigJetHypoToolHelperNoGrouper.cxx:90
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TrigJetHypoToolHelperNoGrouper::m_matchers
std::vector< std::unique_ptr< IJetsMatcher > > m_matchers
Definition: TrigJetHypoToolHelperNoGrouper.h:59
python.output.AtlRunQueryRoot.pf
pf
Definition: AtlRunQueryRoot.py:988
TrigJetHypoToolHelperNoGrouper::m_configs
ToolHandleArray< ITrigJetHypoToolNoGrouperConfig > m_configs
Definition: TrigJetHypoToolHelperNoGrouper.h:65
TrigJetHypoToolHelperNoGrouper::m_prefilterMakers
ToolHandleArray< ITrigHypoJetVectorFilterConfig > m_prefilterMakers
Definition: TrigJetHypoToolHelperNoGrouper.h:70
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigJetHypoToolHelperNoGrouper::pass
virtual bool pass(HypoJetVector &, xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: TrigJetHypoToolHelperNoGrouper.cxx:37
python.compressB64.c
def c
Definition: compressB64.py:93