Belle II Software  release-08-01-10
SimpleHitBasedHoughTree< AHitPtr, InBox, divisions > Class Template Reference

A convenience class based on a BoxDivisionHoughTree for "hit-like" classes. More...

#include <SimpleHitBasedHoughTree.h>

Inheritance diagram for SimpleHitBasedHoughTree< AHitPtr, InBox, divisions >:
Collaboration diagram for SimpleHitBasedHoughTree< AHitPtr, InBox, divisions >:

Public Types

using Node = typename Super::Node
 Type of the node in the hough tree.
 
using HoughBox = typename InBox::HoughBox
 Type of the hough box.
 
using BoxDivision = SectoredLinearDivision< HoughBox, divisions... >
 Type of the box division strategy.
 
using HoughTree = WeightedFastHoughTree< AHitPtr, HoughBox, BoxDivision >
 Type of the fast hough tree structure.
 
using Type = typename HoughBox::template Type< I >
 Type of the coordinate I.
 
using HasType = typename HoughBox::template HasType< T >
 Predicate that the given type is indeed a coordinate of the hough space.
 
using TypeIndex = typename HoughBox::template TypeIndex< T >
 Function to get the coordinate index from its type.
 
using Width = typename HoughBox::template Width< I >
 Type of the width in coordinate I.
 

Public Member Functions

 SimpleHitBasedHoughTree (size_t maxLevel, float curlCurv=NAN)
 Constructor using the given maximal level.
 
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > find (const Weight &minWeight, const double maxCurv=NAN)
 Find disjoint leaves heavier than minWeight.
 
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > findBest (const Weight &minWeight, const double maxCurv=NAN)
 Find the best trajectory and repeat the process until no bin heavier than minWeight can be found.
 
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > findSingleBest (const Weight &minWeight, const double maxCurv=NAN)
 Find the best trajectory from the single heaviest bin heavier than minWeight.
 
template<class ALeafProcessor >
void findUsing (ALeafProcessor &leafProcessor)
 Fill and walk the tree using invoking the leaf processor on each encountered node.
 
size_t getDivision (size_t i) const
 Getter the number of divisions at each level for coordinate index I.
 
void constructArray (double lowerBound, double upperBound, Width< I > nBinOverlap=0, Width< I > nBinWidth=0)
 Construct the discrete value array at coordinate index I. More...
 
void assignArray (Array< I > array, Width< I > overlap=0)
 Provide an externally constructed array by coordinate index.
 
std::enable_if_t< HasType< T >::value, void > assignArray (Array< TypeIndex< T >::value > array, Width< TypeIndex< T >::value > overlap=0)
 Provide an externally constructed array by coordinate type.
 
void initialize ()
 Initialise the algorithm by constructing the hough tree from the parameters.
 
void seed (const AItemPtrs &items)
 Prepare the leave finding by filling the top node with given hits.
 
void fell ()
 Terminates the processing by striping all hit information from the tree.
 
void raze ()
 Release all memory that the tree aquired during the runs.
 
HoughTreegetTree () const
 Getter for the tree used in the search in the hough plane.
 
int getMaxLevel () const
 Getter for the currently set maximal level.
 
void setMaxLevel (int maxLevel)
 Setter maximal level of the hough tree.
 
int getSectorLevelSkip () const
 Getter for number of levels to skip in first level to form a finer sectored hough space.
 
void setSectorLevelSkip (int sectorLevelSkip)
 Setter for number of levels to skip in first level to form a finer sectored hough space.
 
const Array< I > & getArray () const
 Getter for the array of discrete value for coordinate I.
 

Private Types

using Super = BoxDivisionHoughTree< AHitPtr, typename InBox::HoughBox, divisions... >
 Type of the base class.
 
using Array = typename Type< I >::Array
 Type of the discrete value array to coordinate index I.
 
using Arrays = TupleGenerateN< Array, sizeof...(divisions)>
 Tuple type of the discrete value arrays.
 

Private Member Functions

HoughBox constructHoughPlaneImpl (const std::index_sequence< Is... > &is)
 Construct the box of the top node of the tree. Implementation unroling the indices.
 
HoughBox constructHoughPlane ()
 Construct the box of the top node of the tree.
 

Private Attributes

double m_curlCurv = 0.018
 Curvature below which a trajectory is considered non curling.
 
StereoHitContained< InBox > m_stereoHitContainedInBox
 Predicate checking if a hit is in the realm of the sweeped object.
 
int m_maxLevel
 Number of the maximum tree level.
 
int m_sectorLevelSkip
 Number of levels to skip in first level to form a finer sectored hough space.
 
const std::array< size_t, sizeof ...(divisions)> m_divisions
 Array of the number of divisions at each level.
 
HoughBox::Delta m_overlaps
 An tuple of division overlaps in each coordinate.
 
Arrays m_arrays
 A tuple of value arrays providing the memory for the discrete bin bounds.
 
std::unique_ptr< HoughTreem_houghTree
 Dynamic hough tree structure traversed in the leaf search.
 

Detailed Description

template<class AHitPtr, class InBox, size_t ... divisions>
class Belle2::TrackFindingCDC::SimpleHitBasedHoughTree< AHitPtr, InBox, divisions >

A convenience class based on a BoxDivisionHoughTree for "hit-like" classes.

You still have to implement the box and the division by yourself, but the typical search functions are implemented in this class.

Definition at line 31 of file SimpleHitBasedHoughTree.h.

Member Function Documentation

◆ constructArray()

void constructArray ( double  lowerBound,
double  upperBound,
Width< I >  nBinOverlap = 0,
Width< I >  nBinWidth = 0 
)
inlineinherited

Construct the discrete value array at coordinate index I.

This function is only applicable for discrete axes. For continuous axes assignArray should be call with an array containing only the lower and upper bound of the axes range and an optional overlap.

Parameters
lowerBoundLower bound of the value range
upperBoundUpper bound of the value range
nBinOverlapOverlap of neighboring bins. Default is no overlap. Usuallly this is counted in number of discrete values
nBinWidthWidth of the bins at lowest level. Default is width of 1. Usually this is counted in numbers of discrete values

Definition at line 104 of file BoxDivisionHoughTree.h.


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