10#include <tracking/trackFindingCDC/hough/perigee/StereoHitContained.h>
11#include <tracking/trackFindingCDC/hough/trees/BoxDivisionHoughTree.h>
12#include <tracking/trackFindingCDC/hough/perigee/CurvRep.h>
21 namespace TrackFindingCDC {
28 template<
class AHitPtr,
55 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
56 find(
const Weight& minWeight,
const double maxCurv = NAN)
58 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
60 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
64 skipHighCurvatureAndLowWeightNode);
68 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
69 findBest(
const Weight& minWeight,
const double maxCurv = NAN)
71 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
73 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
77 skipHighCurvatureAndLowWeightNode);
81 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
84 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
86 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
88 std::unique_ptr<std::pair<HoughBox, std::vector<AHitPtr> > > found =
91 skipHighCurvatureAndLowWeightNode);
93 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > > result;
96 result.push_back(std::move(*found));
102 template<
class ALeafProcessor>
A fast hough algorithm with rectangular boxes, which are split linearly by a fixed number of division...
typename HoughTree::Node Node
Type of the nodes used in the tree for the search.
int getMaxLevel() const
Getter for the currently set maximal level.
HoughTree * getTree() const
Getter for the tree used in the search in the hough plane.
A convenience class based on a BoxDivisionHoughTree for "hit-like" classes.
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.
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > find(const Weight &minWeight, const double maxCurv=NAN)
Find disjoint leaves heavier than minWeight.
void findUsing(ALeafProcessor &leafProcessor)
Fill and walk the tree using invoking the leaf processor on each encountered node.
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.
typename InBox::HoughBox HoughBox
Type of the hough box.
SimpleHitBasedHoughTree(size_t maxLevel, float curlCurv=NAN)
Constructor using the given maximal level.
double m_curlCurv
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.
typename Super::Node Node
Type of the node in the hough tree.
Predicate class to check for the containment of axial and stereo hits in some hough space part.
std::vector< std::pair< ADomain, std::vector< T > > > findLeavesDisjoint(AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode)
Find all children node at maximum level and add them to the result list. Skip nodes if skipNode retur...
std::unique_ptr< std::pair< ADomain, std::vector< T > > > findHeaviestLeafSingle(AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode)
Go through all children until the maxLevel is reached and find the leaf with the highest weight.
void fillWalk(AItemInDomainMeasure &weightItemInDomain, AIsLeafPredicate &isLeaf)
Walk through the children and fill them if necessary until isLeaf returns true.
std::vector< std::pair< ADomain, std::vector< T > > > findHeaviestLeafRepeated(AItemInDomainMeasure &weightItemInDomain, int maxLevel, const Weight minWeight=NAN)
Go through all children until maxLevel is reached and find the heaviest leaves.
Abstract base class for different kinds of events.