Belle II Software  release-08-01-10
ImpactRep.cc
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 #include <tracking/trackFindingCDC/hough/perigee/ImpactRep.h>
9 #include <tracking/trackFindingCDC/numerics/LookupTable.h>
10 #include <framework/logging/Logger.h>
11 
12 using namespace Belle2;
13 using namespace TrackFindingCDC;
14 
15 ImpactBinsSpec::ImpactBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
16  : m_lowerBound(lowerBound)
17  , m_upperBound(upperBound)
18  , m_nBins(nBins)
19  , m_nOverlap(nOverlap)
20  , m_nWidth(nWidth)
21 {
22  B2ASSERT("Overlap must be smaller than the width.", m_nWidth > m_nOverlap);
23  B2ASSERT("Upper impactature bound must be higher than the lower bound.", m_upperBound > m_lowerBound);
24 }
25 
27 {
28  const long nPositions = getNPositions();
29  return linspace<float>(m_lowerBound, m_upperBound, nPositions);
30 }
31 
33 {
34  const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
35  return nPositions;
36 }
37 
39 {
40  const double overlapWidthRatio = static_cast<double>(m_nOverlap) / m_nWidth;
41  const double width = (m_upperBound - m_lowerBound) / (m_nBins * (1 - overlapWidthRatio) + overlapWidthRatio);
42  return width;
43 }
44 
46 {
47  return getBinWidth() * m_nOverlap / m_nWidth;
48 }
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:55
long getNPositions() const
Getter for the number of bounds.
Definition: ImpactRep.cc:32
int m_nOverlap
Overlap of the leaves in impact counted in number of discrete values.
Definition: ImpactRep.h:70
double m_lowerBound
Lower bound of the binning range.
Definition: ImpactRep.h:61
int m_nWidth
Width of the leaves at the maximal level in impact counted in number of discrete values.
Definition: ImpactRep.h:73
DiscreteImpact::Array constructArray() const
Constuct the array of discrete impact positions.
Definition: ImpactRep.cc:26
ImpactBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
Constructs a specification for equally spaced discrete impactature values with discrete overlap speci...
Definition: ImpactRep.cc:15
double getBinWidth() const
Getter for the bin width in real impact to investigate the value that results from the discrete overl...
Definition: ImpactRep.cc:38
double m_upperBound
Upper bound of the binning range.
Definition: ImpactRep.h:64
long m_nBins
Number of accessable bins.
Definition: ImpactRep.h:67
double getOverlap() const
Getter for the overlap in real impact to investigate the value that results from the discrete overlap...
Definition: ImpactRep.cc:45
Abstract base class for different kinds of events.