Perform the refinement proceduce on a list of vertices.
99 for (
const Vertex *
const pVertex : *pVertexList)
101 const CartesianVector originalPosition(pVertex->GetPosition());
103 const CartesianVector vtxU(
105 const CartesianVector vtxV(
107 const CartesianVector vtxW(
110 CartesianVector vtxUV(0.
f, 0.
f, 0.
f), vtxUW(0.
f, 0.
f, 0.
f), vtxVW(0.
f, 0.
f, 0.
f), vtx3D(0.
f, 0.
f, 0.
f), position3D(0.
f, 0.
f, 0.
f);
111 float chi2UV(0.
f), chi2UW(0.
f), chi2VW(0.
f), chi23D(0.
f), chi2(0.
f);
118 if (chi2UV < chi2UW && chi2UV < chi2VW && chi2UV < chi23D)
123 else if (chi2UW < chi2VW && chi2UW < chi23D)
128 else if (chi2VW < chi23D)
140 position3D = originalPosition;
142 if ((position3D - originalPosition).GetMagnitude() >
m_distanceCut)
143 position3D = originalPosition;
145 PandoraContentApi::Vertex::Parameters parameters;
146 parameters.m_position = position3D;
147 parameters.m_vertexLabel = VERTEX_INTERACTION;
148 parameters.m_vertexType = VERTEX_3D;
150 const Vertex *pNewVertex(NULL);
151 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*
this, parameters, pNewVertex));
float m_chiSquaredCut
The maximum chi2 value a refined vertex can have to be kept.
static void MergeTwoPositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from two views to give unified 3D position.
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
pandora::CartesianVector RefineVertexTwoD(const pandora::ClusterList &clusterList, const pandora::CartesianVector &originalVtxPos) const
Refine the position of a two dimensional projection of a vertex using the clusters in that view...
static void MergeThreePositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from three views to give unified 3D position.
float m_distanceCut
The maximum distance a refined vertex can be from the original position to be kept.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex