35 if (pVertexList->empty())
36 return STATUS_CODE_NOT_INITIALIZED;
38 if (pVertexList->size() != 1)
39 return STATUS_CODE_OUT_OF_RANGE;
44 const Vertex *
const pSelectedVertex(*(pVertexList->begin()));
47 return STATUS_CODE_INVALID_PARAMETER;
55 return STATUS_CODE_NOT_FOUND;
57 bool foundSplit(
false);
60 if (STATUS_CODE_SUCCESS != statusCode)
63 const float splitDisplacementSquared((splitPosition - theVertex2D).GetMagnitudeSquared());
64 const float vertexDisplacementSquared(
65 std::min((splitPosition - innerVertex2D).GetMagnitudeSquared(), (splitPosition - outerVertex2D).GetMagnitudeSquared()));
68 (splitDisplacementSquared < vertexDisplacementSquared))
74 return STATUS_CODE_NOT_FOUND;
76 return STATUS_CODE_SUCCESS;
85 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"SplitDisplacement", splitDisplacement));
90 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"VertexDisplacement", vertexDisplacement));
Header file for the cluster helper class.
Header file for the geometry helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the vertex splitting algorithm class.
static pandora::StatusCode GetCurrentList(const pandora::Algorithm &algorithm, const T *&pT)
Get the current list.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
TwoDSlidingFitResult class.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const
Get projected position on global fit for a given position vector.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
VertexSplittingAlgorithm()
Default constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::StatusCode FindBestSplitPosition(const TwoDSlidingFitResult &slidingFitResult, pandora::CartesianVector &splitPosition) const
Use sliding linear fit to identify the best split position.
float m_splitDisplacementSquared
Maximum displacement squared.
float m_vertexDisplacementSquared
Maximum displacement squared.
const Pandora & GetPandora() const
Get the associated pandora instance.
VertexType GetVertexType() const
Get the vertex type.
const CartesianVector & GetPosition() const
Get the vertex position.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
MANAGED_CONTAINER< const Vertex * > VertexList
StatusCode
The StatusCode enum.