LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::ThreeDShowersAlgorithm::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 52 of file ThreeDShowersAlgorithm.h.

Constructor & Destructor Documentation

lar_content::ThreeDShowersAlgorithm::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 348 of file ThreeDShowersAlgorithm.cc.

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

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

Member Function Documentation

StatusCode lar_content::ThreeDShowersAlgorithm::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 370 of file ThreeDShowersAlgorithm.cc.

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

371 {
372  if (((x - m_minX) < -std::numeric_limits<float>::epsilon()) || ((x - m_maxX) > +std::numeric_limits<float>::epsilon()))
373  return STATUS_CODE_NOT_FOUND;
374 
375  xBin = static_cast<int>(0.5f + m_nPoints * (x - m_minX) / (m_maxX - m_minX));
376  return STATUS_CODE_SUCCESS;
377 }
Float_t x
Definition: compare.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.
float m_minX
The min x value of the common x-overlap range.

Member Data Documentation

float lar_content::ThreeDShowersAlgorithm::XSampling::m_maxX

The max x value of the common x-overlap range.

Definition at line 81 of file ThreeDShowersAlgorithm.h.

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

float lar_content::ThreeDShowersAlgorithm::XSampling::m_minX

The min x value of the common x-overlap range.

Definition at line 80 of file ThreeDShowersAlgorithm.h.

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

float lar_content::ThreeDShowersAlgorithm::XSampling::m_nPoints

The number of sampling points to be used.

Definition at line 83 of file ThreeDShowersAlgorithm.h.

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

float lar_content::ThreeDShowersAlgorithm::XSampling::m_uMaxX

The max x value in the u view.

Definition at line 75 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_uMinX

The min x value in the u view.

Definition at line 74 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_vMaxX

The max x value in the v view.

Definition at line 77 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_vMinX

The min x value in the v view.

Definition at line 76 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_wMaxX

The max x value in the w view.

Definition at line 79 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_wMinX

The min x value in the w view.

Definition at line 78 of file ThreeDShowersAlgorithm.h.

float lar_content::ThreeDShowersAlgorithm::XSampling::m_xOverlapSpan

The x-overlap span.

Definition at line 82 of file ThreeDShowersAlgorithm.h.


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