Belle II Software  release-05-01-25
NodeFamilyDefiner< ContainerType, NodeType, NeighbourContainerType > Class Template Reference

This class assigns a common family identifier to all CACells in the network that are connected. More...

#include <NodeFamilyDefiner.h>

Public Member Functions

short defineFamilies (ContainerType &aNetwork)
 Assign a common family identifier to all Nodes in the network that are connected. More...
 

Private Member Functions

NeighbourContainerType markNodes (short family, NeighbourContainerType &neighbours)
 Assign family to all connected nodes and return their neighbours.
 

Detailed Description

template<class ContainerType, class NodeType, class NeighbourContainerType>
class Belle2::NodeFamilyDefiner< ContainerType, NodeType, NeighbourContainerType >

This class assigns a common family identifier to all CACells in the network that are connected.

Requirements for ContainerType:

  • must have begin() and end() with iterator pointing to pointers of entries ( = ContainerType< NodeType*>)

Requirements for NodeType:

  • must have function: bool NodeType::setFamily()
  • must have function: bool NodeType::getFamily()
  • must have function: NeighbourContainerType& NodeType::getInnerNodes()
  • must have function: NeighbourContainerType& NodeType::getOuterNodes()

Requirements for NeighbourContainerType:

  • must have function: unsigned int (or comparable) NeighbourContainerType::size()
  • must support range based for loop

Definition at line 44 of file NodeFamilyDefiner.h.

Member Function Documentation

◆ defineFamilies()

short defineFamilies ( ContainerType &  aNetwork)
inline

Assign a common family identifier to all Nodes in the network that are connected.

Performs a width first flood fill algorithm. Returns total number of defined families.

Definition at line 51 of file NodeFamilyDefiner.h.

60  {
61  neighbours = markNodes(currentFamily, neighbours);
62  }
63  currentFamily++;
64  }
65  return currentFamily;
66  }
67 
68  private:
70  NeighbourContainerType markNodes(short family, NeighbourContainerType& neighbours)
71  {
72  NeighbourContainerType newNeighbours;
73  for (auto& neighbour : neighbours) {
74  // If node was already touched continue;

The documentation for this class was generated from the following file:
Belle2::NodeFamilyDefiner::markNodes
NeighbourContainerType markNodes(short family, NeighbourContainerType &neighbours)
Assign family to all connected nodes and return their neighbours.
Definition: NodeFamilyDefiner.h:78