LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 413 of file ParticleRecoveryAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType().

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

414 {
415  const HitType hitType1(LArClusterHelper::GetClusterHitType(pCluster1));
416  const HitType hitType2(LArClusterHelper::GetClusterHitType(pCluster2));
417 
418  const Cluster *const pClusterU((TPC_VIEW_U == hitType1) ? pCluster1 : (TPC_VIEW_U == hitType2) ? pCluster2 : NULL);
419  const Cluster *const pClusterV((TPC_VIEW_V == hitType1) ? pCluster1 : (TPC_VIEW_V == hitType2) ? pCluster2 : NULL);
420  const Cluster *const pClusterW((TPC_VIEW_W == hitType1) ? pCluster1 : (TPC_VIEW_W == hitType2) ? pCluster2 : NULL);
421 
422  if (pClusterU && pClusterV && !pClusterW)
423  {
424  m_clusterNavigationMapUV[pClusterU].push_back(pClusterV);
425 
426  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterU))
427  m_keyClusters.push_back(pClusterU);
428  }
429  else if (!pClusterU && pClusterV && pClusterW)
430  {
431  m_clusterNavigationMapVW[pClusterV].push_back(pClusterW);
432 
433  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterV))
434  m_keyClusters.push_back(pClusterV);
435  }
436  else if (pClusterU && !pClusterV && pClusterW)
437  {
438  m_clusterNavigationMapWU[pClusterW].push_back(pClusterU);
439 
440  if (m_keyClusters.end() == std::find(m_keyClusters.begin(), m_keyClusters.end(), pClusterW))
441  m_keyClusters.push_back(pClusterW);
442  }
443  else
444  {
445  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
446  }
447 }
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.
HitType
Definition: HitType.h:12
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 451 of file ParticleRecoveryAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType().

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

453 {
454  if (ignoreUnavailable && !pCluster->IsAvailable())
455  return;
456 
457  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
458 
459  if (!((TPC_VIEW_U == hitType) || (TPC_VIEW_V == hitType) || (TPC_VIEW_W == hitType)))
460  throw StatusCodeException(STATUS_CODE_FAILURE);
461 
462  ClusterList &clusterList((TPC_VIEW_U == hitType) ? clusterListU : (TPC_VIEW_V == hitType) ? clusterListV : clusterListW);
463  const ClusterNavigationMap &navigationMap((TPC_VIEW_U == hitType) ? m_clusterNavigationMapUV
464  : (TPC_VIEW_V == hitType) ? m_clusterNavigationMapVW
466 
467  if (clusterList.end() != std::find(clusterList.begin(), clusterList.end(), pCluster))
468  return;
469 
470  clusterList.push_back(pCluster);
471 
472  ClusterNavigationMap::const_iterator iter = navigationMap.find(pCluster);
473 
474  if (navigationMap.end() == iter)
475  return;
476 
477  for (ClusterList::const_iterator cIter = iter->second.begin(), cIterEnd = iter->second.end(); cIter != cIterEnd; ++cIter)
478  this->GetConnectedElements(*cIter, ignoreUnavailable, clusterListU, clusterListV, clusterListW);
479 }
ClusterNavigationMap m_clusterNavigationMapVW
The cluster navigation map V->W.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
intermediate_table::const_iterator const_iterator
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.
ClusterNavigationMap m_clusterNavigationMapUV
The cluster navigation map U->V.
HitType
Definition: HitType.h:12
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: