Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
lar_content::TwoDSlidingShowerFitResult Class Reference

TwoDSlidingShowerFitResult class. More...

#include <LArTwoDSlidingShowerFitResult.h>

Public Member Functions

template<typename T >
 TwoDSlidingShowerFitResult (const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch, const float showerEdgeMultiplier=1.f)
 Constructor. More...
 
const TwoDSlidingFitResultGetShowerFitResult () const
 Get the sliding fit result for the full shower cluster. More...
 
const TwoDSlidingFitResultGetNegativeEdgeFitResult () const
 Get the sliding fit result for the negative shower edge. More...
 
const TwoDSlidingFitResultGetPositiveEdgeFitResult () const
 Get the sliding fit result for the positive shower edge. More...
 
void GetShowerEdges (const float x, const bool widenIfAmbiguity, pandora::FloatVector &edgePositions) const
 Get the most appropriate shower edges at a given x coordinate. More...
 

Private Types

typedef std::pair< float, float > FitCoordinate
 
typedef std::vector< FitCoordinateFitCoordinateList
 
typedef std::map< int, FitCoordinateListFitCoordinateMap
 

Static Private Member Functions

static TwoDSlidingFitResult LArTwoDShowerEdgeFit (const pandora::Cluster *const pCluster, const TwoDSlidingFitResult &fullShowerFit, const ShowerEdge showerEdge, const float showerEdgeMultiplier)
 Perform two dimensional sliding fit to shower edge, using specified primary axis. More...
 
static TwoDSlidingFitResult LArTwoDShowerEdgeFit (const pandora::CartesianPointVector *const pPointVector, const TwoDSlidingFitResult &fullShowerFit, const ShowerEdge showerEdge, const float showerEdgeMultiplier)
 Perform two dimensional sliding fit to shower edge, using specified primary axis. More...
 

Private Attributes

TwoDSlidingFitResult m_showerFitResult
 The sliding fit result for the full shower cluster. More...
 
TwoDSlidingFitResult m_negativeEdgeFitResult
 The sliding fit result for the negative shower edge. More...
 
TwoDSlidingFitResult m_positiveEdgeFitResult
 The sliding fit result for the positive shower edge. More...
 

Detailed Description

TwoDSlidingShowerFitResult class.

Definition at line 34 of file LArTwoDSlidingShowerFitResult.h.

Member Typedef Documentation

typedef std::pair<float, float> lar_content::TwoDSlidingShowerFitResult::FitCoordinate
private

Definition at line 106 of file LArTwoDSlidingShowerFitResult.h.

Definition at line 107 of file LArTwoDSlidingShowerFitResult.h.

Definition at line 108 of file LArTwoDSlidingShowerFitResult.h.

Constructor & Destructor Documentation

template<typename T >
template lar_content::TwoDSlidingShowerFitResult::TwoDSlidingShowerFitResult ( const T *const  pT,
const unsigned int  slidingFitWindow,
const float  slidingFitLayerPitch,
const float  showerEdgeMultiplier = 1.f 
)

Constructor.

Parameters
pTdescribing the positions to be fitted
slidingFitWindowthe sliding fit window
slidingFitLayerPitchthe sliding fit z pitch, units cm
showerEdgeMultiplierartificially tune width of shower envelope so as to make it more/less inclusive

Definition at line 25 of file LArTwoDSlidingShowerFitResult.cc.

26  :
27  m_showerFitResult(TwoDSlidingFitResult(pT, slidingFitWindow, slidingFitLayerPitch)),
30 {
31 }
static TwoDSlidingFitResult LArTwoDShowerEdgeFit(const pandora::Cluster *const pCluster, const TwoDSlidingFitResult &fullShowerFit, const ShowerEdge showerEdge, const float showerEdgeMultiplier)
Perform two dimensional sliding fit to shower edge, using specified primary axis. ...
TwoDSlidingFitResult m_showerFitResult
The sliding fit result for the full shower cluster.
TwoDSlidingFitResult m_negativeEdgeFitResult
The sliding fit result for the negative shower edge.
TwoDSlidingFitResult m_positiveEdgeFitResult
The sliding fit result for the positive shower edge.

Member Function Documentation

const TwoDSlidingFitResult & lar_content::TwoDSlidingShowerFitResult::GetNegativeEdgeFitResult ( ) const
inline

Get the sliding fit result for the negative shower edge.

Returns
the sliding fit result for the negative shower edge

Definition at line 174 of file LArTwoDSlidingShowerFitResult.h.

175 {
177 }
TwoDSlidingFitResult m_negativeEdgeFitResult
The sliding fit result for the negative shower edge.
const TwoDSlidingFitResult & lar_content::TwoDSlidingShowerFitResult::GetPositiveEdgeFitResult ( ) const
inline

Get the sliding fit result for the positive shower edge.

Returns
the sliding fit result for the positive shower edge

Definition at line 181 of file LArTwoDSlidingShowerFitResult.h.

182 {
184 }
TwoDSlidingFitResult m_positiveEdgeFitResult
The sliding fit result for the positive shower edge.
void lar_content::TwoDSlidingShowerFitResult::GetShowerEdges ( const float  x,
const bool  widenIfAmbiguity,
pandora::FloatVector edgePositions 
) const

Get the most appropriate shower edges at a given x coordinate.

Parameters
xthe x coordinate
widenIfAmbiguitywhether to widen the shower edges in cases of ambiguities (i.e. be generous)
edgePositionsto receive the list of intersections of the shower fit at the given x coordinate

Definition at line 35 of file LArTwoDSlidingShowerFitResult.cc.

36 {
37  edgePositions.clear();
38  CartesianPointVector fitPositionVector;
39  PANDORA_THROW_RESULT_IF_AND_IF(
40  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, this->GetNegativeEdgeFitResult().GetGlobalFitPositionListAtX(x, fitPositionVector));
41  PANDORA_THROW_RESULT_IF_AND_IF(
42  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, this->GetPositiveEdgeFitResult().GetGlobalFitPositionListAtX(x, fitPositionVector));
43 
44  if (fitPositionVector.size() < 2)
45  {
46  float minXn(0.f), maxXn(0.f), minXp(0.f), maxXp(0.f);
47  this->GetNegativeEdgeFitResult().GetMinAndMaxX(minXn, maxXn);
48  this->GetPositiveEdgeFitResult().GetMinAndMaxX(minXp, maxXp);
49  const float minX(std::min(minXn, minXp)), maxX(std::max(maxXn, maxXp));
50 
51  if ((x < minX) || (x > maxX))
52  return;
53 
54  float minZn(0.f), maxZn(0.f), minZp(0.f), maxZp(0.f);
55  this->GetNegativeEdgeFitResult().GetMinAndMaxZ(minZn, maxZn);
56  this->GetPositiveEdgeFitResult().GetMinAndMaxZ(minZp, maxZp);
57  const float minZ(std::min(minZn, minZp)), maxZ(std::max(maxZn, maxZp));
58 
59  if (!widenIfAmbiguity)
60  {
61  return;
62  }
63  else if (fitPositionVector.empty())
64  {
65  fitPositionVector.push_back(CartesianVector(x, 0.f, minZ));
66  fitPositionVector.push_back(CartesianVector(x, 0.f, maxZ));
67  }
68  else if (1 == fitPositionVector.size())
69  {
70  // ATTN Could improve sophistication of choice of second bounding edge
71  const float existingEdge(fitPositionVector.front().GetZ());
72  const float secondEdge((std::fabs(existingEdge - minZ) < std::fabs(existingEdge - maxZ)) ? minZ : maxZ);
73  fitPositionVector.push_back(CartesianVector(x, 0.f, secondEdge));
74  }
75  }
76 
77  FloatVector localEdgePositions;
78  for (const CartesianVector &fitPosition : fitPositionVector)
79  localEdgePositions.push_back(fitPosition.GetZ());
80 
81  if (localEdgePositions.size() < 2)
82  throw StatusCodeException(STATUS_CODE_FAILURE);
83 
84  std::sort(localEdgePositions.begin(), localEdgePositions.end());
85  edgePositions.push_back(localEdgePositions.front());
86  edgePositions.push_back(localEdgePositions.back());
87 }
void GetMinAndMaxX(float &minX, float &maxX) const
Get the minimum and maximum x coordinates associated with the sliding fit.
void GetMinAndMaxZ(float &minZ, float &maxZ) const
Get the minimum and maximum z coordinates associated with the sliding fit.
const TwoDSlidingFitResult & GetPositiveEdgeFitResult() const
Get the sliding fit result for the positive shower edge.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
const TwoDSlidingFitResult & GetNegativeEdgeFitResult() const
Get the sliding fit result for the negative shower edge.
list x
Definition: train.py:276
Dft::FloatVector FloatVector
const TwoDSlidingFitResult & lar_content::TwoDSlidingShowerFitResult::GetShowerFitResult ( ) const
inline

Get the sliding fit result for the full shower cluster.

Returns
the sliding fit result for the full shower cluster

Definition at line 167 of file LArTwoDSlidingShowerFitResult.h.

168 {
169  return m_showerFitResult;
170 }
TwoDSlidingFitResult m_showerFitResult
The sliding fit result for the full shower cluster.
static TwoDSlidingFitResult lar_content::TwoDSlidingShowerFitResult::LArTwoDShowerEdgeFit ( const pandora::Cluster *const  pCluster,
const TwoDSlidingFitResult fullShowerFit,
const ShowerEdge  showerEdge,
const float  showerEdgeMultiplier 
)
staticprivate

Perform two dimensional sliding fit to shower edge, using specified primary axis.

Parameters
pClusterthe address of the input cluster
fullShowerFitthe result of fitting the full shower
showerEdgethe shower edge
showerEdgeMultiplierartificially tune width of shower envelope so as to make it more/less inclusive
Returns
the shower edge fit result
static TwoDSlidingFitResult lar_content::TwoDSlidingShowerFitResult::LArTwoDShowerEdgeFit ( const pandora::CartesianPointVector *const  pPointVector,
const TwoDSlidingFitResult fullShowerFit,
const ShowerEdge  showerEdge,
const float  showerEdgeMultiplier 
)
staticprivate

Perform two dimensional sliding fit to shower edge, using specified primary axis.

Parameters
pPointVectorthe address of the input point vector
fullShowerFitthe result of fitting the full shower
showerEdgethe shower edge
showerEdgeMultiplierartificially tune width of shower envelope so as to make it more/less inclusive
Returns
the shower edge fit result

Member Data Documentation

TwoDSlidingFitResult lar_content::TwoDSlidingShowerFitResult::m_negativeEdgeFitResult
private

The sliding fit result for the negative shower edge.

Definition at line 111 of file LArTwoDSlidingShowerFitResult.h.

TwoDSlidingFitResult lar_content::TwoDSlidingShowerFitResult::m_positiveEdgeFitResult
private

The sliding fit result for the positive shower edge.

Definition at line 112 of file LArTwoDSlidingShowerFitResult.h.

TwoDSlidingFitResult lar_content::TwoDSlidingShowerFitResult::m_showerFitResult
private

The sliding fit result for the full shower cluster.

Definition at line 110 of file LArTwoDSlidingShowerFitResult.h.


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