Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
SimpleClusterGrowingAlgorithm.cc
Go to the documentation of this file.
1
10
12
14
15using namespace pandora;
16
17namespace lar_content
18{
19
23
24//------------------------------------------------------------------------------------------------------------------------------------------
25
26void SimpleClusterGrowingAlgorithm::GetListOfCleanClusters(const ClusterList *const pClusterList, ClusterVector &clusterVector) const
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 clusterVector.push_back(pCluster);
36 }
37
38 std::sort(clusterVector.begin(), clusterVector.end(), LArClusterHelper::SortByNHits);
39}
40
41//------------------------------------------------------------------------------------------------------------------------------------------
42
44{
45 for (ClusterVector::const_iterator cIter = inputClusters.begin(), cIterEnd = inputClusters.end(); cIter != cIterEnd; ++cIter)
46 {
47 const Cluster *const pCluster = *cIter;
48
49 if (pCluster->GetNCaloHits() < m_minCaloHitsPerCluster)
50 continue;
51
52 seedClusters.push_back(pCluster);
53 }
54
55 std::sort(seedClusters.begin(), seedClusters.end(), LArClusterHelper::SortByNHits);
56}
57
58//------------------------------------------------------------------------------------------------------------------------------------------
59
61{
63 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinCaloHitsPerCluster", m_minCaloHitsPerCluster));
64
66}
67
68} // namespace lar_content
Grouping of header files for many classes of use in particle flow algorithms.
Header file for the cluster helper class.
Header file for the simple cluster growing algorithm class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
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,...
unsigned int m_minCaloHitsPerCluster
The minimum number of calo hits per seed cluster.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void GetListOfSeedClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &seedClusters) const
Select seed clusters for growing.
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &cleanClusters) const
Populate cluster vector with the subset of clusters judged to be clean.
Cluster class.
Definition Cluster.h:31
bool IsAvailable() const
Whether the cluster is available to be added to a particle flow object.
Definition Cluster.h:582
unsigned int GetNCaloHits() const
Get the number of calo hits in the cluster.
Definition Cluster.h:484
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
Definition XmlHelper.h:136
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.