Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
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
15namespace lar_content
16{
17
22{
23protected:
28 {
29 NONE = 0,
32 STRONG = 3
33 };
34
39 {
40 public:
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
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
124};
125
126//------------------------------------------------------------------------------------------------------------------------------------------
127//------------------------------------------------------------------------------------------------------------------------------------------
128
129inline BranchGrowingAlgorithm::Association::Association() : m_order(std::numeric_limits<unsigned int>::max()), m_type(NONE)
130{
131}
132
133//------------------------------------------------------------------------------------------------------------------------------------------
134
135inline BranchGrowingAlgorithm::Association::Association(const unsigned int order, const AssociationType type) : m_order(order), m_type(type)
136{
137}
138
139//------------------------------------------------------------------------------------------------------------------------------------------
140
141inline void BranchGrowingAlgorithm::Association::SetOrder(const unsigned int order)
142{
143 m_order = order;
144}
145
146//------------------------------------------------------------------------------------------------------------------------------------------
147
149{
150 m_type = associationType;
151}
152
153//------------------------------------------------------------------------------------------------------------------------------------------
154
156{
157 return m_order;
158}
159
160//------------------------------------------------------------------------------------------------------------------------------------------
161
166
167} // namespace lar_content
168
169#endif // #ifndef LAR_BRANCH_GROWING_ALGORITHM_H
Header file for the algorithm class.
unsigned int GetOrder() const
Get association order.
void SetOrder(const unsigned int order)
Set association order.
void SetType(const AssociationType associationType)
Set association type.
AssociationType GetType() const
Get association type.
std::unordered_map< const pandora::Cluster *, pandora::ClusterVector > SeedAssociationList
std::unordered_map< const pandora::Cluster *, Association > ClusterAssociationMap
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void FindAssociatedClusters(const pandora::Cluster *const pParticleSeed, pandora::ClusterVector &candidateClusters, ClusterUsageMap &forwardUsageMap, ClusterUsageMap &backwardUsageMap) const
Find clusters associated with a particle seed.
std::unordered_map< const pandora::Cluster *, ClusterAssociationMap > ClusterUsageMap
virtual AssociationType AreClustersAssociated(const pandora::Cluster *const pClusterSeed, const pandora::Cluster *const pCluster) const =0
Determine whether two clusters are associated.
void IdentifyClusterMerges(const pandora::ClusterVector &particleSeedVector, const ClusterUsageMap &backwardUsageMap, SeedAssociationList &seedAssociationList) const
Identify cluster merges.
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
Cluster class.
Definition Cluster.h:31
std::string m_type
The process type.
Definition Process.h:88
std::vector< const Cluster * > ClusterVector
StatusCode
The StatusCode enum.