|
ATLAS Offline Software
|
#include <FastReducer.h>
|
bool | findInitialJetGroups (const HypoJetVector &jv, const Collector &collector) |
| set up the data structures for propagation. More...
|
|
bool | propagateJetGroups (const Collector &collector) |
|
bool | propagate_ (std::size_t child, const std::vector< std::size_t > &siblings, const Collector &) |
|
std::string | dataStructuresToStr () const |
|
void | dumpDataStructures (const Collector &) const |
|
void | recordJetGroup (std::size_t ind, const HypoJetVector &jg, const Collector &collector) const |
|
void | recordFiltering (std::size_t leaf_ind, std::size_t n_inputjets, int n_filteredjets, const Collector &collector) const |
|
void | collectLeafJets (xAODJetCollector &jetCollector, const Collector &collector) const |
|
bool | capacitySatisfied (std::size_t ind, const Collector &collector) const |
|
Definition at line 35 of file FastReducer.h.
◆ FastReducer()
Definition at line 41 of file FastReducer.cxx.
65 collector->collect(
"FastReducer early return",
66 "from findInitialJetGroups");
76 collector->collect(
"FastReducer early return",
77 "from propagateJetGroups");
85 collector->collect(
"FastReducer returning",
86 "from propagateJetGroups");
◆ capacitySatisfied()
bool FastReducer::capacitySatisfied |
( |
std::size_t |
ind, |
|
|
const Collector & |
collector |
|
) |
| const |
|
private |
Definition at line 555 of file FastReducer.cxx.
562 auto capSat =
m_conditions.at(
ind)->multiplicitySatisfied(jgMult, collector);
563 if (!capSat and collector) {
565 +
" unsatisfied multiplicity, aborting");
◆ collectLeafJets()
jets by indices
Definition at line 94 of file FastReducer.cxx.
104 std::set<std::size_t> rootSatJetGroupInds(
m_satisfiedBy.at(0).begin(),
109 std::set<std::size_t> rootElSatJetGroupInds;
110 for (
const auto& ji : rootSatJetGroupInds) {
111 rootElSatJetGroupInds.insert(
m_jg2elemjgs.at(ji).begin(),
122 for (
const auto& ci : leaves) {
123 std::set<std::size_t> satJetGroupInds;
130 std::set<std::size_t> elSatJetGroupInds;
131 for (
const auto& ji : satJetGroupInds) {
140 std::stringstream
ss;
141 ss <<
"elSatJettGroupInds.size() "
144 << elSatJetGroupInds.size();
145 collector->collect(
"FastReducer",
ss.str());
154 auto end = rootElSatJetGroupInds.end();
155 for(
const auto& ji : elSatJetGroupInds) {
157 if (rootElSatJetGroupInds.find(ji) !=
end){
165 collector->collect(
"FastReducer",
◆ dataStructuresToStr()
std::string FastReducer::dataStructuresToStr |
( |
| ) |
const |
|
private |
Definition at line 463 of file FastReducer.cxx.
465 std::stringstream
ss;
466 ss <<
"FastReducer data structure dumps\nindToJetGroup:\n";
468 ss << pair.first <<
" [";
469 for(
const auto& j : pair.second){
470 ss << static_cast<const void*>(j.get()) <<
" ";
475 ss <<
"satisfiedBy: \n";
477 ss << pair.first <<
" [";
478 for(
const auto&
i : pair.second){
485 ss <<
"testedBy: \n";
487 ss << pair.first <<
" [";
488 for(
const auto&
i : pair.second){
494 ss <<
"jg to elemental jgs: \n";
497 ss << pair.first <<
" [";
498 for(
const auto&
i : pair.second){
◆ dumpDataStructures()
void FastReducer::dumpDataStructures |
( |
const Collector & |
collector | ) |
const |
|
private |
Definition at line 508 of file FastReducer.cxx.
510 if(!collector){
return;}
512 collector->collect(
"FastReducer",
◆ findInitialJetGroups()
set up the data structures for propagation.
Propagation is the act of combining jet groups satisfying children in preparration for testing against parent conditions.
Definition at line 171 of file FastReducer.cxx.
184 for(
const auto& leaf: leaves){
186 auto filtered_jets = jv;
188 if (filter_ind != -1) {
190 filtered_jets =
filter->filter(filtered_jets, collector);
193 auto iters = std::make_pair(filtered_jets.begin(),
194 filtered_jets.end());
203 auto jg = grouper->next();
204 if (jg.empty()) {
break;}
227 std::vector<std::size_t>& elem_indices =
m_jg2elemjgs[jg_ind];
228 if (elem_indices.empty()) {
230 elem_indices.reserve(jg.size());
231 for (
const auto& hj : jg){
234 auto single_jet_group = std::vector{hj};
236 auto& single_jet_elems =
m_jg2elemjgs[single_jet_index];
237 if (single_jet_elems.empty()) {
238 single_jet_elems.push_back(single_jet_index);
243 elem_indices.push_back(single_jet_index);
248 elem_indices.push_back(jg_ind);
265 for (
const auto&
i : leaves) {
◆ pass()
bool FastReducer::pass |
( |
| ) |
const |
determine whether a set of jets satisfies all hypo conditions.
if pass, return a vector of jets that passes the Conditions.
Definition at line 552 of file FastReducer.cxx.
◆ propagate_()
bool FastReducer::propagate_ |
( |
std::size_t |
child, |
|
|
const std::vector< std::size_t > & |
siblings, |
|
|
const Collector & |
collector |
|
) |
| |
|
private |
Definition at line 346 of file FastReducer.cxx.
362 if(child == 0){
return true;}
381 auto jg_indices = jg_product->next(collector);
387 while (!jg_indices.empty()){
388 if (!std::is_sorted(jg_indices.begin(), jg_indices.end())) {
389 throw std::runtime_error(
"Jet hypo unsorted jet group");
392 for (
const auto&
ind : jg_indices) {
394 throw std::runtime_error(
"Jet hypo jet group with non-elementary index");
401 for(
const auto&
i : jg_indices){
403 jg.insert(jg.end(), jetGroup.begin(), jetGroup.end());
411 jg_indices = jg_product->next(collector);
427 jg_indices = jg_product->next(collector);
434 if(collector and !par_satisfied){
435 collector->collect(
"FastReducer",
440 return par_satisfied;
◆ propagateJetGroups()
Definition at line 276 of file FastReducer.cxx.
288 typedef std::priority_queue<std::size_t,
289 std::vector<std::size_t>,
293 DepthQueue to_process(comparator);
300 if(!(
item.second.empty())){
301 to_process.push(
item.first);
305 while(!to_process.empty()){
307 auto k = to_process.top();
318 collector->collect(
"FastReducer",
319 "Condition node 0 fails");
328 for(
const auto&
s : siblings){
340 to_process.push(
par);
◆ recordFiltering()
void FastReducer::recordFiltering |
( |
std::size_t |
leaf_ind, |
|
|
std::size_t |
n_inputjets, |
|
|
int |
n_filteredjets, |
|
|
const Collector & |
collector |
|
) |
| const |
|
private |
Definition at line 536 of file FastReducer.cxx.
541 if(!collector) {
return;}
543 std::stringstream ss0;
544 ss0 <<
"FastReducer filtering Condition index: " << leaf_ind;
546 std::stringstream ss1;
547 ss1 <<
"n jets. in: " << n_injets <<
" filtered: " << n_filteredjets <<
'\n';
549 collector->collect(ss0.str(), ss1.str());
◆ recordJetGroup()
Definition at line 517 of file FastReducer.cxx.
521 std::stringstream ss0;
522 ss0 <<
"FastReducer jet group "
523 <<
ind <<
" [" << jg.size() <<
"]:";
525 std::stringstream ss1;
527 const void*
address =
static_cast<const void*
>(
ip.get());
528 ss1 <<
"\n " <<
address <<
" eta " <<
ip->eta()
530 <<
" et " <<
ip->et();
533 collector->collect(ss0.str(), ss1.str());
◆ toString()
std::string FastReducer::toString |
( |
| ) |
const |
Definition at line 445 of file FastReducer.cxx.
446 std::stringstream
ss;
447 ss <<
"FastReducer:\n";
448 ss <<
" treeVector: " <<
m_tree <<
'\n';;
449 ss <<
"FastReducer Conditions ["
455 sc.insert(
sc.begin(), 3-
sc.length(),
' ');
456 ss <<
sc <<
": "<<
c->toString() +
'\n';
◆ m_conditionCap
std::vector<unsigned int> FastReducer::m_conditionCap |
|
private |
◆ m_conditionClique
std::vector<int> FastReducer::m_conditionClique |
|
private |
◆ m_conditionFilterInds
◆ m_conditionFilters
◆ m_conditionMult
std::vector<std::size_t> FastReducer::m_conditionMult |
|
private |
◆ m_conditions
◆ m_indJetGroup
map jet group indices to jet groups
Definition at line 84 of file FastReducer.h.
◆ m_jg2elemjgs
map jet group indices to indices of incoming jet groups
Definition at line 87 of file FastReducer.h.
◆ m_jgRegister
◆ m_pass
bool FastReducer::m_pass {false} |
|
private |
◆ m_passingJets
◆ m_satisfiedBy
◆ m_testedBy
std::map<std::size_t, std::set<std::size_t> > FastReducer::m_testedBy |
|
private |
map Condition index onto a set of indices the condition has been tested with - used to prevent retesting and reduce combinations
Definition at line 81 of file FastReducer.h.
◆ m_tree
tree structure for Conditions objects.
The conditions tree gives relations among conditions (eg parent-child and siblings-of)
Definition at line 72 of file FastReducer.h.
The documentation for this class was generated from the following files:
bool capacitySatisfied(std::size_t ind, const Collector &collector) const
std::string find(const std::string &s)
return a remapped string
void dumpDataStructures(const Collector &) const
std::vector< std::size_t > siblings(std::size_t) const
std::vector< std::size_t > m_conditionMult
std::unique_ptr< IJetGrouper > grouperByCapacityFactory(unsigned int cap, const HypoJetCIter &b, const HypoJetCIter &e)
void recordFiltering(std::size_t leaf_ind, std::size_t n_inputjets, int n_filteredjets, const Collector &collector) const
std::map< std::size_t, HypoJetVector > m_indJetGroup
map jet group indices to jet groups
CondInd2JetGroupsInds m_satisfiedBy
bool findInitialJetGroups(const HypoJetVector &jv, const Collector &collector)
set up the data structures for propagation.
const ConditionFilters & m_conditionFilters
@ u
Enums for curvilinear frames.
std::map< std::size_t, std::set< std::size_t > > m_testedBy
map Condition index onto a set of indices the condition has been tested with - used to prevent retest...
void addJets(const HypoJetCIter &begin, const HypoJetCIter &end, int chainPartInd=-1)
JetGroupRegister m_jgRegister
void recordJetGroup(std::size_t ind, const HypoJetVector &jg, const Collector &collector) const
bool propagateJetGroups(const Collector &collector)
JetGroupInd2ElemInds m_jg2elemjgs
map jet group indices to indices of incoming jet groups
std::unique_ptr< IJetGroupProduct > makeJetGroupProduct(const std::vector< std::size_t > &siblings, const CondInd2JetGroupsInds &satisfiedBy, const std::vector< std::size_t > &condMult, const std::vector< unsigned int > &condCap, const std::vector< int > &condClique, const JetGroupInd2ElemInds &jg2elemjgs, std::size_t parentCap, bool simpleTree, const Collector &)
bool m_pass
event pass flag
std::vector< pHypoJet > HypoJetVector
ConditionFilterInds m_conditionFilterInds
Tree m_tree
tree structure for Conditions objects.
std::vector< int > m_conditionClique
bool propagate_(std::size_t child, const std::vector< std::size_t > &siblings, const Collector &)
std::size_t parent(std::size_t) const
std::string dataStructuresToStr() const
std::string to_string(const DetectorType &type)
std::vector< unsigned int > m_conditionCap
std::size_t record(HypoJetVector v)
void collectLeafJets(xAODJetCollector &jetCollector, const Collector &collector) const
const ConditionPtrs & m_conditions
const std::vector< std::size_t > & leaves() const