Belle II Software development
|
Hough Tree for finding StereoHits using a templated class as the item type. More...
#include <Z0TanLambdaLegendre.h>
Public Types | |
using | DecisionAlgorithm = AHitDecisionAlgorithm |
typedef of the templated AHitDecisionAlgorithm; used to reach methods defined in the algorithm e.g. debugLine, centerX, centerY etc. | |
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 | Node = typename HoughTree::Node |
Type of the nodes used in the tree for the search. | |
Public Member Functions | |
Z0TanLambdaLegendre () | |
Constructor using the given maximal level setting the maximal values. | |
void | writeDebugInfoToFile (const std::string &filename) |
Write out some debug information to a ROOT file with the given name. | |
void | drawDebugPlot (const std::vector< CDCRecoHit3D > &allHits, const std::vector< CDCRecoHit3D > &foundHits, const typename AInBoxAlgorithm::HoughBox &node) |
Draw the results to a ROOT TCanvas. | |
void | initialize () |
Initialize the tree with the given values. | |
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > | findSingleBest (const Weight &minWeight) |
Find only the leave with the highest weight = number of items. | |
float | getMaximumX () const |
Return the maximum value in x direction. | |
float | getMaximumY () const |
Return the maximum value in y direction. | |
Width< 0 > | getOverlapX () const |
Return the overlap in x direction. | |
Width< 1 > | getOverlapY () const |
Return the overlap in y direction. | |
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. | |
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 | 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 acquired during the runs. | |
HoughTree * | getTree () 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 = DebugableSimpleBoxDivisionHoughTree< AHitPointerType, AHitDecisionAlgorithm, z0Divisions, tanLambdaDivisions > |
Super type. | |
using | HoughBox = typename AInBoxAlgorithm::HoughBox |
The HoughBox we use. | |
template<size_t I> | |
using | Width = typename HoughBox::template Width< I > |
Type of the width in coordinate I. | |
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 | |
void | fillAll () |
Fill the tree till all nodes are touched once. | |
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 | |
float | m_maximumX = 0 |
The maximum value in X direction. | |
float | m_maximumY = 0 |
The maximum value in y direction. | |
Width< 0 > | m_overlapX = 0 |
The overlap in X direction. | |
Width< 1 > | m_overlapY = 0 |
The overlap in Y direction. | |
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< HoughTree > | m_houghTree |
Dynamic hough tree structure traversed in the leaf search. | |
Hough Tree for finding StereoHits using a templated class as the item type.
This implementation uses a templated decision algorithm and typical maximum values for z0 (+- 120) and s-z-slope (+- 75°) with (as default) 2 divisions for each step. This class is more or less only alias. The real algorithm can be found in SimpeBoxDivisionHoughTree.
Definition at line 28 of file Z0TanLambdaLegendre.h.
Type of the discrete value array to coordinate index I.
Definition at line 77 of file BoxDivisionHoughTree.h.
Tuple type of the discrete value arrays.
Definition at line 80 of file BoxDivisionHoughTree.h.
|
inherited |
Type of the box division strategy.
Definition at line 41 of file BoxDivisionHoughTree.h.
using DecisionAlgorithm = AHitDecisionAlgorithm |
typedef of the templated AHitDecisionAlgorithm; used to reach methods defined in the algorithm e.g. debugLine, centerX, centerY etc.
Definition at line 42 of file Z0TanLambdaLegendre.h.
Predicate that the given type is indeed a coordinate of the hough space.
Definition at line 52 of file BoxDivisionHoughTree.h.
|
privateinherited |
The HoughBox we use.
Definition at line 27 of file SimpleBoxDivisionHoughTree.h.
|
inherited |
Type of the fast hough tree structure.
Definition at line 44 of file BoxDivisionHoughTree.h.
|
inherited |
Type of the nodes used in the tree for the search.
Definition at line 63 of file BoxDivisionHoughTree.h.
|
private |
Super type.
Definition at line 35 of file Z0TanLambdaLegendre.h.
Type of the coordinate I.
Definition at line 48 of file BoxDivisionHoughTree.h.
Function to get the coordinate index from its type.
Definition at line 56 of file BoxDivisionHoughTree.h.
Type of the width in coordinate I.
Definition at line 31 of file SimpleBoxDivisionHoughTree.h.
|
inline |
Constructor using the given maximal level setting the maximal values.
Definition at line 45 of file Z0TanLambdaLegendre.h.
Provide an externally constructed array by coordinate index.
Definition at line 128 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Provide an externally constructed array by coordinate type.
Definition at line 157 of file BoxDivisionHoughTree.h.
|
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.
lowerBound | Lower bound of the value range |
upperBound | Upper bound of the value range |
nBinOverlap | Overlap of neighboring bins. Default is no overlap. Usually this is counted in number of discrete values |
nBinWidth | Width 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.
|
inlineprivateinherited |
Construct the box of the top node of the tree.
Definition at line 239 of file BoxDivisionHoughTree.h.
|
inlineprivateinherited |
Construct the box of the top node of the tree. Implementation unroling the indices.
Definition at line 233 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Draw the results to a ROOT TCanvas.
Definition at line 98 of file DebugableSimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Terminates the processing by striping all hit information from the tree.
Definition at line 181 of file BoxDivisionHoughTree.h.
|
inlineprivateinherited |
Fill the tree till all nodes are touched once.
This is not for finding results, but for debug reasons.
Definition at line 171 of file DebugableSimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Find only the leave with the highest weight = number of items.
Definition at line 58 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Getter for the array of discrete value for coordinate I.
Definition at line 225 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Getter the number of divisions at each level for coordinate index I.
Definition at line 84 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Return the maximum value in x direction.
Definition at line 75 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Return the maximum value in y direction.
Definition at line 81 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Getter for the currently set maximal level.
Definition at line 200 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Return the overlap in x direction.
Definition at line 87 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Return the overlap in y direction.
Definition at line 93 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Getter for number of levels to skip in first level to form a finer sectored hough space.
Definition at line 212 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Getter for the tree used in the search in the hough plane.
Definition at line 194 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Initialize the tree with the given values.
Definition at line 48 of file SimpleBoxDivisionHoughTree.h.
|
inlineinherited |
Release all memory that the tree acquired during the runs.
Definition at line 187 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Prepare the leave finding by filling the top node with given hits.
Definition at line 174 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Setter maximal level of the hough tree.
Definition at line 206 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Setter for number of levels to skip in first level to form a finer sectored hough space.
Definition at line 218 of file BoxDivisionHoughTree.h.
|
inlineinherited |
Write out some debug information to a ROOT file with the given name.
This must be done before felling the tree. Attention: This will delete a ROOT file with the same name if already present.
filename | The ROOT filename. |
Definition at line 42 of file DebugableSimpleBoxDivisionHoughTree.h.
|
privateinherited |
A tuple of value arrays providing the memory for the discrete bin bounds.
Definition at line 258 of file BoxDivisionHoughTree.h.
|
privateinherited |
Array of the number of divisions at each level.
Definition at line 252 of file BoxDivisionHoughTree.h.
|
privateinherited |
Dynamic hough tree structure traversed in the leaf search.
Definition at line 261 of file BoxDivisionHoughTree.h.
|
privateinherited |
The maximum value in X direction.
Definition at line 100 of file SimpleBoxDivisionHoughTree.h.
|
privateinherited |
The maximum value in y direction.
Definition at line 103 of file SimpleBoxDivisionHoughTree.h.
|
privateinherited |
Number of the maximum tree level.
Definition at line 246 of file BoxDivisionHoughTree.h.
|
privateinherited |
An tuple of division overlaps in each coordinate.
Definition at line 255 of file BoxDivisionHoughTree.h.
|
privateinherited |
The overlap in X direction.
Definition at line 106 of file SimpleBoxDivisionHoughTree.h.
|
privateinherited |
The overlap in Y direction.
Definition at line 109 of file SimpleBoxDivisionHoughTree.h.
|
privateinherited |
Number of levels to skip in first level to form a finer sectored hough space.
Definition at line 249 of file BoxDivisionHoughTree.h.