LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
BranchGrowingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_BRANCH_GROWING_ALGORITHM_H
9 #define LAR_BRANCH_GROWING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
21 class BranchGrowingAlgorithm : public pandora::Algorithm
22 {
23 protected:
28  {
29  NONE = 0,
31  STANDARD = 2,
32  STRONG = 3
33  };
34 
39  {
40  public:
44  Association();
45 
52  Association(const unsigned int order, const AssociationType type);
53 
59  void SetOrder(const unsigned int order);
60 
66  void SetType(const AssociationType associationType);
67 
73  unsigned int GetOrder() const;
74 
80  AssociationType GetType() const;
81 
82  private:
83  unsigned int m_order;
85  };
86 
87  typedef std::unordered_map<const pandora::Cluster *, Association> ClusterAssociationMap;
88  typedef std::unordered_map<const pandora::Cluster *, ClusterAssociationMap> ClusterUsageMap;
89 
98  virtual AssociationType AreClustersAssociated(const pandora::Cluster *const pClusterSeed, const pandora::Cluster *const pCluster) const = 0;
99 
108  void FindAssociatedClusters(const pandora::Cluster *const pParticleSeed, pandora::ClusterVector &candidateClusters,
109  ClusterUsageMap &forwardUsageMap, ClusterUsageMap &backwardUsageMap) const;
110 
111  typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterVector> SeedAssociationList;
112 
120  void IdentifyClusterMerges(const pandora::ClusterVector &particleSeedVector, const ClusterUsageMap &backwardUsageMap,
121  SeedAssociationList &seedAssociationList) const;
122 
123  virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
124 };
125 
126 //------------------------------------------------------------------------------------------------------------------------------------------
127 //------------------------------------------------------------------------------------------------------------------------------------------
128 
130  m_order(std::numeric_limits<unsigned int>::max()),
131  m_type(NONE)
132 {
133 }
134 
135 //------------------------------------------------------------------------------------------------------------------------------------------
136 
138  m_order(order),
139  m_type(type)
140 {
141 }
142 
143 //------------------------------------------------------------------------------------------------------------------------------------------
144 
145 inline void BranchGrowingAlgorithm::Association::SetOrder(const unsigned int order)
146 {
147  m_order = order;
148 }
149 
150 //------------------------------------------------------------------------------------------------------------------------------------------
151 
153 {
154  m_type = associationType;
155 }
156 
157 //------------------------------------------------------------------------------------------------------------------------------------------
158 
160 {
161  return m_order;
162 }
163 
164 //------------------------------------------------------------------------------------------------------------------------------------------
165 
167 {
168  return m_type;
169 }
170 
171 } // namespace lar_content
172 
173 #endif // #ifndef LAR_BRANCH_GROWING_ALGORITHM_H
BranchGrowingAlgorithm class.
void SetType(const AssociationType associationType)
Set association type.
AssociationType GetType() const
Get association type.
STL namespace.
std::unordered_map< const pandora::Cluster *, ClusterAssociationMap > ClusterUsageMap
std::unordered_map< const pandora::Cluster *, Association > ClusterAssociationMap
unsigned int GetOrder() const
Get association order.
std::unordered_map< const pandora::Cluster *, pandora::ClusterVector > SeedAssociationList
void FindAssociatedClusters(const pandora::Cluster *const pParticleSeed, pandora::ClusterVector &candidateClusters, ClusterUsageMap &forwardUsageMap, ClusterUsageMap &backwardUsageMap) const
Find clusters associated with a particle seed.
void IdentifyClusterMerges(const pandora::ClusterVector &particleSeedVector, const ClusterUsageMap &backwardUsageMap, SeedAssociationList &seedAssociationList) const
Identify cluster merges.
virtual AssociationType AreClustersAssociated(const pandora::Cluster *const pClusterSeed, const pandora::Cluster *const pCluster) const =0
Determine whether two clusters are associated.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void SetOrder(const unsigned int order)
Set association order.