Belle II Software development
ImpactBinsSpec Class Reference

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

#include <ImpactRep.h>

Public Member Functions

 ImpactBinsSpec (double lowerBound, double upperBound, long nBins, int nOverlap, int nWidth)
 Constructs a specification for equally spaced discrete impactature values with discrete overlap specification.
 
DiscreteImpact::Array constructArray () const
 Constuct the array of discrete impact positions.
 
long getNPositions () const
 Getter for the number of bounds.
 
double getBinWidth () const
 Getter for the bin width in real impact to investigate the value that results from the discrete overlap specification.
 
double getOverlap () const
 Getter for the overlap in real impact to investigate the value that results from the discrete overlap specification.
 
long getNOverlap () const
 Getter for the overlap in discrete number of positions.
 

Private Attributes

double m_lowerBound
 Lower bound of the binning range.
 
double m_upperBound
 Upper bound of the binning range.
 
long m_nBins
 Number of accessable bins.
 
int m_nOverlap = 1
 Overlap of the leaves in impact counted in number of discrete values.
 
int m_nWidth = 3
 Width of the leaves at the maximal level in impact counted in number of discrete values.
 

Detailed Description

Strategy to construct discrete impact points from discrete overlap specifications.

Definition at line 19 of file ImpactRep.h.

Constructor & Destructor Documentation

◆ ImpactBinsSpec()

ImpactBinsSpec ( double  lowerBound,
double  upperBound,
long  nBins,
int  nOverlap,
int  nWidth 
)

Constructs a specification for equally spaced discrete impactature values with discrete overlap specification.

Parameters
lowerBoundLower bound of the value range
upperBoundUpper bound of the value range
nBinsTotal number of final bins to be constructed
nWidthNumber of discrete values in each bin (counted semi open [start, stop)).
nOverlapNumber of discrete values that overlapping bins have in common (counted semi open [start, stop)).

Definition at line 15 of file ImpactRep.cc.

16 : m_lowerBound(lowerBound)
17 , m_upperBound(upperBound)
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 B2ASSERT("Upper impactature bound must be higher than the lower bound.", m_upperBound > m_lowerBound);
24}
int m_nOverlap
Overlap of the leaves in impact counted in number of discrete values.
Definition: ImpactRep.h:70
double m_lowerBound
Lower bound of the binning range.
Definition: ImpactRep.h:61
int m_nWidth
Width of the leaves at the maximal level in impact counted in number of discrete values.
Definition: ImpactRep.h:73
double m_upperBound
Upper bound of the binning range.
Definition: ImpactRep.h:64
long m_nBins
Number of accessable bins.
Definition: ImpactRep.h:67

Member Function Documentation

◆ constructArray()

DiscreteImpact::Array constructArray ( ) const

Constuct the array of discrete impact positions.

Definition at line 26 of file ImpactRep.cc.

27{
28 const long nPositions = getNPositions();
29 return linspace<float>(m_lowerBound, m_upperBound, nPositions);
30}
long getNPositions() const
Getter for the number of bounds.
Definition: ImpactRep.cc:32

◆ getBinWidth()

double getBinWidth ( ) const

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

Definition at line 38 of file ImpactRep.cc.

39{
40 const double overlapWidthRatio = static_cast<double>(m_nOverlap) / m_nWidth;
41 const double width = (m_upperBound - m_lowerBound) / (m_nBins * (1 - overlapWidthRatio) + overlapWidthRatio);
42 return width;
43}

◆ getNOverlap()

long getNOverlap ( ) const
inline

Getter for the overlap in discrete number of positions.

Definition at line 54 of file ImpactRep.h.

55 {
56 return m_nOverlap;
57 }

◆ getNPositions()

long getNPositions ( ) const

Getter for the number of bounds.

Definition at line 32 of file ImpactRep.cc.

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

◆ getOverlap()

double getOverlap ( ) const

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

Definition at line 45 of file ImpactRep.cc.

46{
47 return getBinWidth() * m_nOverlap / m_nWidth;
48}
double getBinWidth() const
Getter for the bin width in real impact to investigate the value that results from the discrete overl...
Definition: ImpactRep.cc:38

Member Data Documentation

◆ m_lowerBound

double m_lowerBound
private

Lower bound of the binning range.

Definition at line 61 of file ImpactRep.h.

◆ m_nBins

long m_nBins
private

Number of accessable bins.

Definition at line 67 of file ImpactRep.h.

◆ m_nOverlap

int m_nOverlap = 1
private

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

Definition at line 70 of file ImpactRep.h.

◆ m_nWidth

int m_nWidth = 3
private

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

Definition at line 73 of file ImpactRep.h.

◆ m_upperBound

double m_upperBound
private

Upper bound of the binning range.

Definition at line 64 of file ImpactRep.h.


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