LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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:
59  void GetListOfNonSeedClusters(const pandora::ClusterVector &inputClusters, const pandora::ClusterVector &seedClusters,
60  pandora::ClusterVector &nonSeedClusters) const;
61 
70  const pandora::ClusterVector &seedClusters, const pandora::ClusterVector &nonSeedClusters, ClusterMergeMap &clusterMergeMap) const;
71 
77  void MergeClusters(const ClusterMergeMap &clusterMergeMap) const;
78 
79  std::string m_inputClusterListName;
80 
82 };
83 
84 } // namespace lar_content
85 
86 #endif // #ifndef LAR_CLUSTER_GROWING_ALGORITHM_H
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
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::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.