8 #ifndef LAR_OVERLAP_MATRIX_H 9 #define LAR_OVERLAP_MATRIX_H 1 11 #include "Pandora/PandoraInternal.h" 13 #include <unordered_map> 41 Element(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const OverlapResult &overlapResult);
98 const pandora::Cluster *&pCluster1,
const pandora::Cluster *&pCluster2)
const;
108 void GetNConnections(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable,
unsigned int &n1,
unsigned int &n2)
const;
117 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList)
const;
128 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList,
129 unsigned int &n1,
unsigned int &n2)
const;
132 typedef std::unordered_map<const pandora::Cluster *, OverlapResult>
OverlapList;
133 typedef std::unordered_map<const pandora::Cluster *, OverlapList>
TheMatrix;
140 const_iterator
begin()
const;
145 const_iterator
end()
const;
162 const OverlapResult &
GetOverlapResult(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2)
const;
171 const OverlapList &
GetOverlapList(
const pandora::Cluster *
const pCluster1)
const;
194 void SetOverlapResult(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const OverlapResult &overlapResult);
203 void ReplaceOverlapResult(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const OverlapResult &overlapResult);
226 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList,
227 pandora::ClusterList &clusterList1, pandora::ClusterList &clusterList2)
const;
236 void ExploreConnections(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, pandora::ClusterList &clusterList1,
237 pandora::ClusterList &clusterList2)
const;
246 template <
typename T>
255 template <
typename T>
258 unsigned int n1(0), n2(0);
264 template <
typename T>
272 template <
typename T>
280 template <
typename T>
282 const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2)
const 287 if (overlapList.end() == iter)
288 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
295 template <
typename T>
301 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
308 template <
typename T>
316 template <
typename T>
324 template <
typename T>
335 template <
typename T>
337 const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const OverlapResult &overlapResult) :
346 template <
typename T>
354 template <
typename T>
362 template <
typename T>
370 template <
typename T>
381 #endif // #ifndef LAR_OVERLAP_MATRIX_H OverlapResult m_overlapResult
The overlap result.
const pandora::Cluster * m_pCluster1
The address of cluster 1.
void Clear()
Clear overlap matrix.
void RemoveCluster(const pandora::Cluster *const pCluster)
Remove entries from matrix corresponding to specified cluster.
Element(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const OverlapResult &overlapResult)
Constructor.
bool DefaultAmbiguityFunction(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2, const pandora::Cluster *&pCluster1, const pandora::Cluster *&pCluster2) const
Default ambiguity function, checking that only one cluster from view 1 and view 2 is found...
const OverlapResult & GetOverlapResult() const
Get the overlap result.
const ClusterNavigationMap & GetClusterNavigationMap12() const
Get the cluster navigation map 1->2.
std::vector< Element > ElementList
void GetSortedKeyClusters(pandora::ClusterVector &sortedKeyClusters) const
Get a sorted vector of key clusters (view 1 clusters with current implementation) ...
const OverlapResult & GetOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Get the overlap result for a specified pair of clusters.
ClusterNavigationMap m_clusterNavigationMap12
The cluster navigation map 1->2.
const OverlapList & GetOverlapList(const pandora::Cluster *const pCluster1) const
Get the overlap list for a specified cluster.
bool operator<(const Element &rhs) const
Element less than operator.
const ClusterNavigationMap & GetClusterNavigationMap21() const
Get the cluster navigation map 2->1.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
const_iterator begin() const
Returns an iterator referring to the first element in the overlap matrix.
TheMatrix::const_iterator const_iterator
std::unordered_map< const pandora::Cluster *, OverlapResult > OverlapList
void GetUnambiguousElements(const bool ignoreUnavailable, ElementList &elementList) const
Get unambiguous elements.
void SetOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const OverlapResult &overlapResult)
Set overlap result.
TheMatrix m_overlapMatrix
The overlap matrix.
void ExploreConnections(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterList1, pandora::ClusterList &clusterList2) const
Explore connections associated with a given cluster.
const pandora::Cluster * GetCluster2() const
Get the address of cluster 2.
const_iterator end() const
Returns an iterator referring to the past-the-end element in the overlap matrix.
std::unordered_map< const pandora::Cluster *, OverlapList > TheMatrix
const pandora::Cluster * m_pCluster2
The address of cluster 2.
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, ElementList &elementList) const
Get a list of elements connected to a specified cluster.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void ReplaceOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const OverlapResult &overlapResult)
SetReplace an existing overlap result.
ClusterNavigationMap m_clusterNavigationMap21
The cluster navigation map 2->1.
const pandora::Cluster * GetCluster1() const
Get the address of cluster 1.
void GetNConnections(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, unsigned int &n1, unsigned int &n2) const
Get the number of connections for a specified cluster.