9 #include "Pandora/AlgorithmHeaders.h" 21 DeltaRayGrowingAlgorithm::DeltaRayGrowingAlgorithm() :
22 m_minCaloHitsPerCluster(2),
23 m_minSeedClusterCaloHits(5),
24 m_maxSeedClusterLength(10.
f),
25 m_maxSeedClusterDisplacement(1.5
f)
33 for (
const Cluster *
const pCluster : *pClusterList)
38 clusterVector.push_back(pCluster);
48 if (inputClusters.empty())
54 PfoVector parentPfos, daughterPfos;
58 ClusterList parentClusters, daughterClusters;
60 for (
const Pfo *
const pParentPfo : parentPfos)
63 for (
const Pfo *
const pDaughterPfo : daughterPfos)
67 for (
const Cluster *
const pCluster : parentClusters)
70 seedClusters.push_back(pCluster);
74 for (
const Cluster *
const pCluster : daughterClusters)
76 seedClusters.push_back(pCluster);
80 for (
const Cluster *
const pCluster : inputClusters)
85 const float parentDistance(
91 const float daughterDistance(
97 seedClusters.push_back(pCluster);
107 const PfoList *pPfoList(
nullptr);
108 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*
this, inputPfoListName, pPfoList));
113 for (
const Pfo *
const pPfo : *pPfoList)
114 pfoVector.push_back(pPfo);
123 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"ParentPfoListName",
m_parentPfoListName));
124 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"DaughterPfoListName",
m_daughterPfoListName));
126 PANDORA_RETURN_RESULT_IF_AND_IF(
127 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinCaloHitsPerCluster",
m_minCaloHitsPerCluster));
129 PANDORA_RETURN_RESULT_IF_AND_IF(
130 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinSeedClusterCaloHits",
m_minSeedClusterCaloHits));
132 PANDORA_RETURN_RESULT_IF_AND_IF(
133 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MaxSeedClusterLength",
m_maxSeedClusterLength));
135 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
float m_maxSeedClusterLength
The maximum length of a parent clusters.
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.
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
Header file for the pfo helper class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
void GetListOfSeedClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &seedClusters) const
Select seed clusters for growing.
std::string m_daughterPfoListName
The daughter Pfo list name.
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &cleanClusters) const
Populate cluster vector with the subset of clusters judged to be clean.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
Header file for the cluster helper class.
unsigned int m_minCaloHitsPerCluster
The minimum number of calo hits per candidate cluster.
static int max(int a, int b)
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
unsigned int m_minSeedClusterCaloHits
The minimum number of calo hits for seed clusters.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
std::string m_parentPfoListName
The parent Pfo list name.
void GetPfos(const std::string inputPfoListName, pandora::PfoVector &pfoVector) const
Get a vector of Pfos from an input Pfo list name.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
float m_maxSeedClusterDisplacement
The maximum distance between parent and daughter clusters.