Belle II Software  release-05-02-19
CurvRep.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/hough/axes/StandardAxes.h>
13 #include <tracking/trackFindingCDC/utilities/Functional.h>
14 
15 #include <type_traits>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23 
25  class CurvBinsSpec {
26  public:
39  CurvBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth);
40 
43  { return constructLinearArray(); }
44 
47 
50 
53 
55  long getNPositions() const;
56 
61  double getBinWidth() const;
62 
67  double getOverlap() const;
68 
70  int getNOverlap() const
71  {
72  return m_nOverlap;
73  }
74 
75  private:
77  double m_lowerBound;
78 
80  double m_upperBound;
81 
83  long m_nBins;
84 
86  int m_nOverlap = 1;
87 
89  int m_nWidth = 3;
90  };
91 
93  struct GetLowerCurv {
95  template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<DiscreteCurv>::value > >
96  float operator()(const AHoughBox& houghBox) const
97  {
98  return static_cast<float>(houghBox.template getLowerBound<DiscreteCurv>());
99  }
100 
102  template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<ContinuousCurv>::value > >
103  double operator()(const AHoughBox& houghBox) const
104  {
105  return static_cast<float>(houghBox.template getLowerBound<ContinuousCurv>());
106  }
107  };
108 
110  struct GetUpperCurv {
112  template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<DiscreteCurv>::value> >
113  float operator()(const AHoughBox& houghBox) const
114  {
115  return static_cast<float>(houghBox.template getUpperBound<DiscreteCurv>());
116  }
117 
119  template <class AHoughBox, class SFINAE = std::enable_if_t<AHoughBox::template HasType<ContinuousCurv>::value> >
120  double operator()(const AHoughBox& houghBox) const
121  {
122  return static_cast<float>(houghBox.template getUpperBound<ContinuousCurv>());
123  }
124  };
125 
130  template <class AHoughBox>
131  float getLowerCurv(const AHoughBox& houghBox)
132  {
133  return getIfApplicable<float>(GetLowerCurv(), houghBox, 0.0);
134  }
135 
140  template <class AHoughBox>
141  float getUpperCurv(const AHoughBox& houghBox)
142  {
143  return getIfApplicable<float>(GetUpperCurv(), houghBox, 0.0);
144  }
145  }
147 }
Belle2::TrackFindingCDC::CurvBinsSpec::m_nOverlap
int m_nOverlap
Overlap of the leaves in curv counted in number of discrete values.
Definition: CurvRep.h:94
Belle2::TrackFindingCDC::CurvBinsSpec::constructCacheArray
DiscreteCurvWithArcLength2DCache::Array constructCacheArray() const
Constuct the array of discrete curv positions including cache for the two dimensional arc length.
Definition: CurvRep.cc:78
Belle2::TrackFindingCDC::CurvBinsSpec::getNOverlap
int getNOverlap() const
Getter for the overlap in discrete number of positions.
Definition: CurvRep.h:78
Belle2::TrackFindingCDC::GetUpperCurv::operator()
float operator()(const AHoughBox &houghBox) const
Getter function for the upper curvature bound of a hough box - discrete version.
Definition: CurvRep.h:121
Belle2::TrackFindingCDC::CurvBinsSpec::m_nWidth
int m_nWidth
Width of the leaves at the maximal level in curv counted in number of discrete values.
Definition: CurvRep.h:97
Belle2::TrackFindingCDC::GetLowerCurv
Functor to get the lower curvature bound of a hough box.
Definition: CurvRep.h:101
Belle2::TrackFindingCDC::CurvBinsSpec::constructInvLinearArray
DiscreteCurv::Array constructInvLinearArray() const
Constuct the array of discrete curv positions such that the inverse curvatures are distributed equall...
Definition: CurvRep.cc:43
Belle2::TrackFindingCDC::CurvBinsSpec::m_lowerBound
double m_lowerBound
Lower bound of the binning range.
Definition: CurvRep.h:85
Belle2::TrackFindingCDC::CurvBinsSpec::CurvBinsSpec
CurvBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
Constructs a specification for equally spaced discrete curvature values with discrete overlap specifi...
Definition: CurvRep.cc:17
Belle2::TrackFindingCDC::CurvBinsSpec::constructArray
DiscreteCurv::Array constructArray() const
Constuct the array of discrete curv positions.
Definition: CurvRep.h:50
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CurvBinsSpec::m_upperBound
double m_upperBound
Upper bound of the binning range.
Definition: CurvRep.h:88
Belle2::TrackFindingCDC::GetLowerCurv::operator()
float operator()(const AHoughBox &houghBox) const
Getter function for the lower curvature bound of a hough box - discrete version.
Definition: CurvRep.h:104
Belle2::TrackFindingCDC::CurvBinsSpec::constructLinearArray
DiscreteCurv::Array constructLinearArray() const
Constuct the array of discrete curv positions such that the curvatures are distributed equally.
Definition: CurvRep.cc:28
Belle2::TrackFindingCDC::CurvBinsSpec::getNPositions
long getNPositions() const
Getter for the number of bounds.
Definition: CurvRep.cc:89
Belle2::TrackFindingCDC::CurvBinsSpec::m_nBins
long m_nBins
Number of accessable bins.
Definition: CurvRep.h:91
Belle2::TrackFindingCDC::CurvBinsSpec::getOverlap
double getOverlap() const
Getter for the overlap in real curv to investigate the value that results from the discrete overlap s...
Definition: CurvRep.cc:111
Belle2::TrackFindingCDC::CurvBinsSpec::getBinWidth
double getBinWidth() const
Getter for the bin width in real curv to investigate the value that results from the discrete overlap...
Definition: CurvRep.cc:96
Belle2::TrackFindingCDC::DiscreteValue::Array
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:65