Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode Class Reference

An abstract class containing common features of k-d tree node types. More...

+ Collaboration diagram for Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode:

Public Types

enum  NodeType
 Enumeration type for the possible node types (internal and leaf). More...
 

Public Member Functions

 KDTreeNode (iterator_t _b, iterator_t _e, NodeType _t, std::size_t _d)
 Construct the common data for all node types.
 
template<typename Callable >
void rangeSearchMapDiscard (const range_t &r, Callable &&f) const
 Perform a range search in the k-d tree, mapping the key-value pairs to a side-effecting function.
 
std::size_t size () const
 Determine the number of elements managed by this node.
 
const range_trange () const
 The axis-aligned bounding box containing all elements in this node.
 

Protected Attributes

NodeType m_type
 
const iterator_t m_begin_it
 The start and end of the range of coordinate-value pairs under this node.
 
const iterator_t m_end_it
 
const range_t m_range
 The axis-aligned bounding box of the coordinates under this node.
 
std::unique_ptr< KDTreeNodem_lhs
 Pointers to the left and right children.
 
std::unique_ptr< KDTreeNodem_rhs
 

Detailed Description

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
class Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode

An abstract class containing common features of k-d tree node types.

A k-d tree consists of two different node types: leaf nodes and inner nodes. These nodes have some common functionality, which is captured by this common parent node type.

Definition at line 318 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 318 of file KDTree.hpp

Member Enumeration Documentation

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
enum Acts::KDTree::KDTreeNode::NodeType

Enumeration type for the possible node types (internal and leaf).

Definition at line 321 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 321 of file KDTree.hpp

Constructor & Destructor Documentation

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::KDTreeNode ( iterator_t  _b,
iterator_t  _e,
NodeType  _t,
std::size_t  _d 
)
inline

Construct the common data for all node types.

The node types share a few concepts, like an n-dimensional range, and a begin and end of the range of elements managed. This constructor calculates these things so that the individual child constructors don't have to.

Definition at line 329 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 329 of file KDTree.hpp

References KFPMath::a, KFPMath::b, distance(), i, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_begin_it, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_end_it, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_lhs, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_range, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_rhs, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_type, next, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::size(), and Acts::Experimental::detail::BlueprintHelper::sort().

+ Here is the call graph for this function:

Member Function Documentation

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
const range_t& Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::range ( ) const
inline

The axis-aligned bounding box containing all elements in this node.

Returns
The minimal axis-aligned bounding box that contains all the elements under this node.

Definition at line 477 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 477 of file KDTree.hpp

References Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_range.

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
template<typename Callable >
void Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::rangeSearchMapDiscard ( const range_t r,
Callable &&  f 
) const
inline

Perform a range search in the k-d tree, mapping the key-value pairs to a side-effecting function.

This is the most powerful range search method we have, assuming that we can use arbitrary side effects, which we can. All other range search methods are implemented in terms of this particular function.

Parameters
rThe range to search for.
fThe mapping function to apply to matching elements.

Definition at line 415 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 415 of file KDTree.hpp

References assert, Acts::RangeXD< Dims, Type, Vector >::contains(), f, i, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_begin_it, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_end_it, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_lhs, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_range, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_rhs, Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_type, and physmon_track_finding_ttbar::r.

+ Here is the call graph for this function:

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
std::size_t Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::size ( void  ) const
inline

Determine the number of elements managed by this node.

Conveniently, this number is always equal to the distance between the begin iterator and the end iterator, so we can simply delegate to the relevant standard library method.

Returns
The number of elements below this node.

Definition at line 470 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 470 of file KDTree.hpp

References distance(), Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_begin_it, and Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_end_it.

Referenced by Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::KDTreeNode().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
const iterator_t Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_begin_it
protected

The start and end of the range of coordinate-value pairs under this node.

Definition at line 484 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 484 of file KDTree.hpp

Referenced by Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::KDTreeNode(), Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::rangeSearchMapDiscard(), and Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::size().

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
const iterator_t Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_end_it
protected
template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
std::unique_ptr<KDTreeNode> Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_lhs
protected

Pointers to the left and right children.

Definition at line 491 of file KDTree.hpp.

View newest version in sPHENIX GitHub at line 491 of file KDTree.hpp

Referenced by Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::KDTreeNode(), and Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::rangeSearchMapDiscard().

template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
const range_t Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_range
protected
template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
std::unique_ptr<KDTreeNode> Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_rhs
protected
template<std::size_t Dims, typename Type, typename Scalar = double, template< typename, std::size_t > typename Vector = std::array, std::size_t LeafSize = 4>
NodeType Acts::KDTree< Dims, Type, Scalar, Vector, LeafSize >::KDTreeNode::m_type
protected

The documentation for this class was generated from the following file: