Identify cluster merges.
77 for (
const auto &mapEntry : backwardUsageMap)
78 sortedCandidates.push_back(mapEntry.first);
81 for (
const Cluster *
const pCluster : sortedCandidates)
85 if (particleSeedUsageMap.empty())
86 throw StatusCodeException(STATUS_CODE_FAILURE);
89 for (
const auto &mapEntry : particleSeedUsageMap)
90 sortedSeeds.push_back(mapEntry.first);
93 const Cluster *pBestParticleSeed = NULL;
97 for (
const Cluster *
const pParticleSeed : sortedSeeds)
99 const Association &association(particleSeedUsageMap.at(pParticleSeed));
101 if ((association.GetType() > bestType) || ((association.GetType() == bestType) && (association.GetOrder() < bestOrder)))
104 if ((
SINGLE_ORDER == association.GetType()) && (association.GetOrder() > 1))
108 pBestParticleSeed = pParticleSeed;
109 bestType = association.GetType();
110 bestOrder = association.GetOrder();
112 else if ((association.GetType() == bestType) && (association.GetOrder() == bestOrder))
115 pBestParticleSeed = NULL;
119 if (NULL == pBestParticleSeed)
122 seedAssociationList[pBestParticleSeed].push_back(pCluster);
128 const Cluster *
const pParticleSeed = *iter;
130 if (seedAssociationList.end() == seedAssociationList.find(pParticleSeed))
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
AssociationType
AssociationType enum.
std::unordered_map< const pandora::Cluster *, Association > ClusterAssociationMap
static int max(int a, int b)
std::vector< art::Ptr< recob::Cluster > > ClusterVector