Public Member Functions | Private Types | Private Attributes | List of all members
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 411 of file ParticleRecoveryAlgorithm.cc.

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

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

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.


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