Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::SimpleClusterMergingAlgorithm Class Reference

SimpleClusterMergingAlgorithm class. More...

#include <SimpleClusterMergingAlgorithm.h>

Inheritance diagram for lar_content::SimpleClusterMergingAlgorithm:
lar_content::ClusterMergingAlgorithm

Public Member Functions

 SimpleClusterMergingAlgorithm ()
 Default constructor. More...
 

Private Member Functions

void GetListOfCleanClusters (const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
 Populate cluster vector with subset of cluster list, containing clusters judged to be clean. More...
 
void PopulateClusterMergeMap (const pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const
 Form associations between pointing clusters. More...
 
bool IsAssociated (const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ) const
 Decide whether two clusters are associated. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

unsigned int m_minCaloHitsPerCluster
 The min number of calo hits per candidate cluster. More...
 
float m_maxClusterSeparation
 Maximum distance at which clusters can be joined. More...
 

Additional Inherited Members

- Protected Types inherited from lar_content::ClusterMergingAlgorithm
typedef std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
 
- Protected Member Functions inherited from lar_content::ClusterMergingAlgorithm
virtual pandora::StatusCode Run ()
 
void MergeClusters (pandora::ClusterVector &clusterVector, ClusterMergeMap &clusterMergeMap) const
 Merge associated clusters. More...
 
void CollectAssociatedClusters (const pandora::Cluster *const pSeedCluster, const ClusterMergeMap &clusterMergeMap, pandora::ClusterList &associatedClusterList) const
 Collect up all clusters associations related to a given seed cluster. More...
 
void CollectAssociatedClusters (const pandora::Cluster *const pSeedCluster, const pandora::Cluster *const pCurrentCluster, const ClusterMergeMap &clusterMergeMap, const pandora::ClusterSet &clusterVetoList, pandora::ClusterList &associatedClusterList) const
 Collect up all clusters associations related to a given seed cluster. More...
 
void GetSortedListOfCleanClusters (const pandora::ClusterVector &inputClusters, pandora::ClusterVector &outputClusters) const
 Sort the selected clusters, so that they have a well-defined ordering. More...
 
- Protected Attributes inherited from lar_content::ClusterMergingAlgorithm
std::string m_inputClusterListName
 The name of the input cluster list. If not specified, will access current list. More...
 

Detailed Description

SimpleClusterMergingAlgorithm class.

Definition at line 21 of file SimpleClusterMergingAlgorithm.h.

Constructor & Destructor Documentation

lar_content::SimpleClusterMergingAlgorithm::SimpleClusterMergingAlgorithm ( )

Default constructor.

Definition at line 20 of file SimpleClusterMergingAlgorithm.cc.

21 {
22 }
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
float m_maxClusterSeparation
Maximum distance at which clusters can be joined.

Member Function Documentation

void lar_content::SimpleClusterMergingAlgorithm::GetListOfCleanClusters ( const pandora::ClusterList *const  pClusterList,
pandora::ClusterVector &  clusterVector 
) const
privatevirtual

Populate cluster vector with subset of cluster list, containing clusters judged to be clean.

Parameters
pClusterListaddress of the cluster list
clusterVectorto receive the populated cluster vector

Implements lar_content::ClusterMergingAlgorithm.

Definition at line 26 of file SimpleClusterMergingAlgorithm.cc.

27 {
28  for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
29  {
30  const Cluster *const pCluster = *iter;
31 
32  if (!pCluster->IsAvailable())
33  continue;
34 
35  if (pCluster->GetNCaloHits() < m_minCaloHitsPerCluster)
36  continue;
37 
38  clusterVector.push_back(pCluster);
39  }
40 
41  std::sort(clusterVector.begin(), clusterVector.end(), LArClusterHelper::SortByNHits);
42 }
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
intermediate_table::const_iterator const_iterator
bool lar_content::SimpleClusterMergingAlgorithm::IsAssociated ( const pandora::Cluster *const  pClusterI,
const pandora::Cluster *const  pClusterJ 
) const
private

Decide whether two clusters are associated.

Parameters
pClusterIthe address of the first cluster
pClusterJthe address of the second cluster
Returns
boolean

Definition at line 70 of file SimpleClusterMergingAlgorithm.cc.

71 {
73  return false;
74 
75  return true;
76 }
float m_maxClusterSeparation
Maximum distance at which clusters can be joined.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
void lar_content::SimpleClusterMergingAlgorithm::PopulateClusterMergeMap ( const pandora::ClusterVector &  clusterVector,
ClusterMergeMap clusterMergeMap 
) const
privatevirtual

Form associations between pointing clusters.

Parameters
clusterVectorthe vector of clean clusters
clusterMergeMapthe matrix of cluster associations

Implements lar_content::ClusterMergingAlgorithm.

Definition at line 46 of file SimpleClusterMergingAlgorithm.cc.

47 {
48  for (ClusterVector::const_iterator iterI = clusterVector.begin(), iterEndI = clusterVector.end(); iterI != iterEndI; ++iterI)
49  {
50  const Cluster *const pClusterI = *iterI;
51 
52  for (ClusterVector::const_iterator iterJ = iterI, iterEndJ = clusterVector.end(); iterJ != iterEndJ; ++iterJ)
53  {
54  const Cluster *const pClusterJ = *iterJ;
55 
56  if (pClusterI == pClusterJ)
57  continue;
58 
59  if (this->IsAssociated(pClusterI, pClusterJ))
60  {
61  clusterMergeMap[pClusterI].push_back(pClusterJ);
62  clusterMergeMap[pClusterJ].push_back(pClusterI);
63  }
64  }
65  }
66 }
intermediate_table::const_iterator const_iterator
bool IsAssociated(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ) const
Decide whether two clusters are associated.
StatusCode lar_content::SimpleClusterMergingAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::ClusterMergingAlgorithm.

Definition at line 80 of file SimpleClusterMergingAlgorithm.cc.

81 {
82  PANDORA_RETURN_RESULT_IF_AND_IF(
83  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinCaloHitsPerCluster", m_minCaloHitsPerCluster));
84 
85  PANDORA_RETURN_RESULT_IF_AND_IF(
86  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxClusterSeparation", m_maxClusterSeparation));
87 
88  return ClusterMergingAlgorithm::ReadSettings(xmlHandle);
89 }
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
float m_maxClusterSeparation
Maximum distance at which clusters can be joined.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)

Member Data Documentation

float lar_content::SimpleClusterMergingAlgorithm::m_maxClusterSeparation
private

Maximum distance at which clusters can be joined.

Definition at line 46 of file SimpleClusterMergingAlgorithm.h.

unsigned int lar_content::SimpleClusterMergingAlgorithm::m_minCaloHitsPerCluster
private

The min number of calo hits per candidate cluster.

Definition at line 45 of file SimpleClusterMergingAlgorithm.h.


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