Get modification objects for a specific elements of the tensor, identifying required splits and merges for clusters.
47 const unsigned int nMatchedSamplingPoints1((*iIter1)->GetOverlapResult().GetNMatchedSamplingPoints());
48 const unsigned int nMatchedSamplingPoints2((*iIter2)->GetOverlapResult().GetNMatchedSamplingPoints());
52 Particle particle(*(*iIterA), *(*iIterB));
53 const LArPointingCluster pointingClusterA(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterA));
54 const LArPointingCluster pointingClusterB(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterB));
71 const float cosTheta(-vertexA.GetDirection().GetCosOpeningAngle(vertexB.GetDirection()));
76 const bool isALowestInX(this->
IsALowestInX(pointingClusterA, pointingClusterB));
77 const CartesianVector splitPosition((vertexA.GetPosition() + vertexB.GetPosition()) * 0.5
f);
84 Modification modification;
88 const TwoDSlidingFitResult &fitResult1(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster1));
89 const TwoDSlidingFitResult &fitResult2(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster2));
91 CartesianVector splitPosition1(0.
f, 0.
f, 0.
f), splitPosition2(0.
f, 0.
f, 0.
f);
92 if ((STATUS_CODE_SUCCESS != fitResult1.GetGlobalFitPositionAtX(splitPosition.GetX(), splitPosition1)) ||
93 (STATUS_CODE_SUCCESS != fitResult2.GetGlobalFitPositionAtX(splitPosition.GetX(), splitPosition2)))
98 modification.m_splitPositionMap[particle.m_pCommonCluster1].push_back(splitPosition1);
99 modification.m_splitPositionMap[particle.m_pCommonCluster2].push_back(splitPosition2);
103 const bool vertexAIsLowX(vertexA.GetPosition().GetX() < vertexB.GetPosition().GetX());
104 const Cluster *
const pLowXCluster(vertexAIsLowX ? particle.m_pClusterA : particle.m_pClusterB);
105 const Cluster *
const pHighXCluster(vertexAIsLowX ? particle.m_pClusterB : particle.m_pClusterA);
106 modification.m_clusterMergeMap[pLowXCluster].push_back(pHighXCluster);
109 modification.m_affectedClusters.push_back(particle.m_pClusterA);
110 modification.m_affectedClusters.push_back(particle.m_pClusterB);
111 modification.m_affectedClusters.push_back(particle.m_pCommonCluster1);
112 modification.m_affectedClusters.push_back(particle.m_pCommonCluster2);
114 modificationList.push_back(modification);
116 catch (StatusCodeException &statusCodeException)
118 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
119 throw statusCodeException;
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.
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
static int max(int a, int b)
bool m_splitMode
Whether to run in cluster splitting mode, as opposed to cluster merging mode.
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) ...
bool IsThreeDKink(ThreeViewTransverseTracksAlgorithm *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...
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
bool m_majorityRulesMode
Whether to run in majority rules mode (always split overshoots, always merge undershoots) ...
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
float m_minLongitudinalImpactParameter
The min longitudinal impact parameter for connecting accompanying clusters.
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.