8#include <tracking/trackFindingCDC/hough/perigee/CurvRep.h>
9#include <tracking/trackFindingCDC/numerics/LookupTable.h>
10#include <framework/logging/Logger.h>
13using namespace TrackFindingCDC;
16 : m_lowerBound(lowerBound)
17 , m_upperBound(upperBound)
19 , m_nOverlap(nOverlap)
34 const double expandedLowerBound = -width / 2;
35 return linspace<float>(expandedLowerBound,
m_upperBound, nPositions);
45 long nCurlingCurvs = 3 * nPositions / 10;
47 std::vector<float> curlingCurvs = linspace<float>(1 / fabs(
m_upperBound),
50 [](
float f) {
return 1 / f;});
52 std::sort(curlingCurvs.begin(), curlingCurvs.end());
53 float minWidthCurling = curlingCurvs[1] - curlingCurvs[0];
56 std::vector<float> nonCurlingCurvs = linspace<float>(-fabs(
m_lowerBound),
58 nPositions - nCurlingCurvs);
60 float widthNonCurling = nonCurlingCurvs[1] - nonCurlingCurvs[0];
62 B2INFO(
"Min Width curling" << minWidthCurling);
63 B2INFO(
"Width non curling" << widthNonCurling);
64 assert(minWidthCurling > widthNonCurling);
67 nonCurlingCurvs.insert(nonCurlingCurvs.end(), ++(curlingCurvs.begin()), curlingCurvs.end());
68 B2INFO(nonCurlingCurvs.size());
71 assert(nPositions ==
static_cast<long>(nonCurlingCurvs.size()));
72 assert(std::is_sorted(nonCurlingCurvs.begin(), nonCurlingCurvs.end()));
73 return nonCurlingCurvs;
79 std::vector<CurvWithArcLength2DCache> result;
80 result.reserve(discreteCurvs.size());
81 for (
float curv : discreteCurvs) {
82 result.emplace_back(curv);
101 const double width =
m_upperBound / (
m_nBins * (1 - overlapWidthRatio) + overlapWidthRatio - 0.5);
long getNPositions() const
Getter for the number of bounds.
DiscreteCurv::Array constructArray() const
Construct the array of discrete curve positions.
int m_nOverlap
Overlap of the leaves in curve counted in number of discrete values.
double m_lowerBound
Lower bound of the binning range.
DiscreteCurv::Array constructInvLinearArray() const
Construct the array of discrete curve positions such that the inverse curvatures are distributed equa...
int m_nWidth
Width of the leaves at the maximal level in curve counted in number of discrete values.
DiscreteCurv::Array constructLinearArray() const
Construct the array of discrete curve positions such that the curvatures are distributed equally.
CurvBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
Constructs a specification for equally spaced discrete curvature values with discrete overlap specifi...
DiscreteCurvWithArcLength2DCache::Array constructCacheArray() const
Construct the array of discrete curve positions including cache for the two dimensional arc length.
double getBinWidth() const
Getter for the bin width in real curve to investigate the value that results from the discrete overla...
double m_upperBound
Upper bound of the binning range.
long m_nBins
Number of accessible bins.
double getOverlap() const
Getter for the overlap in real curve to investigate the value that results from the discrete overlap ...
std::vector< T > Array
The type of the array which contains the underlying values.
Abstract base class for different kinds of events.