5#ifndef TrigCompositeUtils_NavGraph_h
6#define TrigCompositeUtils_NavGraph_h
81 const std::vector<NavGraphNode*>&
seeds()
const;
87 const std::vector<NavGraphNode*>&
children()
const;
149 const std::vector<NavGraphNode*>&
finalNodes()
const;
155 std::vector<NavGraphNode*>
allNodes();
160 size_t nodes()
const;
165 size_t edges()
const;
171 std::vector<const Decision*>
thin();
178 void printAllPaths(MsgStream& log, MSG::Level msgLevel = MSG::VERBOSE)
const;
212 std::vector<std::unique_ptr<NavGraphNode>>
m_nodes;
Base class for elements of a container that can have aux data.
Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_f...
NavGraphNode(NavGraphNode &&obj)=delete
Prevent move of a NavGraphNode.
const std::vector< NavGraphNode * > & children() const
Return a vector of const pointers to the Decision object nodes which are the children of this NavGrap...
std::vector< NavGraphNode * > m_filteredSeeds
My seeds (edges in the graph), filtered on per-chain requirements.
const Decision * m_decisionObject
The Decision object node which I shadow.
static bool addIfNotDuplicate(std::vector< NavGraphNode * > &container, NavGraphNode *toAdd)
Internal helper function.
bool linksTo(NavGraphNode *to)
Form an edge in the graph from this node to another one.
void dropLinks(NavGraphNode *node)
Forget about any graph edges to the supplied node.
std::vector< NavGraphNode * > m_filteredChildren
Two-way linking information, used when thinning the graph.
bool m_keepFlag
Keep this node when slimming the NavGraph.
NavGraphNode(const Decision *me)
Construct a NavGraphNode shadowing a node in the full xAOD navigation graph.
void resetKeep()
Reset the keep flag to false upon finishing thinning.
void keep()
Flag this node as one to keep when the thin() operation is performed.
~NavGraphNode()=default
Destruct a NavGraphNode, default.
const std::vector< NavGraphNode * > & seeds() const
Return a vector of const pointers to the Decision object nodes which this NavGraphNode seeds from.
const Decision * node() const
Return a const pointer to the Decision object node which this NavGraphNode is shadowing.
NavGraphNode(const NavGraphNode &obj)=delete
Prevent copies of a NavGraphNode.
std::vector< NavGraphNode * > allNodes()
Get all nodes.
void addNode(const Decision *node, const Decision *comingFrom=nullptr)
Add a new NavGraphNode which shadows the xAOD Decision object "node" from the full navigation graph.
std::vector< NavGraphNode * > m_finalNodes
Entry points into the navigation graph.
const std::vector< NavGraphNode * > & finalNodes() const
Get all final nodes.
std::map< const Decision *, size_t > m_nodePositionMap
Map of Decision pointer and index of the node(that contains the Decision) in m_nodes.
void printAllPaths(MsgStream &log, MSG::Level msgLevel=MSG::VERBOSE) const
Helper function.
void recursivePrintNavPath(const NavGraphNode &nav, size_t level, MsgStream &log, MSG::Level msgLevel) const
@bried Internal helper function.
std::vector< std::unique_ptr< NavGraphNode > > m_nodes
Vector of unique pointers to nodes in the graph.
NavGraph()=default
Construct an empty NavGraph.
NavGraph(NavGraph &&obj)=delete
Prevent move of a NavGraphNode.
NavGraph(const NavGraph &obj)=delete
Prevent copy of a NavGraphNode.
size_t m_edges
Statistics on the number of edges, connecting the nodes in the graph.
~NavGraph()=default
Destruct a NavGraph, default.
std::vector< const Decision * > thin()
Perform thinning.
void rewireNodeForRemoval(NavGraphNode &toBeDeleted)
Take all seeds (parents) of the supplied node and connect them to all the node's children.
xAOD::TrigComposite Decision