Belle II Software development
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/trackingUtilities/numerics/LookupTable.h>
10#include <framework/logging/Logger.h>
11
12using namespace Belle2;
13using namespace TrackFindingCDC;
14using namespace TrackingUtilities;
15
16Phi0BinsSpec::Phi0BinsSpec(long nBins, int nOverlap, int nWidth)
17 : m_nBins(nBins)
18 , m_nOverlap(nOverlap)
19 , m_nWidth(nWidth)
20{
21 B2ASSERT("Overlap must be smaller than the width.", m_nWidth > m_nOverlap);
22}
23
25{
26 const long nPositions = getNPositions();
27 const double overlap = getOverlap();
28 // Adjust the angle bounds such that overlap occurs at the wrap around as well
29 const double lowerBound = -M_PI - overlap / 2;
30 const double upperBound = +M_PI + overlap / 2;
31 return linspace<Vector2D>(lowerBound, upperBound, nPositions, &(Vector2D::Phi));
32}
33
35{
36 const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
37 return nPositions;
38}
39
41{
42 return 2.0 * M_PI / m_nBins + getOverlap();
43}
44
46{
47 // Overlap carefully calculated such that the overlap also occurs at
48 // the wrap around near M_PI to -M_PI with the same with without spoiling the
49 // linearity of the binning.
50 const double overlap = 2.0 * M_PI * m_nOverlap / (m_nBins * (m_nWidth - m_nOverlap));
51 return overlap;
52}
long getNPositions() const
Getter for the number of bounds.
Definition Phi0Rep.cc:34
int m_nOverlap
Overlap of the leaves in phi0 counted in number of discrete values.
Definition Phi0Rep.h:57
DiscretePhi0::Array constructArray() const
Construct the array of discrete phi0 positions.
Definition Phi0Rep.cc:24
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 accessible bins and overlap specification in discrete number of posi...
Definition Phi0Rep.cc:16
double getBinWidth() const
Getter for the bin width in real phi0 to investigate the value that results from the discrete overlap...
Definition Phi0Rep.cc:40
long m_nBins
Number of accessible 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:45
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
Definition Vector2D.h:82
Abstract base class for different kinds of events.