LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ClusterExtensionAlgorithm.h
Go to the documentation of this file.
1 
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 
22 {
23 protected:
24  void PopulateClusterMergeMap(const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMatrix) const;
25 
30  {
31  public:
36  {
37  UNDEFINED = 0,
38  INNER = 1,
39  OUTER = 2
40  };
41 
46  {
47  NONE = 0,
48  WEAK = 1,
49  STRONG = 2
50  };
51 
60  ClusterAssociation(const VertexType parent, const VertexType daughter, const AssociationType association, const float fom);
61 
67  VertexType GetParent() const;
68 
74  VertexType GetDaughter() const;
75 
82 
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 
106  virtual void FillClusterAssociationMatrix(const pandora::ClusterVector &clusterVector, ClusterAssociationMatrix &clusterAssociationMatrix) const = 0;
107 
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
virtual void FillClusterMergeMap(const ClusterAssociationMatrix &clusterAssociationMatrix, ClusterMergeMap &clusterMergeMap) const =0
Fill the cluster merge map.
ClusterAssociation(const VertexType parent, const VertexType daughter, const AssociationType association, const float fom)
Constructor.
virtual void FillClusterAssociationMatrix(const pandora::ClusterVector &clusterVector, ClusterAssociationMatrix &clusterAssociationMatrix) const =0
Fill the cluster association matrix.
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
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.