37 for (
const Cluster *
const pCluster : inputVector)
42 clusterVector.push_back(pCluster);
46 for (
const Cluster *
const pCluster : clusterVector)
52 bool isDeltaRay(
false);
54 for (
const Cluster *
const pClusterCheck : clusterVector)
56 if (pCluster == pClusterCheck)
69 outputVector.push_back(pCluster);
78 CartesianVector innerVertex1(0.f, 0.f, 0.f), outerVertex1(0.f, 0.f, 0.f);
79 CartesianVector innerVertex2(0.f, 0.f, 0.f), outerVertex2(0.f, 0.f, 0.f);
84 const float dxA(std::fabs(innerVertex2.GetX() - innerVertex1.GetX()));
85 const float dxB(std::fabs(outerVertex2.
GetX() - outerVertex1.
GetX()));
87 const float dxC(std::fabs(outerVertex2.
GetX() - innerVertex1.GetX()));
88 const float dxD(std::fabs(innerVertex2.GetX() - outerVertex1.
GetX()));
90 const float xVertex(std::min(std::max(dxA, dxB), std::max(dxC, dxD)));
96 float xMin1(0.f), xMax1(0.f), xMin2(0.f), xMax2(0.f);
100 const float xOverlap(std::min(xMax1, xMax2) - std::max(xMin1, xMin2));
101 const float xSpan(std::max(xMax1, xMax2) - std::min(xMin1, xMin2));
103 if (xSpan < std::numeric_limits<float>::epsilon())
115 const Cluster *
const pCluster1,
const Cluster *
const pCluster2,
const Cluster *
const pCluster3)
const
122 if (hitType1 == hitType2 || hitType2 == hitType3 || hitType3 == hitType1)
125 CartesianVector innerVertex1(0.f, 0.f, 0.f), outerVertex1(0.f, 0.f, 0.f);
126 CartesianVector innerVertex2(0.f, 0.f, 0.f), outerVertex2(0.f, 0.f, 0.f);
127 CartesianVector innerVertex3(0.f, 0.f, 0.f), outerVertex3(0.f, 0.f, 0.f);
133 for (
unsigned int n = 0; n < 4; ++n)
144 if (std::fabs(vtx1.
GetX() - vtx2.GetX()) < std::max(
m_vtxXOverlap, std::fabs(vtx1.
GetX() - end2.GetX())) &&
145 std::fabs(end1.GetX() - end2.GetX()) < std::max(
m_vtxXOverlap, std::fabs(end1.GetX() - vtx2.GetX())) &&
146 std::fabs(vtx2.GetX() - vtx3.GetX()) < std::max(
m_vtxXOverlap, std::fabs(vtx2.GetX() - end3.GetX())) &&
147 std::fabs(end2.GetX() - end3.GetX()) < std::max(
m_vtxXOverlap, std::fabs(end2.GetX() - vtx3.GetX())) &&
148 std::fabs(vtx3.GetX() - vtx1.
GetX()) < std::max(
m_vtxXOverlap, std::fabs(vtx3.GetX() - end1.GetX())) &&
149 std::fabs(end3.GetX() - end1.GetX()) < std::max(
m_vtxXOverlap, std::fabs(end3.GetX() - vtx1.
GetX())))
171 const bool matchedCluster1(matchedVtx1 || matchedEnd1);
172 const bool matchedCluster2(matchedVtx2 || matchedEnd2);
173 const bool matchedCluster3(matchedVtx3 || matchedEnd3);
174 const bool matchedVtx(matchedVtx1 || matchedVtx2 || matchedVtx3);
175 const bool matchedEnd(matchedEnd1 || matchedEnd2 || matchedEnd3);
177 if (matchedCluster1 && matchedCluster2 && matchedCluster3 && matchedVtx && matchedEnd)
const pandora::Cluster * m_pClusterW
Address of cluster in W view.
const pandora::Cluster * m_pClusterU
Address of cluster in U view.
const pandora::Cluster * m_pClusterV
Address of cluster in V view.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool CheckMatchedClusters3D(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const
Check that three clusters have a consistent 3D position.
void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const
Select a set of clusters judged to be clean.
float m_minXOverlapFraction
requirement on minimum X overlap fraction for associated clusters
void SetPfoParameters(const Particle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Calculate Pfo properties from proto particle.
float m_vtxXOverlap
requirement on X overlap of start/end positions
float m_minXOverlap
requirement on minimum X overlap for associated clusters
float m_clusterMinLength
minimum length of clusters for this algorithm
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool MatchClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Match a pair of clusters from two views.
float m_maxDisplacement
requirement on 3D consistency checks
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static void GetExtremalCoordinates(const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
Get positions of the two most distant calo hits in a list of cluster (ordered by Z)
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).