All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusterExtensionAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArTwoDReco/LArClusterAssociation/ClusterExtensionAlgorithm.h
3  *
4  * @brief Header file for the cluster extension algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CLUSTER_EXTENSION_ALGORITHM_H
9 #define LAR_CLUSTER_EXTENSION_ALGORITHM_H 1
10 
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
18 /**
19  * @brief ClusterExtensionAlgorithm class
20  */
22 {
23 protected:
24  void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMatrix) const;
25 
26  /**
27  * @brief ClusterAssociation class
28  */
30  {
31  public:
32  /**
33  * @brief Vertex enumeration
34  */
36  {
37  UNDEFINED = 0,
38  INNER = 1,
39  OUTER = 2
40  };
41 
42  /**
43  * @brief Association enumeration
44  */
46  {
47  NONE = 0,
48  WEAK = 1,
49  STRONG = 2
50  };
51 
52  /**
53  * @brief Constructor
54  *
55  * @param parent
56  * @param daughter
57  * @param association
58  * @param fom
59  */
60  ClusterAssociation(const VertexType parent, const VertexType daughter, const AssociationType association, const float fom);
61 
62  /**
63  * @brief Get parent
64  *
65  * @return the parent
66  */
67  VertexType GetParent() const;
68 
69  /**
70  * @brief Get daughter
71  *
72  * @return the daughter
73  */
74  VertexType GetDaughter() const;
75 
76  /**
77  * @brief Get association
78  *
79  * @return the association
80  */
82 
83  /**
84  * @brief Get figure of merit
85  *
86  * @return the figure of merit
87  */
88  float GetFigureOfMerit() const;
89 
90  private:
94  float m_fom; ///<
95  };
96 
97  typedef std::unordered_map<const pandora::Cluster *, ClusterAssociation> ClusterAssociationMap;
98  typedef std::unordered_map<const pandora::Cluster *, ClusterAssociationMap> ClusterAssociationMatrix;
99 
100  /**
101  * @brief Fill the cluster association matrix
102  *
103  * @param clusterVector the input vector of clusters
104  * @param clusterAssociationMatrix the matrix of associations
105  */
106  virtual void FillClusterAssociationMatrix(const pandora::ClusterVector &clusterVector, ClusterAssociationMatrix &clusterAssociationMatrix) const = 0;
107 
108  /**
109  * @brief Fill the cluster merge map
110  *
111  * @param clusterAssociationMatrix the matrix of cluster associations
112  * @param clusterMergeMap the map of cluster merges
113  */
114  virtual void FillClusterMergeMap(const ClusterAssociationMatrix &clusterAssociationMatrix, ClusterMergeMap &clusterMergeMap) const = 0;
115 };
116 
117 //------------------------------------------------------------------------------------------------------------------------------------------
118 //------------------------------------------------------------------------------------------------------------------------------------------
119 
121  const VertexType parent, const VertexType daughter, const AssociationType association, const float fom) :
122  m_parent(parent),
123  m_daughter(daughter),
124  m_association(association),
125  m_fom(fom)
126 {
127 }
128 
129 //------------------------------------------------------------------------------------------------------------------------------------------
130 
132 {
133  return m_parent;
134 }
135 
136 //------------------------------------------------------------------------------------------------------------------------------------------
137 
139 {
140  return m_daughter;
141 }
142 
143 //------------------------------------------------------------------------------------------------------------------------------------------
144 
146 {
147  return m_association;
148 }
149 
150 //------------------------------------------------------------------------------------------------------------------------------------------
151 
153 {
154  return m_fom;
155 }
156 
157 } // namespace lar_content
158 
159 #endif // #ifndef LAR_CLUSTER_EXTENSION_ALGORITHM_H
ClusterAssociation(const VertexType parent, const VertexType daughter, const AssociationType association, const float fom)
Constructor.
void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMatrix) const
Form associations between pointing clusters.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
std::unordered_map< const pandora::Cluster *, ClusterAssociationMap > ClusterAssociationMatrix
virtual void FillClusterMergeMap(const ClusterAssociationMatrix &clusterAssociationMatrix, ClusterMergeMap &clusterMergeMap) const =0
Fill the cluster merge map.
virtual void FillClusterAssociationMatrix(const pandora::ClusterVector &clusterVector, ClusterAssociationMatrix &clusterAssociationMatrix) const =0
Fill the cluster association matrix.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::vector< art::Ptr< recob::Cluster > > ClusterVector
ClusterMergingAlgorithm class.
Header file for the cluster merging algorithm class.