Belle II Software development
CurvRep.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/hough/axes/StandardAxes.h>
11#include <tracking/trackFindingCDC/utilities/Functional.h>
12
13#include <type_traits>
14
15namespace Belle2 {
20 namespace TrackFindingCDC {
21
24 public:
37 CurvBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth);
38
41 { return constructLinearArray(); }
42
45
48
51
53 long getNPositions() const;
54
59 double getBinWidth() const;
60
65 double getOverlap() const;
66
68 int getNOverlap() const
69 {
70 return m_nOverlap;
71 }
72
73 private:
76
79
81 long m_nBins;
82
84 int m_nOverlap = 1;
85
87 int m_nWidth = 3;
88 };
89
91 struct GetLowerCurv {
93 template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<DiscreteCurv>::value > >
94 float operator()(const AHoughBox& houghBox) const
95 {
96 return static_cast<float>(houghBox.template getLowerBound<DiscreteCurv>());
97 }
98
100 template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<ContinuousCurv>::value > >
101 double operator()(const AHoughBox& houghBox) const
102 {
103 return static_cast<float>(houghBox.template getLowerBound<ContinuousCurv>());
104 }
105 };
106
110 template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<DiscreteCurv>::value> >
111 float operator()(const AHoughBox& houghBox) const
112 {
113 return static_cast<float>(houghBox.template getUpperBound<DiscreteCurv>());
114 }
115
117 template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<ContinuousCurv>::value> >
118 double operator()(const AHoughBox& houghBox) const
119 {
120 return static_cast<float>(houghBox.template getUpperBound<ContinuousCurv>());
121 }
122 };
123
128 template <class AHoughBox>
129 float getLowerCurv(const AHoughBox& houghBox)
130 {
131 return getIfApplicable<float>(GetLowerCurv(), houghBox, 0.0);
132 }
133
138 template <class AHoughBox>
139 float getUpperCurv(const AHoughBox& houghBox)
140 {
141 return getIfApplicable<float>(GetUpperCurv(), houghBox, 0.0);
142 }
143 }
145}
Strategy to construct discrete curv points from discrete overlap specifications.
Definition: CurvRep.h:23
long getNPositions() const
Getter for the number of bounds.
Definition: CurvRep.cc:87
DiscreteCurv::Array constructArray() const
Constuct the array of discrete curv positions.
Definition: CurvRep.h:40
int m_nOverlap
Overlap of the leaves in curv counted in number of discrete values.
Definition: CurvRep.h:84
double m_lowerBound
Lower bound of the binning range.
Definition: CurvRep.h:75
DiscreteCurv::Array constructInvLinearArray() const
Constuct the array of discrete curv positions such that the inverse curvatures are distributed equall...
Definition: CurvRep.cc:41
int m_nWidth
Width of the leaves at the maximal level in curv counted in number of discrete values.
Definition: CurvRep.h:87
DiscreteCurv::Array constructLinearArray() const
Constuct the array of discrete curv positions such that the curvatures are distributed equally.
Definition: CurvRep.cc:26
DiscreteCurvWithArcLength2DCache::Array constructCacheArray() const
Constuct the array of discrete curv positions including cache for the two dimensional arc length.
Definition: CurvRep.cc:76
double getBinWidth() const
Getter for the bin width in real curv to investigate the value that results from the discrete overlap...
Definition: CurvRep.cc:94
double m_upperBound
Upper bound of the binning range.
Definition: CurvRep.h:78
long m_nBins
Number of accessable bins.
Definition: CurvRep.h:81
int getNOverlap() const
Getter for the overlap in discrete number of positions.
Definition: CurvRep.h:68
double getOverlap() const
Getter for the overlap in real curv to investigate the value that results from the discrete overlap s...
Definition: CurvRep.cc:109
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:55
Abstract base class for different kinds of events.
Functor to get the lower curvature bound of a hough box.
Definition: CurvRep.h:91
double operator()(const AHoughBox &houghBox) const
Getter function for the lower curvature bound of a hough box - continuous version.
Definition: CurvRep.h:101
float operator()(const AHoughBox &houghBox) const
Getter function for the lower curvature bound of a hough box - discrete version.
Definition: CurvRep.h:94
Functor to get the upper curvature bound of a hough box.
Definition: CurvRep.h:108
double operator()(const AHoughBox &houghBox) const
Getter function for the upper curvature bound of a hough box - continuous version.
Definition: CurvRep.h:118
float operator()(const AHoughBox &houghBox) const
Getter function for the upper curvature bound of a hough box - discrete version.
Definition: CurvRep.h:111