ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
FastReductionMatcher Class Reference

#include <FastReductionMatcher.h>

Inheritance diagram for FastReductionMatcher:
Collaboration diagram for FastReductionMatcher:

Public Member Functions

 FastReductionMatcher (ConditionPtrs &, ConditionFilters &, const ConditionFilterInds &, const Tree &)
 
virtual std::optional< bool > match (const HypoJetVector &jv, xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &collector, bool) const override
 determine whether a set of jets satisfies all hypo conditions. More...
 
std::string toString () const override
 
virtual bool valid () const override
 
virtual std::string msg () const override
 

Private Attributes

ConditionPtrs m_conditions
 
ConditionFilters m_conditionFilters
 
ConditionFilterInds m_conditionFilterInds
 
Tree m_tree
 tree structure for Conditions objects. More...
 
long unsigned int m_minNjets {0u}
 
bool m_validState {true}
 
std::string m_msg
 

Detailed Description

Definition at line 23 of file FastReductionMatcher.h.

Constructor & Destructor Documentation

◆ FastReductionMatcher()

FastReductionMatcher::FastReductionMatcher ( ConditionPtrs conditions,
ConditionFilters filters,
const ConditionFilterInds filterInds,
const Tree tree 
)

Definition at line 13 of file FastReductionMatcher.cxx.

16  :
17  m_conditions(std::move(conditions)),
18  m_conditionFilters(std::move(filters)),
19  m_conditionFilterInds(filterInds),
20  m_tree(tree){
21 
22  if (m_conditions[0]->capacity() != 0 or
23  m_conditions[0]-> multiplicity() != 1) {
24  m_validState= false;
25  m_msg = "Condition tree root node is not AcceptAll";
26  }
27 
28  int minNjets{0};
29  for (const auto& il : m_tree.leaves()){
30  const auto& condition = m_conditions[il];
31 
32  if (!condition->isFromChainPart()) {
33  m_validState = false;
34  m_msg = "Tree leaf condition but not from ChainPart";
35  }
36  minNjets += condition->capacity() * condition->multiplicity();
37 
38  }
39 
40  m_minNjets = std::max(1, minNjets);
41 
42  if (filterInds.size() != m_conditions.size()) {
43  m_validState = false;
44  std::stringstream ss;
45  ss << "ConditionFilterInds and Conditions sequence sizes differ: ";
46  ss << filterInds.size() << " " << m_conditions.size();
47  m_msg = ss.str();
48  }
49 
50 }

Member Function Documentation

◆ match()

std::optional< bool > FastReductionMatcher::match ( const HypoJetVector jv,
xAODJetCollector jetCollector,
const std::unique_ptr< ITrigJetHypoInfoCollector > &  collector,
bool   
) const
overridevirtual

determine whether a set of jets satisfies all hypo conditions.

the jets are packed into jet grpups of length 1. groups_b and groups_e are iterators into the data structure containing these groups. Jet collector is used to transport the jets that matched the hypo conditions. Collector collects information for testing and debugging the final bool argument is used to allow further debugging within the method.

Implements IJetsMatcher.

Definition at line 54 of file FastReductionMatcher.cxx.

57  {
58  /*
59  Decide if the incomming jet groups satisfiy all the conditions of the
60  condition tree.
61 
62  The leaf nodes are tested first. Jet groups satisfyng the leaves
63  stored in a table. Once all leaves have been processed, the satisfying
64  groups are combined, and tested against the aprent nodes.
65 
66  The procedure is iterated until the entire tree is checked, or
67  an unsatisfied condition is found. If no unsatisfied condition,
68  there is a match.
69  */
70 
71  auto njets = jv.size();
72 
73  if (njets < m_minNjets) {
74  if (collector) {
75  collector->collect("FastReductionMatcher",
76  "have " + std::to_string(njets) +
77  " jets need " + std::to_string(m_minNjets) +
78  " pass: false");
79  }
80  return false;
81  }
82 
83  FastReducer reducer(jv,
87  m_tree,
88  jetCollector,
89  collector);
90 
91  return std::make_optional<bool>(reducer.pass());
92 }

◆ msg()

std::string FastReductionMatcher::msg ( ) const
overridevirtual

Implements IJetsMatcher.

Definition at line 139 of file FastReductionMatcher.cxx.

139 {return m_msg;}

◆ toString()

std::string FastReductionMatcher::toString ( ) const
overridevirtual

Implements IJetsMatcher.

Definition at line 95 of file FastReductionMatcher.cxx.

95  {
96  std::stringstream ss;
97  ss << "FastReductionMatcher:\n"
98  << " treeVector: " << m_tree << '\n'
99  << " min required jets " << m_minNjets << "\n\n"
100  << "FastReductionMatcher Conditions ["
101  << m_conditions.size() << "]: \n\n";
102 
103  std::size_t count{0u};
104  for(const auto& c : m_conditions){
105  auto sc = std::to_string(count++);
106  sc.insert(sc.begin(), 3-sc.length(), ' ');
107  ss << sc <<": "<< c->toString() + '\n';
108  }
109 
110 
111  ss << "FastReductionMatcher ConditionFilter indices ["
112  << m_conditionFilterInds.size() << "]: \n";
113 
114 
115  count = 0;
116  for(const auto& c : m_conditionFilterInds){
117  auto sc = std::to_string(count++);
118  sc.insert(sc.begin(), 3-sc.length(), ' ');
119  ss << sc <<": "<< c << '\n';
120  }
121 
122 
123  ss << "FastReductionMatcher ConditionFilters ["
124  << m_conditionFilters.size() << "]: \n";
125 
126 
127  count = 0;
128  for(const auto& c : m_conditionFilters){
129  auto sc = std::to_string(count++);
130  sc.insert(sc.begin(), 3-sc.length(), ' ');
131  ss << sc <<": "<< c->toString() + '\n';
132  }
133 
134 
135  return ss.str();
136 }

◆ valid()

bool FastReductionMatcher::valid ( ) const
overridevirtual

Implements IJetsMatcher.

Definition at line 138 of file FastReductionMatcher.cxx.

138 {return m_validState;}

Member Data Documentation

◆ m_conditionFilterInds

ConditionFilterInds FastReductionMatcher::m_conditionFilterInds
private

Definition at line 59 of file FastReductionMatcher.h.

◆ m_conditionFilters

ConditionFilters FastReductionMatcher::m_conditionFilters
private

Definition at line 58 of file FastReductionMatcher.h.

◆ m_conditions

ConditionPtrs FastReductionMatcher::m_conditions
private

Definition at line 57 of file FastReductionMatcher.h.

◆ m_minNjets

long unsigned int FastReductionMatcher::m_minNjets {0u}
private

Definition at line 70 of file FastReductionMatcher.h.

◆ m_msg

std::string FastReductionMatcher::m_msg
private

Definition at line 74 of file FastReductionMatcher.h.

◆ m_tree

Tree FastReductionMatcher::m_tree
private

tree structure for Conditions objects.

The conditions tree gives relations among conditions (eg parent-child and siblings-of)

Definition at line 66 of file FastReductionMatcher.h.

◆ m_validState

bool FastReductionMatcher::m_validState {true}
private

Definition at line 73 of file FastReductionMatcher.h.


The documentation for this class was generated from the following files:
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
max
#define max(a, b)
Definition: cfImp.cxx:41
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
FastReductionMatcher::m_conditionFilterInds
ConditionFilterInds m_conditionFilterInds
Definition: FastReductionMatcher.h:59
tree
TChain * tree
Definition: tile_monitor.h:30
FastReductionMatcher::m_tree
Tree m_tree
tree structure for Conditions objects.
Definition: FastReductionMatcher.h:66
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
FastReducer
Definition: FastReducer.h:35
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
FastReductionMatcher::m_minNjets
long unsigned int m_minNjets
Definition: FastReductionMatcher.h:70
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
FastReductionMatcher::m_conditionFilters
ConditionFilters m_conditionFilters
Definition: FastReductionMatcher.h:58
FastReductionMatcher::m_msg
std::string m_msg
Definition: FastReductionMatcher.h:74
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
FastReductionMatcher::m_conditions
ConditionPtrs m_conditions
Definition: FastReductionMatcher.h:57
FastReductionMatcher::m_validState
bool m_validState
Definition: FastReductionMatcher.h:73
python.compressB64.c
def c
Definition: compressB64.py:93
Tree::leaves
const std::vector< std::size_t > & leaves() const
Definition: Tree.cxx:48