LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::ThreeDSlidingFitResult Class Reference

ThreeDSlidingFitResult class. More...

#include "LArThreeDSlidingFitResult.h"

Public Member Functions

template<typename T >
 ThreeDSlidingFitResult (const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch)
 Constructor. More...
 
const pandora::Cluster * GetCluster () const
 Get the address of the cluster. More...
 
const pandora::CartesianVector & GetAxisIntercept () const
 Get the axis intercept position. More...
 
const pandora::CartesianVector & GetAxisDirection () const
 Get the axis direction vector. More...
 
const TwoDSlidingFitResultGetFirstFitResult () const
 Get the first sliding fit result for this cluster. More...
 
const TwoDSlidingFitResultGetSecondFitResult () const
 Get the second sliding fit result for this cluster. More...
 
const pandora::CartesianVector & GetGlobalMinLayerPosition () const
 Get global position corresponding to the fit result in minimum fit layer. More...
 
const pandora::CartesianVector & GetGlobalMaxLayerPosition () const
 Get global position corresponding to the fit result in maximum fit layer. More...
 
const pandora::CartesianVector & GetGlobalMinLayerDirection () const
 Get global direction corresponding to the fit result in minimum fit layer. More...
 
const pandora::CartesianVector & GetGlobalMaxLayerDirection () const
 Get global direction corresponding to the fit result in maximum fit layer. More...
 
int GetMinLayer () const
 Get the minimum occupied layer in the sliding fit. More...
 
int GetMaxLayer () const
 Get the maximum occupied layer in the sliding fit. More...
 
float GetMinLayerRms () const
 Get rms at minimum layer. More...
 
float GetMaxLayerRms () const
 Get rms at maximum layer. More...
 
float GetFitRms (const float rL) const
 Get fit rms for a given longitudinal coordinate. More...
 
float GetLongitudinalDisplacement (const pandora::CartesianVector &position) const
 Get longitudinal projection onto primary axis. More...
 
pandora::StatusCode GetGlobalFitPosition (const float rL, pandora::CartesianVector &position) const
 Get global fit position for a given longitudinal coordinate. More...
 
pandora::StatusCode GetGlobalFitDirection (const float rL, pandora::CartesianVector &direction) const
 Get global fit direction for a given longitudinal coordinate. More...
 

Private Member Functions

void GetGlobalPosition (const float rL, const float rT1, const float rT2, pandora::CartesianVector &position) const
 Get global coordinates for a given pair of sliding linear fit coordinates. More...
 
void GetGlobalDirection (const float dTdL1, const float dTdL2, pandora::CartesianVector &direction) const
 Get global direction coordinates for a given pair of sliding linear fit gradients. More...
 

Static Private Member Functions

static pandora::TrackState GetPrimaryAxis (const pandora::Cluster *const pCluster, const float slidingFitLayerPitch)
 Calculate the position and direction of the primary axis. More...
 
static pandora::TrackState GetPrimaryAxis (const pandora::CartesianPointVector *const pPointVector, const float slidingFitLayerPitch)
 Calculate the position and direction of the primary axis. More...
 
static pandora::CartesianVector GetSeedDirection (const pandora::CartesianVector &axisDirection)
 Generate a seed vector to be used in calculating the orthogonal axes. More...
 

Private Attributes

const pandora::TrackState m_primaryAxis
 The primary axis position and direction. More...
 
const pandora::CartesianVector m_axisIntercept
 The axis intercept position. More...
 
const pandora::CartesianVector m_axisDirection
 The axis direction vector. More...
 
const pandora::CartesianVector m_firstOrthoDirection
 The orthogonal direction vector. More...
 
const pandora::CartesianVector m_secondOrthoDirection
 The orthogonal direction vector. More...
 
const TwoDSlidingFitResult m_firstFitResult
 The first sliding fit result. More...
 
const TwoDSlidingFitResult m_secondFitResult
 The second sliding fit result. More...
 
const int m_minLayer
 The minimum combined layer. More...
 
const int m_maxLayer
 The maximum combined layer. More...
 
pandora::CartesianVector m_minLayerPosition
 The global position at the minimum combined layer. More...
 
pandora::CartesianVector m_maxLayerPosition
 The global position at the maximum combined layer. More...
 
pandora::CartesianVector m_minLayerDirection
 The global direction at the minimum combined layer. More...
 
pandora::CartesianVector m_maxLayerDirection
 The global direction at the maximum combined layer. More...
 

Detailed Description

ThreeDSlidingFitResult class.

Definition at line 23 of file LArThreeDSlidingFitResult.h.

Constructor & Destructor Documentation

template<typename T >
template lar_content::ThreeDSlidingFitResult::ThreeDSlidingFitResult ( const T *const  pT,
const unsigned int  slidingFitWindow,
const float  slidingFitLayerPitch 
)

Constructor.

Parameters
pTdescribing the positions to be fitted
slidingFitWindowthe sliding fit window
slidingFitLayerPitchthe sliding fit z pitch, units cm

Definition at line 28 of file LArThreeDSlidingFitResult.cc.

References GetGlobalFitDirection(), GetGlobalFitPosition(), lar_content::TwoDSlidingFitResult::GetL(), m_firstFitResult, m_maxLayer, m_maxLayerDirection, m_maxLayerPosition, m_minLayer, m_minLayerDirection, and m_minLayerPosition.

Referenced by GetSeedDirection().

28  :
30  m_axisIntercept(m_primaryAxis.GetPosition()),
31  m_axisDirection(m_primaryAxis.GetMomentum()),
33  m_secondOrthoDirection(m_axisDirection.GetCrossProduct(m_firstOrthoDirection).GetUnitVector()),
34  m_firstFitResult(TwoDSlidingFitResult(pT, layerWindow, layerPitch, m_axisIntercept, m_axisDirection, m_firstOrthoDirection)),
35  m_secondFitResult(TwoDSlidingFitResult(pT, layerWindow, layerPitch, m_axisIntercept, m_axisDirection, m_secondOrthoDirection)),
38  m_minLayerPosition(0.f, 0.f, 0.f),
39  m_maxLayerPosition(0.f, 0.f, 0.f),
40  m_minLayerDirection(0.f, 0.f, 0.f),
41  m_maxLayerDirection(0.f, 0.f, 0.f)
42 {
43  if (m_minLayer > m_maxLayer)
44  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
45 
46  const float minL(m_firstFitResult.GetL(m_minLayer));
47  const float maxL(m_firstFitResult.GetL(m_maxLayer));
48 
49  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetGlobalFitPosition(minL, m_minLayerPosition));
50  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetGlobalFitPosition(maxL, m_maxLayerPosition));
51  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetGlobalFitDirection(minL, m_minLayerDirection));
52  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetGlobalFitDirection(maxL, m_maxLayerDirection));
53 }
const int m_maxLayer
The maximum combined layer.
static pandora::TrackState GetPrimaryAxis(const pandora::Cluster *const pCluster, const float slidingFitLayerPitch)
Calculate the position and direction of the primary axis.
const pandora::TrackState m_primaryAxis
The primary axis position and direction.
static pandora::CartesianVector GetSeedDirection(const pandora::CartesianVector &axisDirection)
Generate a seed vector to be used in calculating the orthogonal axes.
pandora::CartesianVector m_maxLayerPosition
The global position at the maximum combined layer.
TFile f
Definition: plotHisto.C:6
pandora::CartesianVector m_minLayerPosition
The global position at the minimum combined layer.
const int m_minLayer
The minimum combined layer.
Int_t max
Definition: plot.C:27
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
const pandora::CartesianVector m_secondOrthoDirection
The orthogonal direction vector.
const pandora::CartesianVector m_firstOrthoDirection
The orthogonal direction vector.
Int_t min
Definition: plot.C:26
float GetL(const int layer) const
Get longitudinal coordinate for a given sliding linear fit layer number.
pandora::CartesianVector m_minLayerDirection
The global direction at the minimum combined layer.
pandora::CartesianVector m_maxLayerDirection
The global direction at the maximum combined layer.
pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const
Get global fit position for a given longitudinal coordinate.
const pandora::CartesianVector m_axisDirection
The axis direction vector.

Member Function Documentation

const pandora::CartesianVector & lar_content::ThreeDSlidingFitResult::GetAxisDirection ( ) const
inline

Get the axis direction vector.

Returns
the axis direction vector

Definition at line 243 of file LArThreeDSlidingFitResult.h.

References m_axisDirection.

244 {
245  return m_axisDirection;
246 }
const pandora::CartesianVector m_axisDirection
The axis direction vector.
const pandora::CartesianVector & lar_content::ThreeDSlidingFitResult::GetAxisIntercept ( ) const
inline

Get the axis intercept position.

Returns
the axis intercept position

Definition at line 236 of file LArThreeDSlidingFitResult.h.

References m_axisIntercept.

237 {
238  return m_axisIntercept;
239 }
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
const pandora::Cluster * lar_content::ThreeDSlidingFitResult::GetCluster ( ) const

Get the address of the cluster.

Returns
the address of the cluster

Definition at line 57 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetCluster(), and m_firstFitResult.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster().

58 {
60 }
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
const TwoDSlidingFitResult & lar_content::ThreeDSlidingFitResult::GetFirstFitResult ( ) const
inline

Get the first sliding fit result for this cluster.

Returns
the first sliding fit result for this cluster

Definition at line 250 of file LArThreeDSlidingFitResult.h.

References m_firstFitResult.

Referenced by lar_content::CosmicRayTaggingTool::CRCandidate::CalculateFitVariables(), lar_content::NeutrinoHierarchyAlgorithm::PfoInfo::operator=(), lar_content::NeutrinoHierarchyAlgorithm::PfoInfo::PfoInfo(), and lar_content::ThreeDSlidingConeFitResult::ThreeDSlidingConeFitResult().

251 {
252  return m_firstFitResult;
253 }
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
float lar_content::ThreeDSlidingFitResult::GetFitRms ( const float  rL) const

Get fit rms for a given longitudinal coordinate.

Parameters
rLthe longitudinal coordinate
Returns
the fit rms

Definition at line 104 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetFitRms(), m_firstFitResult, and m_secondFitResult.

105 {
106  const float firstRms(m_firstFitResult.GetFitRms(rL));
107  const float secondRms(m_secondFitResult.GetFitRms(rL));
108 
109  return std::sqrt(firstRms * firstRms + secondRms * secondRms);
110 }
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
float GetFitRms(const float rL) const
Get fit rms for a given longitudinal coordinate.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
void lar_content::ThreeDSlidingFitResult::GetGlobalDirection ( const float  dTdL1,
const float  dTdL2,
pandora::CartesianVector &  direction 
) const
private

Get global direction coordinates for a given pair of sliding linear fit gradients.

Parameters
dTdL1the first transverse coordinate
dTdL2the second transverse coordinate
directionto receive the direction cartesian vector

Definition at line 194 of file LArThreeDSlidingFitResult.cc.

References f, lar_content::LArClusterHelper::GetCoordinateVector(), GetGlobalPosition(), GetPrimaryAxis(), m_axisIntercept, max, min, and lar_content::LArPcaHelper::RunPca().

Referenced by GetGlobalFitDirection().

195 {
196  const float pL(1.f / std::sqrt(1.f + dTdL1 * dTdL1 + dTdL2 * dTdL2));
197  const float pT1(dTdL1 / std::sqrt(1.f + dTdL1 * dTdL1 + dTdL2 * dTdL2));
198  const float pT2(dTdL2 / std::sqrt(1.f + dTdL1 * dTdL1 + dTdL2 * dTdL2));
199 
200  CartesianVector globalCoordinates(0.f, 0.f, 0.f);
201  this->GetGlobalPosition(pL, pT1, pT2, globalCoordinates);
202  direction = (globalCoordinates - m_axisIntercept).GetUnitVector();
203 }
TFile f
Definition: plotHisto.C:6
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
void GetGlobalPosition(const float rL, const float rT1, const float rT2, pandora::CartesianVector &position) const
Get global coordinates for a given pair of sliding linear fit coordinates.
StatusCode lar_content::ThreeDSlidingFitResult::GetGlobalFitDirection ( const float  rL,
pandora::CartesianVector &  direction 
) const

Get global fit direction for a given longitudinal coordinate.

Parameters
rLthe longitudinal coordinate
directionthe fitted direction at these coordinates
Returns
status code, faster than throwing in regular use-cases

Definition at line 154 of file LArThreeDSlidingFitResult.cc.

References f, GetGlobalDirection(), lar_content::TwoDSlidingFitResult::GetGlobalFitDirection(), lar_content::TwoDSlidingFitResult::GetLayer(), lar_content::TwoDSlidingFitResult::GetLocalDirection(), m_firstFitResult, m_maxLayer, m_minLayer, m_secondFitResult, max, and min.

Referenced by lar_content::CosmicRayTaggingTool::CRCandidate::CalculateFitVariables(), lar_content::LArPfoHelper::SlidingFitTrajectoryImpl(), lar_content::ThreeDSlidingConeFitResult::ThreeDSlidingConeFitResult(), and ThreeDSlidingFitResult().

155 {
156  // Check that input coordinates are between first and last layers
157  const int layer1(m_firstFitResult.GetLayer(rL));
158  const int layer2(m_secondFitResult.GetLayer(rL));
159 
160  if (std::min(layer1, layer2) < m_minLayer || std::max(layer1, layer2) > m_maxLayer)
161  return STATUS_CODE_INVALID_PARAMETER;
162 
163  // Get local directions from each sliding fit (TODO: Make this more efficient)
164  CartesianVector firstDirection(0.f, 0.f, 0.f), secondDirection(0.f, 0.f, 0.f);
165  const StatusCode statusCode1(m_firstFitResult.GetGlobalFitDirection(rL, firstDirection));
166 
167  if (STATUS_CODE_SUCCESS != statusCode1)
168  return statusCode1;
169 
170  const StatusCode statusCode2(m_secondFitResult.GetGlobalFitDirection(rL, secondDirection));
171 
172  if (STATUS_CODE_SUCCESS != statusCode2)
173  return statusCode2;
174 
175  float dTdL1(0.f), dTdL2(0.f);
176  m_firstFitResult.GetLocalDirection(firstDirection, dTdL1);
177  m_secondFitResult.GetLocalDirection(secondDirection, dTdL2);
178 
179  // Combine local directions to give an overall global direction
180  this->GetGlobalDirection(dTdL1, dTdL2, direction);
181 
182  return STATUS_CODE_SUCCESS;
183 }
const int m_maxLayer
The maximum combined layer.
void GetLocalDirection(const pandora::CartesianVector &direction, float &dTdL) const
Get local sliding fit gradient for a given global direction.
void GetGlobalDirection(const float dTdL1, const float dTdL2, pandora::CartesianVector &direction) const
Get global direction coordinates for a given pair of sliding linear fit gradients.
TFile f
Definition: plotHisto.C:6
const int m_minLayer
The minimum combined layer.
Int_t max
Definition: plot.C:27
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
Int_t min
Definition: plot.C:26
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.
StatusCode lar_content::ThreeDSlidingFitResult::GetGlobalFitPosition ( const float  rL,
pandora::CartesianVector &  position 
) const

Get global fit position for a given longitudinal coordinate.

Parameters
rLthe longitudinal coordinate
positionthe fitted position at these coordinates
Returns
status code, faster than throwing in regular use-cases

Definition at line 121 of file LArThreeDSlidingFitResult.cc.

References f, lar_content::TwoDSlidingFitResult::GetGlobalFitPosition(), GetGlobalPosition(), lar_content::TwoDSlidingFitResult::GetLayer(), lar_content::TwoDSlidingFitResult::GetLocalPosition(), m_firstFitResult, m_maxLayer, m_minLayer, m_secondFitResult, max, and min.

Referenced by lar_content::ThreeDHitCreationAlgorithm::GetChi2WrtFit(), lar_content::ThreeDHitCreationAlgorithm::RefineHitPositions(), lar_content::LArPfoHelper::SlidingFitTrajectoryImpl(), lar_content::ThreeDSlidingConeFitResult::ThreeDSlidingConeFitResult(), and ThreeDSlidingFitResult().

122 {
123  // Check that input coordinates are between first and last layers
124  const int layer1(m_firstFitResult.GetLayer(rL));
125  const int layer2(m_secondFitResult.GetLayer(rL));
126 
127  if (std::min(layer1, layer2) < m_minLayer || std::max(layer1, layer2) > m_maxLayer)
128  return STATUS_CODE_INVALID_PARAMETER;
129 
130  // Get local positions from each sliding fit (TODO: Make this more efficient)
131  CartesianVector firstPosition(0.f, 0.f, 0.f), secondPosition(0.f, 0.f, 0.f);
132  const StatusCode statusCode1(m_firstFitResult.GetGlobalFitPosition(rL, firstPosition));
133 
134  if (STATUS_CODE_SUCCESS != statusCode1)
135  return statusCode1;
136 
137  const StatusCode statusCode2(m_secondFitResult.GetGlobalFitPosition(rL, secondPosition));
138 
139  if (STATUS_CODE_SUCCESS != statusCode2)
140  return statusCode2;
141 
142  float rL1(0.f), rT1(0.f), rL2(0.f), rT2(0.f);
143  m_firstFitResult.GetLocalPosition(firstPosition, rL1, rT1);
144  m_secondFitResult.GetLocalPosition(secondPosition, rL2, rT2);
145 
146  // Combine local positions to give an overall global direction
147  this->GetGlobalPosition(rL, rT1, rT2, position);
148 
149  return STATUS_CODE_SUCCESS;
150 }
const int m_maxLayer
The maximum combined layer.
TFile f
Definition: plotHisto.C:6
const int m_minLayer
The minimum combined layer.
Int_t max
Definition: plot.C:27
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const
Get global fit position for a given longitudinal coordinate.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
void GetGlobalPosition(const float rL, const float rT1, const float rT2, pandora::CartesianVector &position) const
Get global coordinates for a given pair of sliding linear fit coordinates.
Int_t min
Definition: plot.C:26
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.
const pandora::CartesianVector & lar_content::ThreeDSlidingFitResult::GetGlobalMaxLayerDirection ( ) const
inline

Get global direction corresponding to the fit result in maximum fit layer.

Returns
the position

Definition at line 285 of file LArThreeDSlidingFitResult.h.

References m_maxLayerDirection.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster(), and lar_content::CosmicRayTaggingTool::GetPfoAssociations().

286 {
287  return m_maxLayerDirection;
288 }
pandora::CartesianVector m_maxLayerDirection
The global direction at the maximum combined layer.
const pandora::CartesianVector & lar_content::ThreeDSlidingFitResult::GetGlobalMinLayerDirection ( ) const
inline

Get global direction corresponding to the fit result in minimum fit layer.

Returns
the position

Definition at line 278 of file LArThreeDSlidingFitResult.h.

References m_minLayerDirection.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster(), and lar_content::CosmicRayTaggingTool::GetPfoAssociations().

279 {
280  return m_minLayerDirection;
281 }
pandora::CartesianVector m_minLayerDirection
The global direction at the minimum combined layer.
void lar_content::ThreeDSlidingFitResult::GetGlobalPosition ( const float  rL,
const float  rT1,
const float  rT2,
pandora::CartesianVector &  position 
) const
private

Get global coordinates for a given pair of sliding linear fit coordinates.

Parameters
rLthe longitudinal coordinate
rT1the first transverse coordinate
rT2the second transverse coordinate
positionto receive the position cartesian vector

Definition at line 187 of file LArThreeDSlidingFitResult.cc.

References m_axisDirection, m_axisIntercept, m_firstOrthoDirection, and m_secondOrthoDirection.

Referenced by GetGlobalDirection(), and GetGlobalFitPosition().

188 {
190 }
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
const pandora::CartesianVector m_secondOrthoDirection
The orthogonal direction vector.
const pandora::CartesianVector m_firstOrthoDirection
The orthogonal direction vector.
const pandora::CartesianVector m_axisDirection
The axis direction vector.
float lar_content::ThreeDSlidingFitResult::GetLongitudinalDisplacement ( const pandora::CartesianVector &  position) const

Get longitudinal projection onto primary axis.

Parameters
positionthe input coordinates
Returns
the longitudinal distance along the axis direction from the axis intercept

Definition at line 114 of file LArThreeDSlidingFitResult.cc.

References m_axisDirection, and m_axisIntercept.

Referenced by lar_content::ThreeDHitCreationAlgorithm::GetChi2WrtFit(), lar_content::ThreeDHitCreationAlgorithm::RefineHitPositions(), and lar_content::LArPfoHelper::SlidingFitTrajectoryImpl().

115 {
116  return m_axisDirection.GetDotProduct(position - m_axisIntercept);
117 }
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
const pandora::CartesianVector m_axisDirection
The axis direction vector.
int lar_content::ThreeDSlidingFitResult::GetMaxLayer ( ) const

Get the maximum occupied layer in the sliding fit.

Parameters
themaximum occupied layer in the sliding fit

Definition at line 74 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetMaxLayer(), m_firstFitResult, m_secondFitResult, and max.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster(), lar_content::CosmicRayTaggingTool::CRCandidate::CalculateFitVariables(), and lar_content::NeutrinoHierarchyAlgorithm::PfoInfo::PfoInfo().

75 {
76  const int firstLayer(m_firstFitResult.GetMaxLayer());
77  const int secondLayer(m_secondFitResult.GetMaxLayer());
78 
79  return std::max(firstLayer, secondLayer);
80 }
Int_t max
Definition: plot.C:27
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
float lar_content::ThreeDSlidingFitResult::GetMaxLayerRms ( ) const

Get rms at maximum layer.

Returns
the rms

Definition at line 94 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetMaxLayerRms(), m_firstFitResult, and m_secondFitResult.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster().

95 {
96  const float firstRms(m_firstFitResult.GetMaxLayerRms());
97  const float secondRms(m_secondFitResult.GetMaxLayerRms());
98 
99  return std::sqrt(firstRms * firstRms + secondRms * secondRms);
100 }
float GetMaxLayerRms() const
Get rms at maximum layer.
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
int lar_content::ThreeDSlidingFitResult::GetMinLayer ( ) const

Get the minimum occupied layer in the sliding fit.

Parameters
theminimum occupied layer in the sliding fit

Definition at line 64 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetMinLayer(), m_firstFitResult, m_secondFitResult, and min.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster(), lar_content::CosmicRayTaggingTool::CRCandidate::CalculateFitVariables(), and lar_content::NeutrinoHierarchyAlgorithm::PfoInfo::PfoInfo().

65 {
66  const int firstLayer(m_firstFitResult.GetMinLayer());
67  const int secondLayer(m_secondFitResult.GetMinLayer());
68 
69  return std::min(firstLayer, secondLayer);
70 }
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
Int_t min
Definition: plot.C:26
float lar_content::ThreeDSlidingFitResult::GetMinLayerRms ( ) const

Get rms at minimum layer.

Returns
the rms

Definition at line 84 of file LArThreeDSlidingFitResult.cc.

References lar_content::TwoDSlidingFitResult::GetMinLayerRms(), m_firstFitResult, and m_secondFitResult.

Referenced by lar_content::LArPointingCluster::BuildPointingCluster().

85 {
86  const float firstRms(m_firstFitResult.GetMinLayerRms());
87  const float secondRms(m_secondFitResult.GetMinLayerRms());
88 
89  return std::sqrt(firstRms * firstRms + secondRms * secondRms);
90 }
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
float GetMinLayerRms() const
Get rms at minimum layer.
static pandora::TrackState lar_content::ThreeDSlidingFitResult::GetPrimaryAxis ( const pandora::Cluster *const  pCluster,
const float  slidingFitLayerPitch 
)
staticprivate

Calculate the position and direction of the primary axis.

Parameters
pClusterthe address of the input cluster
slidingFitLayerPitchthe sliding fit z pitch, units cm
Returns
pandora::TrackState object containing the position and direction

Referenced by GetGlobalDirection().

static pandora::TrackState lar_content::ThreeDSlidingFitResult::GetPrimaryAxis ( const pandora::CartesianPointVector *const  pPointVector,
const float  slidingFitLayerPitch 
)
staticprivate

Calculate the position and direction of the primary axis.

Parameters
pPointVectorthe address of the input point vector
slidingFitLayerPitchthe sliding fit z pitch, units cm
Returns
pandora::TrackState object containing the position and direction
const TwoDSlidingFitResult & lar_content::ThreeDSlidingFitResult::GetSecondFitResult ( ) const
inline

Get the second sliding fit result for this cluster.

Returns
the second sliding fit result for this cluster

Definition at line 257 of file LArThreeDSlidingFitResult.h.

References m_secondFitResult.

Referenced by lar_content::ThreeDSlidingConeFitResult::ThreeDSlidingConeFitResult().

258 {
259  return m_secondFitResult;
260 }
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
CartesianVector lar_content::ThreeDSlidingFitResult::GetSeedDirection ( const pandora::CartesianVector &  axisDirection)
staticprivate

Generate a seed vector to be used in calculating the orthogonal axes.

Parameters
axisDirectionthe primary axis
Returns
the seed direction vector

Definition at line 245 of file LArThreeDSlidingFitResult.cc.

References f, min, and ThreeDSlidingFitResult().

246 {
247  const float px(std::fabs(axisDirection.GetX()));
248  const float py(std::fabs(axisDirection.GetY()));
249  const float pz(std::fabs(axisDirection.GetZ()));
250 
251  if (px < std::min(py,pz) + std::numeric_limits<float>::epsilon())
252  {
253  return CartesianVector(1.f, 0.f, 0.f);
254  }
255 
256  if (py < std::min(pz,px) + std::numeric_limits<float>::epsilon())
257  {
258  return CartesianVector(0.f, 1.f, 0.f);
259  }
260 
261  if (pz < std::min(px,py) + std::numeric_limits<float>::epsilon())
262  {
263  return CartesianVector(0.f, 0.f, 1.f);
264  }
265 
266  throw StatusCodeException(STATUS_CODE_FAILURE);
267 }
TFile f
Definition: plotHisto.C:6
Int_t min
Definition: plot.C:26

Member Data Documentation

const pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_axisDirection
private

The axis direction vector.

Definition at line 216 of file LArThreeDSlidingFitResult.h.

Referenced by GetAxisDirection(), GetGlobalPosition(), and GetLongitudinalDisplacement().

const pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_axisIntercept
private

The axis intercept position.

Definition at line 215 of file LArThreeDSlidingFitResult.h.

Referenced by GetAxisIntercept(), GetGlobalDirection(), GetGlobalPosition(), and GetLongitudinalDisplacement().

const TwoDSlidingFitResult lar_content::ThreeDSlidingFitResult::m_firstFitResult
private
const pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_firstOrthoDirection
private

The orthogonal direction vector.

Definition at line 217 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalPosition().

const int lar_content::ThreeDSlidingFitResult::m_maxLayer
private

The maximum combined layer.

Definition at line 222 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalFitDirection(), GetGlobalFitPosition(), and ThreeDSlidingFitResult().

pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_maxLayerDirection
private

The global direction at the maximum combined layer.

Definition at line 227 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalMaxLayerDirection(), and ThreeDSlidingFitResult().

pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_maxLayerPosition
private

The global position at the maximum combined layer.

Definition at line 225 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalMaxLayerPosition(), and ThreeDSlidingFitResult().

const int lar_content::ThreeDSlidingFitResult::m_minLayer
private

The minimum combined layer.

Definition at line 221 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalFitDirection(), GetGlobalFitPosition(), and ThreeDSlidingFitResult().

pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_minLayerDirection
private

The global direction at the minimum combined layer.

Definition at line 226 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalMinLayerDirection(), and ThreeDSlidingFitResult().

pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_minLayerPosition
private

The global position at the minimum combined layer.

Definition at line 224 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalMinLayerPosition(), and ThreeDSlidingFitResult().

const pandora::TrackState lar_content::ThreeDSlidingFitResult::m_primaryAxis
private

The primary axis position and direction.

Definition at line 214 of file LArThreeDSlidingFitResult.h.

const TwoDSlidingFitResult lar_content::ThreeDSlidingFitResult::m_secondFitResult
private
const pandora::CartesianVector lar_content::ThreeDSlidingFitResult::m_secondOrthoDirection
private

The orthogonal direction vector.

Definition at line 218 of file LArThreeDSlidingFitResult.h.

Referenced by GetGlobalPosition().


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