Belle II Software  release-08-01-10
Phi0Rep.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/Phi0Rep.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 Phi0BinsSpec::Phi0BinsSpec(long nBins, int nOverlap, int nWidth)
16  : m_nBins(nBins)
17  , m_nOverlap(nOverlap)
18  , m_nWidth(nWidth)
19 {
20  B2ASSERT("Overlap must be smaller than the width.", m_nWidth > m_nOverlap);
21 }
22 
24 {
25  const long nPositions = getNPositions();
26  const double overlap = getOverlap();
27  // Adjust the angle bounds such that overlap occures at the wrap around as well
28  const double lowerBound = -M_PI - overlap / 2;
29  const double upperBound = +M_PI + overlap / 2;
30  return linspace<Vector2D>(lowerBound, upperBound, nPositions, &(Vector2D::Phi));
31 }
32 
34 {
35  const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
36  return nPositions;
37 }
38 
40 {
41  return 2.0 * M_PI / m_nBins + getOverlap();
42 }
43 
45 {
46  // Overlap carefully calculated such that the overlap also occures at
47  // the wrap around near M_PI to -M_PI with the same with without spoiling the
48  // linearity of the binning.
49  const double overlap = 2.0 * M_PI * m_nOverlap / (m_nBins * (m_nWidth - m_nOverlap));
50  return overlap;
51 }
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: Phi0Rep.cc:33
int m_nOverlap
Overlap of the leaves in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:57
DiscretePhi0::Array constructArray() const
Constuct the array of discrete phi0 positions.
Definition: Phi0Rep.cc:23
int m_nWidth
Width of the leaves at the maximal level in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:60
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:15
double getBinWidth() const
Getter for the bin width in real phi0 to investigate the value that results from the discrete overlap...
Definition: Phi0Rep.cc:39
long m_nBins
Number of accessable bins.
Definition: Phi0Rep.h:54
double getOverlap() const
Getter for the overlap in real phi0 to investigate the value that results from the discrete overlap s...
Definition: Phi0Rep.cc:44
static Vector2D Phi(const double phi)
Constucts a unit vector with azimuth angle equal to phi.
Definition: Vector2D.h:71
Abstract base class for different kinds of events.