8 #ifndef LAR_OVERLAP_TENSOR_H 9 #define LAR_OVERLAP_TENSOR_H 1 11 #include "Pandora/PandoraInternal.h" 13 #include <unordered_map> 42 Element(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW,
const OverlapResult &overlapResult);
108 bool DefaultAmbiguityFunction(
const pandora::ClusterList &clusterListU,
const pandora::ClusterList &clusterListV,
const pandora::ClusterList &clusterListW,
109 const pandora::Cluster *&pClusterU,
const pandora::Cluster *&pClusterV,
const pandora::Cluster *&pClusterW)
const;
120 void GetNConnections(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable,
unsigned int &nU,
unsigned int &nV,
unsigned int &nW)
const;
129 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList)
const;
141 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList,
unsigned int &nU,
142 unsigned int &nV,
unsigned int &nW)
const;
145 typedef std::unordered_map<const pandora::Cluster*, OverlapResult>
OverlapList;
146 typedef std::unordered_map<const pandora::Cluster*, OverlapList>
OverlapMatrix;
147 typedef std::unordered_map<const pandora::Cluster*, OverlapMatrix>
TheTensor;
154 const_iterator
begin()
const;
159 const_iterator
end()
const;
177 const OverlapResult &
GetOverlapResult(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW)
const;
187 const OverlapList &
GetOverlapList(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV)
const;
196 const OverlapMatrix &
GetOverlapMatrix(
const pandora::Cluster *
const pClusterU)
const;
227 void SetOverlapResult(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW,
const OverlapResult &overlapResult);
237 void ReplaceOverlapResult(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW,
const OverlapResult &overlapResult);
261 void GetConnectedElements(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, ElementList &elementList,
262 pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW)
const;
272 void ExploreConnections(
const pandora::Cluster *
const pCluster,
const bool ignoreUnavailable, pandora::ClusterList &clusterListU,
273 pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW)
const;
283 template <
typename T>
285 unsigned int &nW)
const 293 template <
typename T>
296 unsigned int nU(0), nV(0), nW(0);
302 template <
typename T>
310 template <
typename T>
318 template <
typename T>
320 const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW)
const 325 if (overlapList.end() == iter)
326 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
333 template <
typename T>
335 const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV)
const 340 if (overlapMatrix.end() == iter)
341 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
348 template <
typename T>
350 const pandora::Cluster *
const pClusterU)
const 355 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
362 template <
typename T>
370 template <
typename T>
378 template <
typename T>
386 template <
typename T>
398 template <
typename T>
410 template <
typename T>
418 template <
typename T>
426 template <
typename T>
434 template <
typename T>
442 template <
typename T>
453 #endif // #ifndef LAR_OVERLAP_TENSOR_H OverlapResult m_overlapResult
The overlap result.
ClusterNavigationMap m_clusterNavigationMapVW
The cluster navigation map V->W.
const ClusterNavigationMap & GetClusterNavigationMapVW() const
Get the cluster navigation map V->W.
ClusterNavigationMap m_clusterNavigationMapUV
The cluster navigation map U->V.
const pandora::Cluster * GetClusterW() const
Get the address of the w cluster.
const_iterator begin() const
Returns an iterator referring to the first element in the overlap tensor.
void GetNConnections(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, unsigned int &nU, unsigned int &nV, unsigned int &nW) const
Get the number of connections for a specified cluster.
const pandora::Cluster * m_pClusterW
The address of the w cluster.
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, ElementList &elementList) const
Get a list of elements connected to a specified cluster.
const ClusterNavigationMap & GetClusterNavigationMapUV() const
Get the cluster navigation map U->V.
std::unordered_map< const pandora::Cluster *, OverlapList > OverlapMatrix
void ExploreConnections(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Explore connections associated with a given cluster.
void ReplaceOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
SetReplace an existing overlap result.
const pandora::Cluster * GetClusterU() const
Get the address of the u cluster.
TheTensor m_overlapTensor
The overlap tensor.
std::unordered_map< const pandora::Cluster *, OverlapResult > OverlapList
const OverlapList & GetOverlapList(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV) const
Get the overlap list for a specified pair of clusters.
const_iterator end() const
Returns an iterator referring to the past-the-end element in the overlap tensor.
void SetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Set overlap result.
void Clear()
Clear overlap tensor.
std::vector< Element > ElementList
void GetUnambiguousElements(const bool ignoreUnavailable, ElementList &elementList) const
Get unambiguous elements.
const OverlapMatrix & GetOverlapMatrix(const pandora::Cluster *const pClusterU) const
Get the cluster overlap matrix for a specified cluster.
void GetSortedKeyClusters(pandora::ClusterVector &sortedKeyClusters) const
Get a sorted vector of key clusters (U clusters with current implementation)
Element(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Constructor.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
const pandora::Cluster * m_pClusterU
The address of the u cluster.
ClusterNavigationMap m_clusterNavigationMapWU
The cluster navigation map W->U.
const OverlapResult & GetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW) const
Get the overlap result for a specified trio of clusters.
bool operator<(const Element &rhs) const
Element less than operator.
const OverlapResult & GetOverlapResult() const
Get the overlap result.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
const pandora::Cluster * m_pClusterV
The address of the v cluster.
std::unordered_map< const pandora::Cluster *, OverlapMatrix > TheTensor
const pandora::Cluster * GetClusterV() const
Get the address of the v cluster.
void RemoveCluster(const pandora::Cluster *const pCluster)
Remove entries from tensor corresponding to specified cluster.
bool DefaultAmbiguityFunction(const pandora::ClusterList &clusterListU, const pandora::ClusterList &clusterListV, const pandora::ClusterList &clusterListW, const pandora::Cluster *&pClusterU, const pandora::Cluster *&pClusterV, const pandora::Cluster *&pClusterW) const
Default ambiguity function, checking that only one U, V and W cluster is found.
const ClusterNavigationMap & GetClusterNavigationMapWU() const
Get the cluster navigation map W->U.
TheTensor::const_iterator const_iterator