Belle II Software  release-05-01-25
Phi0Rep.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/Phi0Rep.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 Phi0BinsSpec::Phi0BinsSpec(long nBins, int nOverlap, int nWidth)
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 }
24 
26 {
27  const long nPositions = getNPositions();
28  const double overlap = getOverlap();
29  // Adjust the angle bounds such that overlap occures at the wrap around as well
30  const double lowerBound = -M_PI - overlap / 2;
31  const double upperBound = +M_PI + overlap / 2;
32  return linspace<Vector2D>(lowerBound, upperBound, nPositions, &(Vector2D::Phi));
33 }
34 
36 {
37  const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
38  return nPositions;
39 }
40 
42 {
43  return 2.0 * M_PI / m_nBins + getOverlap();
44 }
45 
47 {
48  // Overlap carefully calculated such that the overlap also occures at
49  // the wrap around near M_PI to -M_PI with the same with without spoiling the
50  // linearity of the binning.
51  const double overlap = 2.0 * M_PI * m_nOverlap / (m_nBins * (m_nWidth - m_nOverlap));
52  return overlap;
53 }
Belle2::TrackFindingCDC::Phi0BinsSpec::m_nWidth
int m_nWidth
Width of the leaves at the maximal level in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:70
Belle2::TrackFindingCDC::Phi0BinsSpec::getBinWidth
double getBinWidth() const
Getter for the bin width in real phi0 to investigate the value that results from the discrete overlap...
Definition: Phi0Rep.cc:41
Belle2::TrackFindingCDC::Vector2D::Phi
static Vector2D Phi(const double phi)
Constucts a unit vector with azimuth angle equal to phi.
Definition: Vector2D.h:73
Belle2::TrackFindingCDC::Phi0BinsSpec::m_nOverlap
int m_nOverlap
Overlap of the leaves in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:67
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Phi0BinsSpec::getNPositions
long getNPositions() const
Getter for the number of bounds.
Definition: Phi0Rep.cc:35
Belle2::TrackFindingCDC::Phi0BinsSpec::constructArray
DiscretePhi0::Array constructArray() const
Constuct the array of discrete phi0 positions.
Definition: Phi0Rep.cc:25
Belle2::TrackFindingCDC::Phi0BinsSpec::m_nBins
long m_nBins
Number of accessable bins.
Definition: Phi0Rep.h:64
Belle2::TrackFindingCDC::Phi0BinsSpec::getOverlap
double getOverlap() const
Getter for the overlap in real phi0 to investigate the value that results from the discrete overlap s...
Definition: Phi0Rep.cc:46
Belle2::TrackFindingCDC::Phi0BinsSpec::Phi0BinsSpec
Phi0BinsSpec(long nBins, int nOverlap, int nWidth)
Constructor from fixed number of accessable bins and overlap specification in discrete number of posi...
Definition: Phi0Rep.cc:17
Belle2::TrackFindingCDC::DiscreteValue::Array
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:65