Public Member Functions | Public Attributes | List of all members
lar_content::BoundedClusterMopUpAlgorithm::XSampling Class Reference

XSampling class. More...

Public Member Functions

 XSampling (const TwoDSlidingFitResult &fitResult)
 Constructor. More...
 
int GetBin (const float x) const
 Convert an x position into a sampling bin. More...
 

Public Attributes

float m_minX
 The min x value. More...
 
float m_maxX
 The max x value. More...
 
int m_nPoints
 The number of sampling points to be used. More...
 

Detailed Description

XSampling class.

Definition at line 36 of file BoundedClusterMopUpAlgorithm.h.

Constructor & Destructor Documentation

lar_content::BoundedClusterMopUpAlgorithm::XSampling::XSampling ( const TwoDSlidingFitResult fitResult)

Constructor.

Parameters
fitResultthe sliding fit result

Definition at line 136 of file BoundedClusterMopUpAlgorithm.cc.

137 {
138  fitResult.GetMinAndMaxX(m_minX, m_maxX);
139 
140  m_nPoints = 1 + fitResult.GetMaxLayer() - fitResult.GetMinLayer();
141 
142  if (((m_maxX - m_minX) < std::numeric_limits<float>::epsilon()) || (0 >= m_nPoints))
143  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
144 }
int m_nPoints
The number of sampling points to be used.

Member Function Documentation

int lar_content::BoundedClusterMopUpAlgorithm::XSampling::GetBin ( const float  x) const

Convert an x position into a sampling bin.

Parameters
xthe input x coordinate

Definition at line 148 of file BoundedClusterMopUpAlgorithm.cc.

149 {
150  if (((x - m_minX) < -std::numeric_limits<float>::epsilon()) || ((x - m_maxX) > +std::numeric_limits<float>::epsilon()))
151  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
152 
153  return static_cast<int>(0.5f + static_cast<float>(m_nPoints) * (x - m_minX) / (m_maxX - m_minX));
154 }
int m_nPoints
The number of sampling points to be used.
list x
Definition: train.py:276

Member Data Documentation

float lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_maxX

The max x value.

Definition at line 54 of file BoundedClusterMopUpAlgorithm.h.

float lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_minX

The min x value.

Definition at line 53 of file BoundedClusterMopUpAlgorithm.h.

int lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_nPoints

The number of sampling points to be used.

Definition at line 55 of file BoundedClusterMopUpAlgorithm.h.


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