Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::VertexSplittingAlgorithm Class Reference

VertexSplittingAlgorithm class. More...

#include <VertexSplittingAlgorithm.h>

Inheritance diagram for lar_content::VertexSplittingAlgorithm:
lar_content::TwoDSlidingFitSplittingAlgorithm lar_content::ClusterSplittingAlgorithm

Public Member Functions

 VertexSplittingAlgorithm ()
 Default constructor. More...
 
- Public Member Functions inherited from lar_content::TwoDSlidingFitSplittingAlgorithm
 TwoDSlidingFitSplittingAlgorithm ()
 Default constructor. More...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
pandora::StatusCode FindBestSplitPosition (const TwoDSlidingFitResult &slidingFitResult, pandora::CartesianVector &splitPosition) const
 Use sliding linear fit to identify the best split position. More...
 

Private Attributes

float m_splitDisplacementSquared
 Maximum displacement squared. More...
 
float m_vertexDisplacementSquared
 Maximum displacement squared. More...
 

Additional Inherited Members

- Protected Member Functions inherited from lar_content::ClusterSplittingAlgorithm
virtual pandora::StatusCode Run ()
 
pandora::StatusCode RunUsingCurrentList () const
 Run the algorithm using the current cluster list as input. More...
 
- Protected Attributes inherited from lar_content::TwoDSlidingFitSplittingAlgorithm
unsigned int m_slidingFitHalfWindow
 
float m_minClusterLength
 

Detailed Description

VertexSplittingAlgorithm class.

Definition at line 21 of file VertexSplittingAlgorithm.h.

Constructor & Destructor Documentation

lar_content::VertexSplittingAlgorithm::VertexSplittingAlgorithm ( )

Default constructor.

Definition at line 21 of file VertexSplittingAlgorithm.cc.

22 {
23  // ATTN Some default values differ from base class
24  m_minClusterLength = 1.f;
25 }
float m_vertexDisplacementSquared
Maximum displacement squared.
float m_splitDisplacementSquared
Maximum displacement squared.

Member Function Documentation

StatusCode lar_content::VertexSplittingAlgorithm::FindBestSplitPosition ( const TwoDSlidingFitResult slidingFitResult,
pandora::CartesianVector &  splitPosition 
) const
privatevirtual

Use sliding linear fit to identify the best split position.

Parameters
slidingFitResultthe input sliding fit result
splitPositionthe best split position
Returns
pandora::StatusCode

Implements lar_content::TwoDSlidingFitSplittingAlgorithm.

Definition at line 29 of file VertexSplittingAlgorithm.cc.

30 {
31  // Identify event vertex
32  const VertexList *pVertexList(NULL);
33  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pVertexList));
34 
35  if (pVertexList->empty())
36  return STATUS_CODE_NOT_INITIALIZED;
37 
38  if (pVertexList->size() != 1)
39  return STATUS_CODE_OUT_OF_RANGE;
40 
41  const Cluster *const pCluster(slidingFitResult.GetCluster());
42  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
43 
44  const Vertex *const pSelectedVertex(*(pVertexList->begin()));
45 
46  if (VERTEX_3D != pSelectedVertex->GetVertexType())
47  return STATUS_CODE_INVALID_PARAMETER;
48 
49  const CartesianVector theVertex2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), pSelectedVertex->GetPosition(), hitType));
50 
51  const CartesianVector innerVertex2D(slidingFitResult.GetGlobalMinLayerPosition());
52  const CartesianVector outerVertex2D(slidingFitResult.GetGlobalMaxLayerPosition());
53 
54  if ((outerVertex2D - innerVertex2D).GetMagnitudeSquared() < 4.f * m_vertexDisplacementSquared)
55  return STATUS_CODE_NOT_FOUND;
56 
57  bool foundSplit(false);
58  const StatusCode statusCode(slidingFitResult.GetGlobalFitProjection(theVertex2D, splitPosition));
59 
60  if (STATUS_CODE_SUCCESS != statusCode)
61  return statusCode;
62 
63  const float splitDisplacementSquared((splitPosition - theVertex2D).GetMagnitudeSquared());
64  const float vertexDisplacementSquared(
65  std::min((splitPosition - innerVertex2D).GetMagnitudeSquared(), (splitPosition - outerVertex2D).GetMagnitudeSquared()));
66 
67  if ((splitDisplacementSquared < m_splitDisplacementSquared) && (vertexDisplacementSquared > m_vertexDisplacementSquared) &&
68  (splitDisplacementSquared < vertexDisplacementSquared))
69  {
70  foundSplit = true;
71  }
72 
73  if (!foundSplit)
74  return STATUS_CODE_NOT_FOUND;
75 
76  return STATUS_CODE_SUCCESS;
77 }
enum cvn::HType HitType
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
float m_vertexDisplacementSquared
Maximum displacement squared.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
float m_splitDisplacementSquared
Maximum displacement squared.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:182
StatusCode lar_content::VertexSplittingAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::TwoDSlidingFitSplittingAlgorithm.

Definition at line 81 of file VertexSplittingAlgorithm.cc.

82 {
83  float splitDisplacement = std::sqrt(m_splitDisplacementSquared);
84  PANDORA_RETURN_RESULT_IF_AND_IF(
85  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SplitDisplacement", splitDisplacement));
86  m_splitDisplacementSquared = splitDisplacement * splitDisplacement;
87 
88  float vertexDisplacement = std::sqrt(m_vertexDisplacementSquared);
89  PANDORA_RETURN_RESULT_IF_AND_IF(
90  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexDisplacement", vertexDisplacement));
91  m_vertexDisplacementSquared = vertexDisplacement * vertexDisplacement;
92 
94 }
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_vertexDisplacementSquared
Maximum displacement squared.
float m_splitDisplacementSquared
Maximum displacement squared.

Member Data Documentation

float lar_content::VertexSplittingAlgorithm::m_splitDisplacementSquared
private

Maximum displacement squared.

Definition at line 33 of file VertexSplittingAlgorithm.h.

float lar_content::VertexSplittingAlgorithm::m_vertexDisplacementSquared
private

Maximum displacement squared.

Definition at line 34 of file VertexSplittingAlgorithm.h.


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