Belle II Software development
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/trackingUtilities/numerics/LookupTable.h>
10#include <framework/logging/Logger.h>
11
12using namespace Belle2;
13using namespace TrackFindingCDC;
14using namespace TrackingUtilities;
15
16ImpactBinsSpec::ImpactBinsSpec(double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
17 : m_lowerBound(lowerBound)
18 , m_upperBound(upperBound)
19 , m_nBins(nBins)
20 , m_nOverlap(nOverlap)
21 , m_nWidth(nWidth)
22{
23 B2ASSERT("Overlap must be smaller than the width.", m_nWidth > m_nOverlap);
24 B2ASSERT("Upper impactature bound must be higher than the lower bound.", m_upperBound > m_lowerBound);
25}
26
28{
29 const long nPositions = getNPositions();
30 return linspace<float>(m_lowerBound, m_upperBound, nPositions);
31}
32
34{
35 const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
36 return nPositions;
37}
38
40{
41 const double overlapWidthRatio = static_cast<double>(m_nOverlap) / m_nWidth;
42 const double width = (m_upperBound - m_lowerBound) / (m_nBins * (1 - overlapWidthRatio) + overlapWidthRatio);
43 return width;
44}
45
47{
48 return getBinWidth() * m_nOverlap / m_nWidth;
49}
long getNPositions() const
Getter for the number of bounds.
Definition ImpactRep.cc:33
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
Construct the array of discrete impact positions.
Definition ImpactRep.cc:27
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:16
double getBinWidth() const
Getter for the bin width in real impact to investigate the value that results from the discrete overl...
Definition ImpactRep.cc:39
double m_upperBound
Upper bound of the binning range.
Definition ImpactRep.h:64
long m_nBins
Number of accessible 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:46
Abstract base class for different kinds of events.