9 #include "Pandora/AlgorithmHeaders.h" 21 ClusterCharacterisationBaseAlgorithm::ClusterCharacterisationBaseAlgorithm() :
23 m_overwriteExistingId(false),
24 m_useUnavailableClusters(false)
40 const ClusterList *pClusterList = NULL;
41 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*
this, clusterListName, pClusterList));
43 if (!pClusterList || pClusterList->empty())
45 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
46 std::cout <<
"ClusterCharacterisationBaseAlgorithm: unable to find cluster list " << clusterListName << std::endl;
53 for (
const Cluster *
const pCluster : *pClusterList)
55 PandoraContentApi::Cluster::Metadata metadata;
56 metadata.m_particleId = UNKNOWN_PARTICLE_TYPE;
57 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::AlterMetadata(*
this, pCluster, metadata));
60 return STATUS_CODE_SUCCESS;
63 for (
const Cluster *
const pCluster : *pClusterList)
71 PandoraContentApi::Cluster::Metadata metadata;
75 metadata.m_particleId = MU_MINUS;
79 metadata.m_particleId = E_MINUS;
82 if (pCluster->GetParticleId() != metadata.m_particleId.Get())
83 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::AlterMetadata(*
this, pCluster, metadata));
87 return STATUS_CODE_SUCCESS;
94 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
97 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
100 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
103 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
106 return STATUS_CODE_SUCCESS;
Header file for the cluster characterisation base algorithm class.
bool m_overwriteExistingId
Whether to consider any clusters that already have an assigned particle id.
Header file for the geometry helper class.
bool m_useUnavailableClusters
Whether to consider clusters that are already constituents of a pfo.
Header file for the cluster helper class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
~ClusterCharacterisationBaseAlgorithm()
Destructor.
pandora::StatusCode Run()
pandora::StringVector m_inputClusterListNames
The names of the input cluster lists.
bool m_zeroMode
Whether to zero all existing cluster particle id, overrides all other parameters. ...
virtual bool IsClearTrack(const pandora::Cluster *const pCluster) const =0
Whether cluster is identified as a clear track.