9 #include "Pandora/AlgorithmHeaders.h" 20 SimpleClusterMergingAlgorithm::SimpleClusterMergingAlgorithm() :
21 m_minCaloHitsPerCluster(5),
22 m_maxClusterSeparation(2.5
f)
32 const Cluster *
const pCluster = *iter;
34 if (!pCluster->IsAvailable())
40 clusterVector.push_back(pCluster);
52 const Cluster *
const pClusterI = *iterI;
56 const Cluster *
const pClusterJ = *iterJ;
58 if (pClusterI == pClusterJ)
63 clusterMergeMap[pClusterI].push_back(pClusterJ);
64 clusterMergeMap[pClusterJ].push_back(pClusterI);
84 PANDORA_RETURN_RESULT_IF_AND_IF(
85 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinCaloHitsPerCluster",
m_minCaloHitsPerCluster));
87 PANDORA_RETURN_RESULT_IF_AND_IF(
88 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MaxClusterSeparation",
m_maxClusterSeparation));
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.
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
float m_maxClusterSeparation
Maximum distance at which clusters can be joined.
Header file for the simple cluster merging algorithm class.
Header file for the cluster helper class.
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
Populate cluster vector with subset of cluster list, containing clusters judged to be clean...
bool IsAssociated(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ) const
Decide whether two clusters are associated.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const
Form associations between pointing clusters.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.