LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor Class Reference

SimpleOverlapTensor class. More...

Public Member Functions

void AddAssociation (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2)
 Add an association between two clusters to the simple overlap tensor. More...
 
void GetConnectedElements (const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
 Get elements connected to a specified cluster. More...
 
const pandora::ClusterList & GetKeyClusters () const
 Get the list of key clusters. More...
 

Private Types

typedef std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
 

Private Attributes

pandora::ClusterList m_keyClusters
 The list of key clusters. More...
 
ClusterNavigationMap m_clusterNavigationMapUV
 The cluster navigation map U->V. More...
 
ClusterNavigationMap m_clusterNavigationMapVW
 The cluster navigation map V->W. More...
 
ClusterNavigationMap m_clusterNavigationMapWU
 The cluster navigation map W->U. More...
 

Detailed Description

SimpleOverlapTensor class.

Definition at line 33 of file ParticleRecoveryAlgorithm.h.

Member Typedef Documentation

typedef std::unordered_map<const pandora::Cluster*, pandora::ClusterList> lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::ClusterNavigationMap
private

Definition at line 64 of file ParticleRecoveryAlgorithm.h.

Member Function Documentation

void lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::AddAssociation ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2 
)

Add an association between two clusters to the simple overlap tensor.

Parameters
pCluster1address of cluster 1
pCluster2address of cluster 2

Definition at line 403 of file ParticleRecoveryAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType().

Referenced by lar_content::ParticleRecoveryAlgorithm::FindOverlaps().

404 {
405  const HitType hitType1(LArClusterHelper::GetClusterHitType(pCluster1));
406  const HitType hitType2(LArClusterHelper::GetClusterHitType(pCluster2));
407 
408  const Cluster *const pClusterU((TPC_VIEW_U == hitType1) ? pCluster1 : (TPC_VIEW_U == hitType2) ? pCluster2 : NULL);
409  const Cluster *const pClusterV((TPC_VIEW_V == hitType1) ? pCluster1 : (TPC_VIEW_V == hitType2) ? pCluster2 : NULL);
410  const Cluster *const pClusterW((TPC_VIEW_W == hitType1) ? pCluster1 : (TPC_VIEW_W == hitType2) ? pCluster2 : NULL);
411 
412  if (pClusterU && pClusterV && !pClusterW)
413  {
414  m_clusterNavigationMapUV[pClusterU].push_back(pClusterV);
415 
416  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterU))
417  m_keyClusters.push_back(pClusterU);
418  }
419  else if (!pClusterU && pClusterV && pClusterW)
420  {
421  m_clusterNavigationMapVW[pClusterV].push_back(pClusterW);
422 
423  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterV))
424  m_keyClusters.push_back(pClusterV);
425  }
426  else if (pClusterU && !pClusterV && pClusterW)
427  {
428  m_clusterNavigationMapWU[pClusterW].push_back(pClusterU);
429 
430  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterW))
431  m_keyClusters.push_back(pClusterW);
432  }
433  else
434  {
435  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
436  }
437 }
ClusterNavigationMap m_clusterNavigationMapVW
The cluster navigation map V->W.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
ClusterNavigationMap m_clusterNavigationMapWU
The cluster navigation map W->U.
pandora::ClusterList m_keyClusters
The list of key clusters.
ClusterNavigationMap m_clusterNavigationMapUV
The cluster navigation map U->V.
void lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::GetConnectedElements ( const pandora::Cluster *const  pCluster,
const bool  ignoreUnavailable,
pandora::ClusterList &  clusterListU,
pandora::ClusterList &  clusterListV,
pandora::ClusterList &  clusterListW 
) const

Get elements connected to a specified cluster.

Parameters
pClusteraddress of the cluster
elementListthe element list
clusterListUconnected u clusters
clusterListVconnected v clusters
clusterListWconnected w clusters

Definition at line 441 of file ParticleRecoveryAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType().

Referenced by lar_content::ParticleRecoveryAlgorithm::ExamineTensor().

443 {
444  if (ignoreUnavailable && !pCluster->IsAvailable())
445  return;
446 
447  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
448 
449  if (!((TPC_VIEW_U == hitType) || (TPC_VIEW_V == hitType) || (TPC_VIEW_W == hitType)))
450  throw StatusCodeException(STATUS_CODE_FAILURE);
451 
452  ClusterList &clusterList((TPC_VIEW_U == hitType) ? clusterListU : (TPC_VIEW_V == hitType) ? clusterListV : clusterListW);
453  const ClusterNavigationMap &navigationMap((TPC_VIEW_U == hitType) ? m_clusterNavigationMapUV : (TPC_VIEW_V == hitType) ? m_clusterNavigationMapVW : m_clusterNavigationMapWU);
454 
455  if (clusterList.end() != std::find(clusterList.begin(), clusterList.end(), pCluster))
456  return;
457 
458  clusterList.push_back(pCluster);
459 
460  ClusterNavigationMap::const_iterator iter = navigationMap.find(pCluster);
461 
462  if (navigationMap.end() == iter)
463  return;
464 
465  for (ClusterList::const_iterator cIter = iter->second.begin(), cIterEnd = iter->second.end(); cIter != cIterEnd; ++cIter)
466  this->GetConnectedElements(*cIter, ignoreUnavailable, clusterListU, clusterListV, clusterListW);
467 }
ClusterNavigationMap m_clusterNavigationMapVW
The cluster navigation map V->W.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
ClusterNavigationMap m_clusterNavigationMapWU
The cluster navigation map W->U.
intermediate_table::const_iterator const_iterator
ClusterNavigationMap m_clusterNavigationMapUV
The cluster navigation map U->V.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get elements connected to a specified cluster.
const pandora::ClusterList & lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::GetKeyClusters ( ) const
inline

Get the list of key clusters.

Returns
the list of key clusters

Definition at line 199 of file ParticleRecoveryAlgorithm.h.

References m_keyClusters.

Referenced by lar_content::ParticleRecoveryAlgorithm::ExamineTensor().

200 {
201  return m_keyClusters;
202 }
pandora::ClusterList m_keyClusters
The list of key clusters.

Member Data Documentation

ClusterNavigationMap lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::m_clusterNavigationMapUV
private

The cluster navigation map U->V.

Definition at line 67 of file ParticleRecoveryAlgorithm.h.

ClusterNavigationMap lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::m_clusterNavigationMapVW
private

The cluster navigation map V->W.

Definition at line 68 of file ParticleRecoveryAlgorithm.h.

ClusterNavigationMap lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::m_clusterNavigationMapWU
private

The cluster navigation map W->U.

Definition at line 69 of file ParticleRecoveryAlgorithm.h.

pandora::ClusterList lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::m_keyClusters
private

The list of key clusters.

Definition at line 66 of file ParticleRecoveryAlgorithm.h.

Referenced by GetKeyClusters().


The documentation for this class was generated from the following files: