ATLAS Offline Software
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
TrigCompositeUtils::NavGraphNode Class Reference

Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_filteredSeeds) to other nodes which are parents of this node. More...

#include <NavGraph.h>

Collaboration diagram for TrigCompositeUtils::NavGraphNode:

Public Member Functions

 NavGraphNode (const Decision *me)
 Construct a NavGraphNode shadowing a node in the full xAOD navigation graph. More...
 
 ~NavGraphNode ()=default
 Destruct a NavGraphNode, default. More...
 
 NavGraphNode (const NavGraphNode &obj)=delete
 Prevent copies of a NavGraphNode. More...
 
 NavGraphNode (NavGraphNode &&obj)=delete
 Prevent move of a NavGraphNode. More...
 
bool linksTo (NavGraphNode *to)
 Form an edge in the graph from this node to another one. More...
 
void dropLinks (NavGraphNode *node)
 Forget about any graph edges to the supplied node. More...
 
void keep ()
 Flag this node as one to keep when the thin() operation is performed. More...
 
void resetKeep ()
 Reset the keep flag to false upon finishing thinning. More...
 
bool getKeep () const
 
const Decisionnode () const
 Return a const pointer to the Decision object node which this NavGraphNode is shadowing. More...
 
const std::vector< NavGraphNode * > & seeds () const
 Return a vector of const pointers to the Decision object nodes which this NavGraphNode seeds from. More...
 
const std::vector< NavGraphNode * > & children () const
 Return a vector of const pointers to the Decision object nodes which are the children of this NavGraphNode. More...
 

Static Private Member Functions

static bool addIfNotDuplicate (std::vector< NavGraphNode * > &container, NavGraphNode *toAdd)
 Internal helper function. More...
 

Private Attributes

const Decisionm_decisionObject
 The Decision object node which I shadow. More...
 
std::vector< NavGraphNode * > m_filteredSeeds
 My seeds (edges in the graph), filtered on per-chain requirements. More...
 
std::vector< NavGraphNode * > m_filteredChildren
 Two-way linking information, used when thinning the graph. More...
 
bool m_keepFlag
 Keep this node when slimming the NavGraph. More...
 

Detailed Description

Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_filteredSeeds) to other nodes which are parents of this node.

Definition at line 20 of file NavGraph.h.

Constructor & Destructor Documentation

◆ NavGraphNode() [1/3]

TrigCompositeUtils::NavGraphNode::NavGraphNode ( const Decision me)

Construct a NavGraphNode shadowing a node in the full xAOD navigation graph.

Parameters
[in]meThe Decision object node from the full xAOD navigation graph which this object is representing.

Definition at line 15 of file NavGraph.cxx.

15  : m_decisionObject(me),
17  {
18  }

◆ ~NavGraphNode()

TrigCompositeUtils::NavGraphNode::~NavGraphNode ( )
default

Destruct a NavGraphNode, default.

◆ NavGraphNode() [2/3]

TrigCompositeUtils::NavGraphNode::NavGraphNode ( const NavGraphNode obj)
delete

Prevent copies of a NavGraphNode.

◆ NavGraphNode() [3/3]

TrigCompositeUtils::NavGraphNode::NavGraphNode ( NavGraphNode &&  obj)
delete

Prevent move of a NavGraphNode.

Member Function Documentation

◆ addIfNotDuplicate()

bool TrigCompositeUtils::NavGraphNode::addIfNotDuplicate ( std::vector< NavGraphNode * > &  container,
NavGraphNode toAdd 
)
staticprivate

Internal helper function.

Using a vector to preserve pointer ordering, but want the de-duplication behavior of a vector.

Returns
true if toAdd was added, false if it was already contained in the vector.

Definition at line 20 of file NavGraph.cxx.

20  {
21  std::vector<NavGraphNode*>::iterator it = std::find(container.begin(), container.end(), toAdd);
22  if (it == container.end()) {
23  container.push_back(toAdd);
24  return true;
25  }
26  return false;
27  }

◆ children()

const std::vector< NavGraphNode * > & TrigCompositeUtils::NavGraphNode::children ( ) const

Return a vector of const pointers to the Decision object nodes which are the children of this NavGraphNode.

Note: The m_decisionObject does not provide such forward-exploring capability.

Definition at line 51 of file NavGraph.cxx.

51  {
52  return m_filteredChildren;
53  }

◆ dropLinks()

void TrigCompositeUtils::NavGraphNode::dropLinks ( NavGraphNode node)

Forget about any graph edges to the supplied node.

Forgets both child and seed (a.k.a. parent) linking

Parameters
[in]Nodeto un-link

Definition at line 36 of file NavGraph.cxx.

◆ getKeep()

bool TrigCompositeUtils::NavGraphNode::getKeep ( ) const
Returns
If the keep flag was set

Definition at line 66 of file NavGraph.cxx.

66  {
67  return m_keepFlag;
68  }

◆ keep()

void TrigCompositeUtils::NavGraphNode::keep ( )

Flag this node as one to keep when the thin() operation is performed.

Definition at line 56 of file NavGraph.cxx.

56  {
57  m_keepFlag = true;
58  }

◆ linksTo()

bool TrigCompositeUtils::NavGraphNode::linksTo ( NavGraphNode to)

Form an edge in the graph from this node to another one.

Parameters
[in]toThe "parent" or "seed" Decision object from the perspective of this Node's shadowed Decision object. Mutable to allow two-way linking.
Returns
True if a new edge was added. False if this was a duplicated call to add this edge.

Definition at line 30 of file NavGraph.cxx.

30  {
31  addIfNotDuplicate(to->m_filteredChildren, this);
32  return addIfNotDuplicate(m_filteredSeeds, to); // Return TRUE if a new edge is added
33  }

◆ node()

const Decision * TrigCompositeUtils::NavGraphNode::node ( ) const

Return a const pointer to the Decision object node which this NavGraphNode is shadowing.

Definition at line 42 of file NavGraph.cxx.

42  {
43  return m_decisionObject;
44  }

◆ resetKeep()

void TrigCompositeUtils::NavGraphNode::resetKeep ( )

Reset the keep flag to false upon finishing thinning.

Definition at line 61 of file NavGraph.cxx.

61  {
62  m_keepFlag = false;
63  }

◆ seeds()

const std::vector< NavGraphNode * > & TrigCompositeUtils::NavGraphNode::seeds ( ) const

Return a vector of const pointers to the Decision object nodes which this NavGraphNode seeds from.

A.k.a its parents. Note: NavGraph is used to represent a sub-graph of the full navigation graph, hence it is expected that the vector of seeds returned from this function may be smaller than the vector of seeds returned from the shadowed xAOD Decision Object.

Definition at line 47 of file NavGraph.cxx.

47  {
48  return m_filteredSeeds;
49  }

Member Data Documentation

◆ m_decisionObject

const Decision* TrigCompositeUtils::NavGraphNode::m_decisionObject
private

The Decision object node which I shadow.

Definition at line 97 of file NavGraph.h.

◆ m_filteredChildren

std::vector<NavGraphNode*> TrigCompositeUtils::NavGraphNode::m_filteredChildren
private

Two-way linking information, used when thinning the graph.

Definition at line 99 of file NavGraph.h.

◆ m_filteredSeeds

std::vector<NavGraphNode*> TrigCompositeUtils::NavGraphNode::m_filteredSeeds
private

My seeds (edges in the graph), filtered on per-chain requirements.

Definition at line 98 of file NavGraph.h.

◆ m_keepFlag

bool TrigCompositeUtils::NavGraphNode::m_keepFlag
private

Keep this node when slimming the NavGraph.

Needs to be set explicitly

Definition at line 100 of file NavGraph.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigCompositeUtils::NavGraphNode::m_keepFlag
bool m_keepFlag
Keep this node when slimming the NavGraph.
Definition: NavGraph.h:100
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
TrigCompositeUtils::NavGraphNode::m_decisionObject
const Decision * m_decisionObject
The Decision object node which I shadow.
Definition: NavGraph.h:97
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
TrigCompositeUtils::NavGraphNode::m_filteredSeeds
std::vector< NavGraphNode * > m_filteredSeeds
My seeds (edges in the graph), filtered on per-chain requirements.
Definition: NavGraph.h:98
TrigCompositeUtils::NavGraphNode::addIfNotDuplicate
static bool addIfNotDuplicate(std::vector< NavGraphNode * > &container, NavGraphNode *toAdd)
Internal helper function.
Definition: NavGraph.cxx:20
TrigCompositeUtils::NavGraphNode::m_filteredChildren
std::vector< NavGraphNode * > m_filteredChildren
Two-way linking information, used when thinning the graph.
Definition: NavGraph.h:99
node
Definition: memory_hooks-stdcmalloc.h:74