LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ClusterGrowingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_CLUSTER_GROWING_ALGORITHM_H
9 #define LAR_CLUSTER_GROWING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
21 class ClusterGrowingAlgorithm : public pandora::Algorithm
22 {
23 public:
28 
29 protected:
30  virtual pandora::StatusCode Run();
31  virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
32 
33  typedef std::unordered_map<const pandora::Cluster*, pandora::ClusterList> ClusterMergeMap;
34 
41  virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &cleanClusters) const = 0;
42 
49  virtual void GetListOfSeedClusters(const pandora::ClusterVector &cleanClusters, pandora::ClusterVector &seedClusters) const = 0;
50 
51 private:
52 
60  void GetListOfNonSeedClusters(const pandora::ClusterVector &inputClusters, const pandora::ClusterVector &seedClusters,
61  pandora::ClusterVector &nonSeedClusters) const;
62 
70  void PopulateClusterMergeMap(const pandora::ClusterVector &seedClusters, const pandora::ClusterVector &nonSeedClusters,
71  ClusterMergeMap &clusterMergeMap) const;
72 
78  void MergeClusters(const ClusterMergeMap &clusterMergeMap) const;
79 
80  std::string m_inputClusterListName;
81 
83 };
84 
85 } // namespace lar_content
86 
87 #endif // #ifndef LAR_CLUSTER_GROWING_ALGORITHM_H
void GetListOfNonSeedClusters(const pandora::ClusterVector &inputClusters, const pandora::ClusterVector &seedClusters, pandora::ClusterVector &nonSeedClusters) const
Get List of non-seed clusters.
float m_maxClusterSeparation
Maximum distance at which clusters can be joined.
void MergeClusters(const ClusterMergeMap &clusterMergeMap) const
Merge clusters.
virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &cleanClusters) const =0
Populate cluster vector with the subset of clusters judged to be clean.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::string m_inputClusterListName
The name of the input cluster list. If not specified, will access current list.
ClusterGrowingAlgorithm class.
virtual void GetListOfSeedClusters(const pandora::ClusterVector &cleanClusters, pandora::ClusterVector &seedClusters) const =0
Select seed clusters for growing.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void PopulateClusterMergeMap(const pandora::ClusterVector &seedClusters, const pandora::ClusterVector &nonSeedClusters, ClusterMergeMap &clusterMergeMap) const
Identify a set of cluster merges.