29 #ifndef CHARGEDFRAGMENTSMERGINGALGORITHM3_H
30 #define CHARGEDFRAGMENTSMERGINGALGORITHM3_H
32 #include "Pandora/Algorithm.h"
33 #include "Pandora/PandoraInputTypes.h"
39 namespace pandora {
class ClusterFitResult; }
41 namespace april_content
53 class Factory :
public pandora::AlgorithmFactory
56 pandora::Algorithm *CreateAlgorithm()
const;
60 pandora::StatusCode Run();
61 pandora::StatusCode ReadSettings(
const pandora::TiXmlHandle xmlHandle);
65 void GetNearbyClusters(pandora::Cluster* cluster,
const std::vector<april_content::APRILCluster*>& clusterVector,
66 std::vector<april_content::APRILCluster*>& clustersInRange);
68 bool CheckNearbyClusterWithCharge(
const april_content::APRILCluster* pCluster, std::vector<april_content::APRILCluster*>& nearbyClusters,
int charge);
71 std::vector<april_content::APRILCluster*>& allClusters,
72 std::vector<april_content::APRILCluster*>& properClusters,
73 std::vector<float>& distances);
75 void FillClusters(std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap,
76 pandora::Cluster* cluster, pandora::Cluster* clusterToMerge);
78 void MCClusterMerging(
const pandora::ClusterList& clustersForMerging);
80 void MergeClusters(std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap);
82 void MakeMergingMap(std::vector<APRILCluster*>& clustersToMerge, std::vector<APRILCluster*>& clusterVector,
83 std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap);
85 pandora::StatusCode CleanClusterForMerging(std::vector<APRILCluster*>& clusterVector);
87 bool CheckStartingPoints(
const pandora::Cluster* chargedCluster,
const pandora::Cluster* fragment);
102 pandora::StatusCode
FindClustersToMerge(
const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap)
const;
120 pandora::StatusCode
FindBestParentCluster(
const pandora::Cluster *
const pDaughterCluster,
const pandora::ClusterVector &clusterVector,
121 const pandora::Cluster *&pBestParentCluster)
const;
124 float m_maxStartingClusterDistance;
125 float m_maxClosestClusterDistance;
129 bool m_onlyUseConnectedHits;
133 arma::mat m_clusterCentroidsMatrix;
134 std::vector<APRILCluster*> m_clustersToMerge;
139 inline pandora::Algorithm *ChargedFragmentsMergingAlgorithm3::Factory::CreateAlgorithm()
const
Factory class for instantiating algorithm.
Definition: ChargedFragmentsMergingAlgorithm3.h:53
pandora::StatusCode FindBestParentCluster(const pandora::Cluster *const pDaughterCluster, const pandora::ClusterVector &clusterVector, const pandora::Cluster *&pBestParentCluster) const
Find the best parent cluster to merge a daughter one.
bool CanMergeCluster(const pandora::Cluster *const pCluster) const
Whether the cluster is eligible for association.
pandora::StatusCode GetEligibleClusters(std::vector< APRILCluster * > &clusterVector) const
Get the eligible clusters for parent-daughter association.
Definition: ChargedFragmentsMergingAlgorithm3.cc:1168
Cluster class.
Definition: Cluster.h:89
pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const
Algorithm workhorse, find associations between daughter and parent cluster.
ChargedFragmentsMergingAlgorithm3 class.
Definition: ChargedFragmentsMergingAlgorithm3.h:47