Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ClusterAssociationAlgorithm.h
Go to the documentation of this file.
1
8#ifndef LAR_CLUSTER_ASSOCIATION_ALGORITHM_H
9#define LAR_CLUSTER_ASSOCIATION_ALGORITHM_H 1
10
11#include "Pandora/Algorithm.h"
12
13#include <unordered_map>
14
15namespace lar_content
16{
17
22{
23public:
28
29protected:
30 virtual pandora::StatusCode Run();
32
42
43 typedef std::unordered_map<const pandora::Cluster *, ClusterAssociation> ClusterAssociationMap;
44
51 virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const = 0;
52
59 virtual void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const = 0;
60
70 virtual bool IsExtremalCluster(
71 const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const = 0;
72
73private:
81 void UnambiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const;
82
90 void AmbiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const;
91
100 void UpdateForUnambiguousMerge(const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete,
101 const bool isForwardMerge, ClusterAssociationMap &clusterAssociationMap) const;
102
109 void UpdateForAmbiguousMerge(const pandora::Cluster *const pCluster, ClusterAssociationMap &clusterAssociationMap) const;
110
120 void NavigateAlongAssociations(const ClusterAssociationMap &clusterAssociationMap, const pandora::Cluster *const pCluster,
121 const bool isForward, const pandora::Cluster *&pExtremalCluster, pandora::ClusterSet &clusterSet) const;
122
123 mutable bool m_mergeMade;
124
126};
127
128} // namespace lar_content
129
130#endif // #ifndef LAR_CLUSTER_ASSOCIATION_ALGORITHM_H
Header file for the algorithm class.
void UpdateForAmbiguousMerge(const pandora::Cluster *const pCluster, ClusterAssociationMap &clusterAssociationMap) const
Update cluster association map to reflect an ambiguous cluster merge.
virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const =0
Populate cluster vector with subset of cluster list, containing clusters judged to be clean.
bool m_resolveAmbiguousAssociations
Whether to resolve ambiguous associations.
virtual pandora::StatusCode Run()
Run the algorithm.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void UnambiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const
Unambiguous propagation.
pandora::ClusterSet m_forwardAssociations
The list of forward associations.
void NavigateAlongAssociations(const ClusterAssociationMap &clusterAssociationMap, const pandora::Cluster *const pCluster, const bool isForward, const pandora::Cluster *&pExtremalCluster, pandora::ClusterSet &clusterSet) const
Navigate along cluster associations, from specified cluster, in specified direction.
virtual void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const =0
Populate the cluster association map.
virtual bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const =0
Determine which of two clusters is extremal.
pandora::ClusterSet m_backwardAssociations
The list of backward associations.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
void UpdateForUnambiguousMerge(const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete, const bool isForwardMerge, ClusterAssociationMap &clusterAssociationMap) const
Update cluster association map to reflect an unambiguous cluster merge.
void AmbiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const
Ambiguous propagation.
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
Cluster class.
Definition Cluster.h:31
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
std::unordered_set< const Cluster * > ClusterSet
StatusCode
The StatusCode enum.