ATLAS Offline Software
Loading...
Searching...
No Matches
ConvProxy Struct Reference

#include <Run2ToRun3TrigNavConverterV2.h>

Collaboration diagram for ConvProxy:

Public Member Functions

 ConvProxy (const HLT::TriggerElement *te)
bool isChild (const ConvProxy *other) const
bool isParent (const ConvProxy *other) const
bool mergeAllowed (const ConvProxy *other) const
void merge (ConvProxy *other)
std::string description () const

Public Attributes

const HLT::TriggerElementte = nullptr
std::vector< HLT::te_id_typeteIDs
std::set< ConvProxy * > children
std::set< ConvProxy * > parents
std::set< HLT::IdentifierrunChains
std::set< HLT::IdentifierpassChains
uint64_t feaHash = MissingFEA
std::vector< HLT::TriggerElement::FeatureAccessHelperfeatures
std::vector< HLT::TriggerElement::FeatureAccessHelperrois
std::vector< HLT::TriggerElement::FeatureAccessHelpertracks
TrigCompositeUtils::Decisionl1Node {nullptr}
TrigCompositeUtils::DecisionimNode {nullptr}
std::vector< TrigCompositeUtils::Decision * > hNode

Static Public Attributes

static const uint64_t MissingFEA = 0

Detailed Description

Definition at line 34 of file Run2ToRun3TrigNavConverterV2.h.

Constructor & Destructor Documentation

◆ ConvProxy()

ConvProxy::ConvProxy ( const HLT::TriggerElement * te)

Definition at line 23 of file Run2ToRun3TrigNavConverterV2.cxx.

23 : te{t}
24{
25 teIDs.push_back(te->getId());
26}
std::vector< HLT::te_id_type > teIDs
const HLT::TriggerElement * te

Member Function Documentation

◆ description()

std::string ConvProxy::description ( ) const

Definition at line 131 of file Run2ToRun3TrigNavConverterV2.cxx.

132{
133 std::string ret;
134 ret += " N parents: " + std::to_string(parents.size());
135 ret += " N children: " + std::to_string(children.size());
136 std::ostringstream os;
137 for ( auto c: children )
138 os << c << " ";
139 ret += " ptrs: " + os.str();
140 ret += " feaHash: " + std::to_string(feaHash);
141 ret += " N run chains: " + std::to_string(runChains.size());
142 return ret;
143}
std::set< ConvProxy * > children
std::set< HLT::Identifier > runChains
std::set< ConvProxy * > parents

◆ isChild()

bool ConvProxy::isChild ( const ConvProxy * other) const

Definition at line 29 of file Run2ToRun3TrigNavConverterV2.cxx.

29 {
30 for ( auto c: children ) {
31 if (other == c)
32 return true;
33 if ( c->isChild(other) )
34 return true;
35 }
36 return false;
37}

◆ isParent()

bool ConvProxy::isParent ( const ConvProxy * other) const

Definition at line 39 of file Run2ToRun3TrigNavConverterV2.cxx.

39 {
40 for ( auto c: parents ) {
41 if (other == c)
42 return true;
43 if ( c->isParent(other) )
44 return true;
45 }
46 return false;
47}

◆ merge()

void ConvProxy::merge ( ConvProxy * other)

Definition at line 62 of file Run2ToRun3TrigNavConverterV2.cxx.

63{
64 if (other == this)
65 {
66 return;
67 }
68 // copy over chains
69 runChains.insert(other->runChains.begin(), other->runChains.end());
70 passChains.insert(other->passChains.begin(), other->passChains.end());
71 teIDs.push_back(other->te->getId());
72 /* the intention of the code below is following.
73 Intial structure like is like this (the line is always bidirectional):
74 P1 P2 P3 <- parents
75 | | /
76 T1 T2 <- "this" and "other"
77 | |
78 C1 C2 <- children
79 1) Lets assume that the first proxies we treat are B1 & B2 ath they are mergable. The resulting structure should look like this:
80 P1 P2 P3
81 |/__/
82 T1 T2
83 |\
84 C1 C2
85
86 */
87 auto add = [](ConvProxy *toadd, std::set<ConvProxy *> &coll)
88 {
89 if (std::find(coll.begin(), coll.end(), toadd) == coll.end())
90 {
91 coll.insert(toadd);
92 }
93 };
94
95 auto remove = [](ConvProxy *torem, std::set<ConvProxy *> &coll)
96 {
97 auto place = std::find(coll.begin(), coll.end(), torem);
98 if (place != coll.end())
99 {
100 coll.erase(place);
101 }
102 };
103
104 // this is T <-> C connection
105 for (auto otherChild : other->children)
106 {
107 add(otherChild, children);
108 add(this, otherChild->parents);
109 }
110 // this is T <-> P connection rewiring
111 for (auto otherParent : other->parents)
112 {
113 add(otherParent, parents);
114 add(this, otherParent->children);
115 }
116
117 // now need to remove links back to the "other"
118 for (auto otherParent : other->parents)
119 {
120 remove(other, otherParent->children);
121 }
122
123 for (auto otherChild : other->children)
124 {
125 remove(other, otherChild->parents);
126 }
127 other->children.clear();
128 other->parents.clear();
129}
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
std::set< HLT::Identifier > passChains
ConvProxy(const HLT::TriggerElement *te)

◆ mergeAllowed()

bool ConvProxy::mergeAllowed ( const ConvProxy * other) const

Definition at line 50 of file Run2ToRun3TrigNavConverterV2.cxx.

51{
52 if (this == other)
53 return false; // no merging with self
54 // never merge children with parents
55 if ( isChild(other) )
56 return false;
57 if ( isParent(other) )
58 return false;
59 return true;
60}
bool isParent(const ConvProxy *other) const
bool isChild(const ConvProxy *other) const

Member Data Documentation

◆ children

std::set<ConvProxy *> ConvProxy::children

Definition at line 44 of file Run2ToRun3TrigNavConverterV2.h.

◆ feaHash

uint64_t ConvProxy::feaHash = MissingFEA

Definition at line 49 of file Run2ToRun3TrigNavConverterV2.h.

◆ features

std::vector<HLT::TriggerElement::FeatureAccessHelper> ConvProxy::features

Definition at line 51 of file Run2ToRun3TrigNavConverterV2.h.

◆ hNode

std::vector<TrigCompositeUtils::Decision *> ConvProxy::hNode

Definition at line 57 of file Run2ToRun3TrigNavConverterV2.h.

◆ imNode

TrigCompositeUtils::Decision* ConvProxy::imNode {nullptr}

Definition at line 56 of file Run2ToRun3TrigNavConverterV2.h.

56{nullptr};

◆ l1Node

TrigCompositeUtils::Decision* ConvProxy::l1Node {nullptr}

Definition at line 55 of file Run2ToRun3TrigNavConverterV2.h.

55{nullptr};

◆ MissingFEA

const uint64_t ConvProxy::MissingFEA = 0
static

Definition at line 48 of file Run2ToRun3TrigNavConverterV2.h.

◆ parents

std::set<ConvProxy *> ConvProxy::parents

Definition at line 45 of file Run2ToRun3TrigNavConverterV2.h.

◆ passChains

std::set<HLT::Identifier> ConvProxy::passChains

Definition at line 47 of file Run2ToRun3TrigNavConverterV2.h.

◆ rois

std::vector<HLT::TriggerElement::FeatureAccessHelper> ConvProxy::rois

Definition at line 52 of file Run2ToRun3TrigNavConverterV2.h.

◆ runChains

std::set<HLT::Identifier> ConvProxy::runChains

Definition at line 46 of file Run2ToRun3TrigNavConverterV2.h.

◆ te

const HLT::TriggerElement* ConvProxy::te = nullptr

Definition at line 41 of file Run2ToRun3TrigNavConverterV2.h.

◆ teIDs

std::vector<HLT::te_id_type> ConvProxy::teIDs

Definition at line 42 of file Run2ToRun3TrigNavConverterV2.h.

◆ tracks

std::vector<HLT::TriggerElement::FeatureAccessHelper> ConvProxy::tracks

Definition at line 53 of file Run2ToRun3TrigNavConverterV2.h.


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