LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ClusterMergingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_CLUSTER_MERGING_ALGORITHM_H
9 #define LAR_CLUSTER_MERGING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
21 class ClusterMergingAlgorithm : public pandora::Algorithm
22 {
23 protected:
24  virtual pandora::StatusCode Run();
25  virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
26 
27  typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterMergeMap;
28 
35  virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const = 0;
36 
43  virtual void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const = 0;
44 
51  void MergeClusters(pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const;
52 
60  void CollectAssociatedClusters(const pandora::Cluster *const pSeedCluster, const ClusterMergeMap &clusterMergeMap,
61  pandora::ClusterList &associatedClusterList) const;
62 
72  void CollectAssociatedClusters(const pandora::Cluster *const pSeedCluster, const pandora::Cluster *const pCurrentCluster,
73  const ClusterMergeMap &clusterMergeMap, const pandora::ClusterSet &clusterVetoList, pandora::ClusterList &associatedClusterList) const;
74 
81  void GetSortedListOfCleanClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &outputClusters) const;
82 
83  std::string m_inputClusterListName;
84 };
85 
86 } // namespace lar_content
87 
88 #endif // #ifndef LAR_CLUSTER_MERGING_ALGORITHM_H
std::string m_inputClusterListName
The name of the input cluster list. If not specified, will access current list.
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...
virtual void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const =0
Form associations between pointing clusters.
void MergeClusters(pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const
Merge associated clusters.
void GetSortedListOfCleanClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &outputClusters) const
Sort the selected clusters, so that they have a well-defined ordering.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void CollectAssociatedClusters(const pandora::Cluster *const pSeedCluster, const ClusterMergeMap &clusterMergeMap, pandora::ClusterList &associatedClusterList) const
Collect up all clusters associations related to a given seed cluster.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
ClusterMergingAlgorithm class.