ClusterGrowingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArTwoDReco/LArClusterAssociation/ClusterGrowingAlgorithm.h
3  *
4  * @brief Header file for the cluster growing algorithm class.
5  *
6  * $Log: $
7  */
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 
18 /**
19  * @brief ClusterGrowingAlgorithm class
20  */
21 class ClusterGrowingAlgorithm : public pandora::Algorithm
22 {
23 public:
24  /**
25  * @brief Default constructor
26  */
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 
35  /**
36  * @brief Populate cluster vector with the subset of clusters judged to be clean
37  *
38  * @param pClusterList address of the cluster list
39  * @param cleanClusters the output vector of clean clusters
40  */
41  virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &cleanClusters) const = 0;
42 
43  /**
44  * @brief Select seed clusters for growing
45  *
46  * @param cleanClusters the input vector of clean clusters
47  * @param seedClusters the output vector of seed clusters
48  */
49  virtual void GetListOfSeedClusters(const pandora::ClusterVector &cleanClusters, pandora::ClusterVector &seedClusters) const = 0;
50 
51 private:
52  /**
53  * @brief Get List of non-seed clusters
54  *
55  * @param inputClusters the input vector of clean clusters
56  * @param seedClusters the input vector of seed clusters
57  * @param nonSeedClusters the output vector of non-seed clusters
58  */
59  void GetListOfNonSeedClusters(const pandora::ClusterVector &inputClusters, const pandora::ClusterVector &seedClusters,
60  pandora::ClusterVector &nonSeedClusters) const;
61 
62  /**
63  * @brief Identify a set of cluster merges
64  *
65  * @param seedClusters the input vector of seed clusters
66  * @param nonSeedClusters the input vector of non-seed clusters
67  * @param clusterMergeMap the output map of cluster merges
68  */
70  const pandora::ClusterVector &seedClusters, const pandora::ClusterVector &nonSeedClusters, ClusterMergeMap &clusterMergeMap) const;
71 
72  /**
73  * @brief Merge clusters
74  *
75  * @param clusterMergeMap the map of clusters to be merged
76  */
77  void MergeClusters(const ClusterMergeMap &clusterMergeMap) const;
78 
79  std::string m_inputClusterListName; ///< The name of the input cluster list. If not specified, will access current list.
80 
81  float m_maxClusterSeparation; ///< Maximum distance at which clusters can be joined
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.
std::string string
Definition: nybbler.cc:12
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.