 |
Belle II Software
release-05-02-19
|
12 #include <tracking/trackFindingCDC/hough/perigee/StereoHitContained.h>
13 #include <tracking/trackFindingCDC/hough/trees/BoxDivisionHoughTree.h>
14 #include <tracking/trackFindingCDC/hough/perigee/CurvRep.h>
23 namespace TrackFindingCDC {
30 template<
class AHitPtr,
33 class SimpleHitBasedHoughTree :
34 public BoxDivisionHoughTree<AHitPtr, typename InBox::HoughBox, divisions...> {
45 using HoughBox =
typename InBox::HoughBox;
57 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
58 find(
const Weight& minWeight,
const double maxCurv = NAN)
60 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
62 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
66 skipHighCurvatureAndLowWeightNode);
70 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
71 findBest(
const Weight& minWeight,
const double maxCurv = NAN)
73 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
75 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
79 skipHighCurvatureAndLowWeightNode);
83 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > >
84 findSingleBest(
const Weight& minWeight,
const double maxCurv = NAN)
86 auto skipHighCurvatureAndLowWeightNode = [minWeight, maxCurv](
const Node * node) {
88 return not(node->getWeight() >= minWeight and not(getLowerCurv(houghBox) > maxCurv));
90 std::unique_ptr<std::pair<HoughBox, std::vector<AHitPtr> > > found =
93 skipHighCurvatureAndLowWeightNode);
95 std::vector<std::pair<HoughBox, std::vector<AHitPtr> > > result;
98 result.push_back(std::move(*found));
104 template<
class ALeafProcessor>
105 void findUsing(ALeafProcessor& leafProcessor)
std::vector< std::pair< HoughBox, std::vector< AHitPtr > > > find(const Weight &minWeight, const double maxCurv=NAN)
Find disjoint leaves heavier than minWeight.
SimpleHitBasedHoughTree(size_t maxLevel, float curlCurv=NAN)
Constructor using the given maximal level.
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::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.
StereoHitContained< InBox > m_stereoHitContainedInBox
Predicate checking if a hit is in the realm of the sweeped object.
HoughTree * getTree() const
Getter for the tree used in the search in the hough plane.
void fillWalk(AItemInDomainMeasure &weightItemInDomain, AIsLeafPredicate &isLeaf)
Walk through the children and fill them if necessary until isLeaf returns true.
A fast hough algorithm with rectangular boxes, which are split linearly by a fixed number of division...
typename Super::Node Node
Type of the node in the hough tree.
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 HoughTree::Node Node
Type of the nodes used in the tree for the search.
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.
int getMaxLevel() const
Getter for the currently set maximal level.
BoxDivisionHoughTree(int maxLevel, int sectorLevelSkip=0)
Constructor using the given maximal level.
BoxDivisionHoughTree< AHitPtr, typename InBox::HoughBox, divisions... > Super
Type of the base class.
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...
double m_curlCurv
Curvature below which a trajectory is considered non curling.
void findUsing(ALeafProcessor &leafProcessor)
Fill and walk the tree using invoking the leaf processor on each encountered node.
typename InBox::HoughBox HoughBox
Type of the hough box.