Belle II Software development
Phi0BinsSpec Class Reference

Strategy to construct discrete phi0 points from discrete overlap specifications. More...

#include <Phi0Rep.h>

Public Member Functions

 Phi0BinsSpec (long nBins, int nOverlap, int nWidth)
 Constructor from fixed number of accessible bins and overlap specification in discrete number of positions.
 
DiscretePhi0::Array constructArray () const
 Construct the array of discrete phi0 positions.
 
long getNPositions () const
 Getter for the number of bounds.
 
double getBinWidth () const
 Getter for the bin width in real phi0 to investigate the value that results from the discrete overlap specification.
 
double getOverlap () const
 Getter for the overlap in real phi0 to investigate the value that results from the discrete overlap specification.
 
int getNOverlap () const
 Getter for the overlap in discrete number of positions.
 

Private Attributes

long m_nBins
 Number of accessible bins.
 
int m_nOverlap = 1
 Overlap of the leaves in phi0 counted in number of discrete values.
 
int m_nWidth = 3
 Width of the leaves at the maximal level in phi0 counted in number of discrete values.
 

Detailed Description

Strategy to construct discrete phi0 points from discrete overlap specifications.

Definition at line 20 of file Phi0Rep.h.

Constructor & Destructor Documentation

◆ Phi0BinsSpec()

Phi0BinsSpec ( long  nBins,
int  nOverlap,
int  nWidth 
)

Constructor from fixed number of accessible bins and overlap specification in discrete number of positions.

Definition at line 15 of file Phi0Rep.cc.

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}
int m_nOverlap
Overlap of the leaves in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:57
int m_nWidth
Width of the leaves at the maximal level in phi0 counted in number of discrete values.
Definition: Phi0Rep.h:60
long m_nBins
Number of accessible bins.
Definition: Phi0Rep.h:54

Member Function Documentation

◆ constructArray()

DiscretePhi0::Array constructArray ( ) const

Construct the array of discrete phi0 positions.

Definition at line 23 of file Phi0Rep.cc.

24{
25 const long nPositions = getNPositions();
26 const double overlap = getOverlap();
27 // Adjust the angle bounds such that overlap occurs 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}
long getNPositions() const
Getter for the number of bounds.
Definition: Phi0Rep.cc:33
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)
Constructs a unit vector with azimuth angle equal to phi.
Definition: Vector2D.h:62

◆ getBinWidth()

double getBinWidth ( ) const

Getter for the bin width in real phi0 to investigate the value that results from the discrete overlap specification.

Definition at line 39 of file Phi0Rep.cc.

40{
41 return 2.0 * M_PI / m_nBins + getOverlap();
42}

◆ getNOverlap()

int getNOverlap ( ) const
inline

Getter for the overlap in discrete number of positions.

Definition at line 47 of file Phi0Rep.h.

48 {
49 return m_nOverlap;
50 }

◆ getNPositions()

long getNPositions ( ) const

Getter for the number of bounds.

Definition at line 33 of file Phi0Rep.cc.

34{
35 const long nPositions = (m_nWidth - m_nOverlap) * m_nBins + m_nOverlap + 1;
36 return nPositions;
37}

◆ getOverlap()

double getOverlap ( ) const

Getter for the overlap in real phi0 to investigate the value that results from the discrete overlap specification.

Definition at line 44 of file Phi0Rep.cc.

45{
46 // Overlap carefully calculated such that the overlap also occurs 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}

Member Data Documentation

◆ m_nBins

long m_nBins
private

Number of accessible bins.

Definition at line 54 of file Phi0Rep.h.

◆ m_nOverlap

int m_nOverlap = 1
private

Overlap of the leaves in phi0 counted in number of discrete values.

Definition at line 57 of file Phi0Rep.h.

◆ m_nWidth

int m_nWidth = 3
private

Width of the leaves at the maximal level in phi0 counted in number of discrete values.

Definition at line 60 of file Phi0Rep.h.


The documentation for this class was generated from the following files: