29 #ifndef CHARGEDFRAGMENTSMERGINGALGORITHM_H
30 #define CHARGEDFRAGMENTSMERGINGALGORITHM_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 void SearchProperClusters(
const pandora::Track* pTrack,
APRILCluster* startingCluster,
69 std::vector<april_content::APRILCluster*>& properClusters);
71 pandora::StatusCode CleanClusterForMerging(std::vector<APRILCluster*>& clusterVector);
86 pandora::StatusCode
FindClustersToMerge(
const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap)
const;
104 pandora::StatusCode
FindBestParentCluster(
const pandora::Cluster *
const pDaughterCluster,
const pandora::ClusterVector &clusterVector,
105 const pandora::Cluster *&pBestParentCluster)
const;
114 pandora::StatusCode
GetClusterBackwardDirection(
const pandora::Cluster *
const pCluster, pandora::CartesianVector &backwardDirection, pandora::CartesianVector &innerPosition)
const;
116 bool IsClusterAxesCompatible(
const APRILCluster* startingCluster,
const APRILCluster* nearbyCluster,
float& axesDistance);
119 float m_maxStartingClusterDistance;
120 float m_maxClosestClusterDistance;
121 float m_maxClusterPosAxisAngle;
122 float m_maxClusterAxesDistance;
124 bool m_mergeChargedClusters;
127 bool m_onlyUseConnectedHits;
129 bool m_useMCPToRejectNeutralCluster;
131 arma::mat m_clusterCentroidsMatrix;
132 std::vector<APRILCluster*> m_clustersToMerge;
137 inline pandora::Algorithm *ChargedFragmentsMergingAlgorithm::Factory::CreateAlgorithm()
const
Factory class for instantiating algorithm.
Definition: ChargedFragmentsMergingAlgorithm.h:53
pandora::StatusCode GetClusterBackwardDirection(const pandora::Cluster *const pCluster, pandora::CartesianVector &backwardDirection, pandora::CartesianVector &innerPosition) const
Get the cluster backward direction and the inner cluster position using a cluster fit of the n first ...
Cluster class.
Definition: Cluster.h:89
pandora::StatusCode GetEligibleClusters(std::vector< APRILCluster * > &clusterVector) const
Get the eligible clusters for parent-daughter association.
Definition: ChargedFragmentsMergingAlgorithm.cc:642
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.
pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const
Algorithm workhorse, find associations between daughter and parent cluster.
bool CanMergeCluster(const pandora::Cluster *const pCluster) const
Whether the cluster is eligible for association.
ChargedFragmentsMergingAlgorithm class.
Definition: ChargedFragmentsMergingAlgorithm.h:47