LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 147 of file BoundedClusterMopUpAlgorithm.cc.

References lar_content::TwoDSlidingFitResult::GetMaxLayer(), lar_content::TwoDSlidingFitResult::GetMinAndMaxX(), and lar_content::TwoDSlidingFitResult::GetMinLayer().

148 {
149  fitResult.GetMinAndMaxX(m_minX, m_maxX);
150 
151  m_nPoints = 1 + fitResult.GetMaxLayer() - fitResult.GetMinLayer();
152 
153  if (((m_maxX - m_minX) < std::numeric_limits<float>::epsilon()) || (0 >= m_nPoints))
154  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
155 }
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 159 of file BoundedClusterMopUpAlgorithm.cc.

Referenced by lar_content::BoundedClusterMopUpAlgorithm::GetBoundedFraction(), and lar_content::BoundedClusterMopUpAlgorithm::GetShowerPositionMap().

160 {
161  if (((x - m_minX) < -std::numeric_limits<float>::epsilon()) || ((x - m_maxX) > +std::numeric_limits<float>::epsilon()))
162  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
163 
164  return static_cast<int>(0.5f + static_cast<float>(m_nPoints) * (x - m_minX) / (m_maxX - m_minX));
165 }
Float_t x
Definition: compare.C:6
int m_nPoints
The number of sampling points to be used.

Member Data Documentation

float lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_maxX
float lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_minX
int lar_content::BoundedClusterMopUpAlgorithm::XSampling::m_nPoints

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