10#include <framework/logging/Logger.h>
12#include <tracking/trackFindingVXD/segmentNetwork/DirectedNode.h>
15#include <unordered_map>
27 template<
typename EntryType,
typename MetaInfoType>
53 delete nodePointer.second;
79 B2WARNING(
"Last OuterNode is not yet in this network! CurrentNetworkSize is: " <<
size());
84 B2WARNING(
"LastOuterNode and innerEntry are identical! Skipping linking-process");
91 B2WARNING(
"Last OuterNode and innerEntry were already in the network and were already connected."
92 "This is a sign for unintended behavior!");
102 B2WARNING(
"Last InnerNode is not yet in this network! CurrentNetworkSize is: " <<
size());
107 B2WARNING(
"OuterEntry and lastInnerNode are identical! Skipping linking-process");
115 B2WARNING(
"Last InnerNode and outerEntry were already in the network and were already connected."
116 "This is a sign for unintended behavior!");
126 if (outerNodeID == innerNodeID) {
127 B2WARNING(
"OuterNodeID and innerNodeID are identical! Skipping linking-process");
131 B2WARNING(
"Trying to link Nodes that are not present yet");
159 delete nodePointer.second;
199 typename std::vector<Node* >::iterator
begin()
207 typename std::vector<Node* >::iterator
end()
245 m_nodes.push_back(item.second);
246 if (item.second->getInnerNodes().empty())
m_innerEnds.push_back(item.second);
247 if (item.second->getOuterNodes().empty())
m_outerEnds.push_back(item.second);
Node * getNode(NodeID toBeFound)
Returns pointer to the node carrying the entry which is equal to given parameter.
DirectedNode< Belle2::Segment< Belle2::TrackNode >, Belle2::CACell > Node
std::vector< Node * > getInnerEnds()
returns all nodes which have no inner nodes (but outer ones) and therefore are inner ends of the netw...
std::vector< Node * >::iterator begin()
Returns iterator for container: begin.
DirectedNodeNetwork()
************************* CONSTRUCTOR/DESTRUCTOR *************************
std::vector< Node * > & getNodes()
Returns all nodes of the network.
bool addInnerToLastOuterNode(NodeID innerNodeID)
to the last outerNode added, another innerNode will be attached
std::vector< Node * >::iterator end()
Returns iterator for container: end.
void finalize()
Finalizing the NodeNetwork.
static bool createLink(Node &outerNode, Node &innerNode)
************************* INTERNAL MEMBER FUNCTIONS *************************
~DirectedNodeNetwork()
destructor taking care of cleaning up the pointer-mess WARNING only needed when using classic pointer...
unsigned int size() const
Returns number of nodes to be found in the network.
std::vector< Node * > getOuterEnds()
getters:
std::unordered_map< NodeID, Node * > m_nodeMap
std::vector< Node * > m_innerEnds
bool linkNodes(NodeID outerNodeID, NodeID innerNodeID)
takes two entry IDs and weaves them into the network
bool isNodeInNetwork(const NodeID nodeID) const
Check if a given entry is already in the network.
bool addNode(NodeID nodeID, EntryType &newEntry)
************************* PUBLIC MEMBER FUNCTIONS *************************
std::vector< Node * > m_outerEnds
bool addOuterToLastInnerNode(NodeID outerNodeID)
to the last innerNode added, another outerNode will be attached
void clear()
Clear directed node network Called to clear the directed node network if its size grows to large.
std::vector< Node * > m_nodes
std::vector< DirectedNode< EntryType, MetaInfoType > * > & getInnerNodes()
************************* PUBLIC MEMBER FUNCTIONS *************************
std::vector< DirectedNode< EntryType, MetaInfoType > * > & getOuterNodes()
Returns links to all outer nodes attached to this one.
void addInnerNode(DirectedNode< EntryType, MetaInfoType > &newNode)
************************* INTERNAL MEMBER FUNCTIONS *************************
void addOuterNode(DirectedNode< EntryType, MetaInfoType > &newNode)
Adds new links to the outward direction.
Abstract base class for different kinds of events.