LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::ThreeViewShowersAlgorithm::XSampling Class Reference

XSampling class. More...

Public Member Functions

 XSampling (const TwoDSlidingFitResult &fitResultU, const TwoDSlidingFitResult &fitResultV, const TwoDSlidingFitResult &fitResultW)
 Constructor. More...
 
pandora::StatusCode GetBin (const float x, int &xBin) const
 Convert an x position into a sampling bin. More...
 

Public Attributes

float m_uMinX
 The min x value in the u view. More...
 
float m_uMaxX
 The max x value in the u view. More...
 
float m_vMinX
 The min x value in the v view. More...
 
float m_vMaxX
 The max x value in the v view. More...
 
float m_wMinX
 The min x value in the w view. More...
 
float m_wMaxX
 The max x value in the w view. More...
 
float m_minX
 The min x value of the common x-overlap range. More...
 
float m_maxX
 The max x value of the common x-overlap range. More...
 
float m_xOverlapSpan
 The x-overlap span. More...
 
float m_nPoints
 The number of sampling points to be used. More...
 

Detailed Description

XSampling class.

Definition at line 55 of file ThreeViewShowersAlgorithm.h.

Constructor & Destructor Documentation

lar_content::ThreeViewShowersAlgorithm::XSampling::XSampling ( const TwoDSlidingFitResult fitResultU,
const TwoDSlidingFitResult fitResultV,
const TwoDSlidingFitResult fitResultW 
)

Constructor.

Parameters
fitResultUthe sliding fit result for the u view
fitResultVthe sliding fit result for the v view
fitResultWthe sliding fit result for the w view

Definition at line 346 of file ThreeViewShowersAlgorithm.cc.

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

348 {
349  fitResultU.GetMinAndMaxX(m_uMinX, m_uMaxX);
350  fitResultV.GetMinAndMaxX(m_vMinX, m_vMaxX);
351  fitResultW.GetMinAndMaxX(m_wMinX, m_wMaxX);
352  m_minX = std::max(m_uMinX, std::max(m_vMinX, m_wMinX));
353  m_maxX = std::min(m_uMaxX, std::min(m_vMaxX, m_wMaxX));
355  m_nPoints = 1.f;
356 
357  if (m_xOverlapSpan > std::numeric_limits<float>::epsilon())
358  {
359  const float nPointsU(
360  std::fabs((m_xOverlapSpan / (m_uMaxX - m_uMinX)) * static_cast<float>(fitResultU.GetMaxLayer() - fitResultU.GetMinLayer())));
361  const float nPointsV(
362  std::fabs((m_xOverlapSpan / (m_vMaxX - m_vMinX)) * static_cast<float>(fitResultV.GetMaxLayer() - fitResultV.GetMinLayer())));
363  const float nPointsW(
364  std::fabs((m_xOverlapSpan / (m_wMaxX - m_wMinX)) * static_cast<float>(fitResultW.GetMaxLayer() - fitResultW.GetMinLayer())));
365  m_nPoints = 1.f + ((nPointsU + nPointsV + nPointsW) / 3.f);
366  }
367 }
float m_minX
The min x value of the common x-overlap range.
TFile f
Definition: plotHisto.C:6
float m_nPoints
The number of sampling points to be used.
float m_maxX
The max x value of the common x-overlap range.

Member Function Documentation

StatusCode lar_content::ThreeViewShowersAlgorithm::XSampling::GetBin ( const float  x,
int &  xBin 
) const

Convert an x position into a sampling bin.

Parameters
xthe input x coordinate
xBinto receive the x bin
Returns
status code, faster than throwing in regular use-cases

Definition at line 371 of file ThreeViewShowersAlgorithm.cc.

Referenced by lar_content::ThreeViewShowersAlgorithm::GetBestHitOverlapFraction(), and lar_content::ThreeViewShowersAlgorithm::GetShowerPositionMaps().

372 {
373  if (((x - m_minX) < -std::numeric_limits<float>::epsilon()) || ((x - m_maxX) > +std::numeric_limits<float>::epsilon()))
374  return STATUS_CODE_NOT_FOUND;
375 
376  xBin = static_cast<int>(0.5f + m_nPoints * (x - m_minX) / (m_maxX - m_minX));
377  return STATUS_CODE_SUCCESS;
378 }
Float_t x
Definition: compare.C:6
float m_minX
The min x value of the common x-overlap range.
float m_nPoints
The number of sampling points to be used.
float m_maxX
The max x value of the common x-overlap range.

Member Data Documentation

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_maxX
float lar_content::ThreeViewShowersAlgorithm::XSampling::m_minX
float lar_content::ThreeViewShowersAlgorithm::XSampling::m_nPoints

The number of sampling points to be used.

Definition at line 86 of file ThreeViewShowersAlgorithm.h.

Referenced by lar_content::ThreeViewShowersAlgorithm::GetShowerPositionMaps().

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_uMaxX

The max x value in the u view.

Definition at line 78 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_uMinX

The min x value in the u view.

Definition at line 77 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_vMaxX

The max x value in the v view.

Definition at line 80 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_vMinX

The min x value in the v view.

Definition at line 79 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_wMaxX

The max x value in the w view.

Definition at line 82 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_wMinX

The min x value in the w view.

Definition at line 81 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::XSampling::m_xOverlapSpan

The x-overlap span.

Definition at line 85 of file ThreeViewShowersAlgorithm.h.


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