LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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, pandora::ClusterList& associatedClusterList) const;
61 
71  void CollectAssociatedClusters(const pandora::Cluster *const pSeedCluster, const pandora::Cluster *const pCurrentCluster, const ClusterMergeMap &clusterMergeMap,
72  const pandora::ClusterSet &clusterVetoList, pandora::ClusterList& associatedClusterList) const;
73 
80  void GetSortedListOfCleanClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &outputClusters) const;
81 
82  std::string m_inputClusterListName;
83 };
84 
85 } // namespace lar_content
86 
87 #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.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void MergeClusters(pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const
Merge associated clusters.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
void GetSortedListOfCleanClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &outputClusters) const
Sort the selected clusters, so that they have a well-defined ordering.
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.