LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 136 of file BoundedClusterMopUpAlgorithm.cc.

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

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.

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

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 }
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: