9 #include "Pandora/AlgorithmHeaders.h" 21 VertexSplittingAlgorithm::VertexSplittingAlgorithm() :
22 m_splitDisplacementSquared(4.
f * 4.
f),
23 m_vertexDisplacementSquared(1.
f * 1.
f)
35 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*
this, pVertexList));
37 if (pVertexList->empty())
38 return STATUS_CODE_NOT_INITIALIZED;
40 if (pVertexList->size() != 1)
41 return STATUS_CODE_OUT_OF_RANGE;
43 const Cluster *
const pCluster(slidingFitResult.
GetCluster());
46 const Vertex *
const pSelectedVertex(*(pVertexList->begin()));
48 if (VERTEX_3D != pSelectedVertex->GetVertexType())
49 return STATUS_CODE_INVALID_PARAMETER;
57 return STATUS_CODE_NOT_FOUND;
59 bool foundSplit(
false);
62 if (STATUS_CODE_SUCCESS != statusCode)
65 const float splitDisplacementSquared((splitPosition - theVertex2D).GetMagnitudeSquared());
66 const float vertexDisplacementSquared(
std::min((splitPosition - innerVertex2D).GetMagnitudeSquared(), (splitPosition - outerVertex2D).GetMagnitudeSquared()));
69 (splitDisplacementSquared < vertexDisplacementSquared))
75 return STATUS_CODE_NOT_FOUND;
77 return STATUS_CODE_SUCCESS;
85 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
86 "SplitDisplacement", splitDisplacement));
90 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
91 "VertexDisplacement", vertexDisplacement));
virtual 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.
Header file for the vertex splitting algorithm class.
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.
Header file for the geometry helper class.
Header file for the cluster helper class.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
float m_vertexDisplacementSquared
Maximum displacement squared.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
float m_splitDisplacementSquared
Maximum displacement squared.
pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const
Get projected position on global fit for a given position vector.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::list< Vertex > VertexList
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
TwoDSlidingFitResult class.