Get modification objects for specific elements of the matrix, identifying required splits and merges for clusters.
271 for (IteratorList::const_iterator iIter1 = iteratorList.begin(), iIter1End = iteratorList.end(); iIter1 != iIter1End; ++iIter1)
273 for (IteratorList::const_iterator iIter2 = std::next(iIter1); iIter2 != iIter1End; ++iIter2)
277 const unsigned int nMatchedReUpsampledSamplingPoints1((*iIter1)->GetOverlapResult().GetNMatchedReUpsampledSamplingPoints());
278 const unsigned int nMatchedReUpsampledSamplingPoints2((*iIter2)->GetOverlapResult().GetNMatchedReUpsampledSamplingPoints());
279 IteratorList::const_iterator iIterA((nMatchedReUpsampledSamplingPoints1 >= nMatchedReUpsampledSamplingPoints2) ? iIter1 : iIter2);
280 IteratorList::const_iterator iIterB((nMatchedReUpsampledSamplingPoints1 >= nMatchedReUpsampledSamplingPoints2) ? iIter2 : iIter1);
282 Particle particle(*(*iIterA), *(*iIterB));
283 const LArPointingCluster pointingClusterA(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterA));
284 const LArPointingCluster pointingClusterB(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterB));
286 LArPointingCluster::Vertex vertexA, vertexB;
289 float transverseAB(std::numeric_limits<float>::max()), transverseBA(std::numeric_limits<float>::max());
290 float longitudinalAB(-std::numeric_limits<float>::max()), longitudinalBA(-std::numeric_limits<float>::max());
301 const float cosTheta(-vertexA.GetDirection().GetCosOpeningAngle(vertexB.GetDirection()));
306 const bool isALowestInX(this->
IsALowestInX(pointingClusterA, pointingClusterB));
307 const CartesianVector splitPosition((vertexA.GetPosition() + vertexB.GetPosition()) * 0.5f);
308 const bool isThreeDKink(this->
IsThreeDKink(pAlgorithm, particle, splitPosition, isALowestInX));
311 Modification modification;
315 const TwoDSlidingFitResult &fitResultCommon(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster));
317 CartesianVector splitPositionCommon(0.f, 0.f, 0.f);
318 if (STATUS_CODE_SUCCESS != fitResultCommon.GetGlobalFitPositionAtX(splitPosition.GetX(), splitPositionCommon))
323 modification.m_splitPositionMap[particle.m_pCommonCluster].push_back(splitPositionCommon);
327 const bool vertexAIsLowX(vertexA.GetPosition().GetX() < vertexB.GetPosition().GetX());
328 const Cluster *
const pLowXCluster(vertexAIsLowX ? particle.m_pClusterA : particle.m_pClusterB);
329 const Cluster *
const pHighXCluster(vertexAIsLowX ? particle.m_pClusterB : particle.m_pClusterA);
330 modification.m_clusterMergeMap[pLowXCluster].push_back(pHighXCluster);
333 modification.m_affectedClusters.push_back(particle.m_pClusterA);
334 modification.m_affectedClusters.push_back(particle.m_pClusterB);
335 modification.m_affectedClusters.push_back(particle.m_pCommonCluster);
337 modificationList.push_back(modification);
339 catch (
const StatusCodeException &statusCodeException)
341 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
342 throw statusCodeException;
static bool IsALowestInX(const LArPointingCluster &pointingClusterA, const LArPointingCluster &pointingClusterB)
Whether pointing cluster labelled A extends to lowest x positions (as opposed to that labelled B) ...
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
static void GetClosestVertices(const bool useX, const bool useY, const bool useZ, const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, receive the closest or farthest pair of vertices.
bool IsThreeDKink(TwoViewTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, const pandora::CartesianVector &splitPosition, const bool isALowestInX) const
Whether the provided particle is consistent with being a kink, when examined in three dimensions at t...
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
float m_minLongitudinalImpactParameter
The min longitudinal impact parameter for connecting accompanying clusters.