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