9 #include "Pandora/AlgorithmHeaders.h" 18 ClusteringParentAlgorithm::ClusteringParentAlgorithm() :
19 m_replaceCurrentCaloHitList(false),
20 m_replaceCurrentClusterList(true)
29 std::string originalCaloHitListName;
33 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentListName<CaloHit>(*
this, originalCaloHitListName));
34 const StatusCode statusCode(PandoraContentApi::ReplaceCurrentList<CaloHit>(*
this,
m_inputCaloHitListName));
36 if (STATUS_CODE_NOT_FOUND == statusCode)
38 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
41 return STATUS_CODE_SUCCESS;
44 if (STATUS_CODE_SUCCESS != statusCode)
49 const ClusterList *pClusterList = NULL;
50 std::string newClusterListName;
51 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::RunClusteringAlgorithm(*
this,
m_clusteringAlgorithmName,
52 pClusterList, newClusterListName));
59 if (!pClusterList->empty())
61 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Cluster>(*
this,
m_clusterListName));
64 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*
this,
m_clusterListName));
70 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<CaloHit>(*
this, originalCaloHitListName));
73 return STATUS_CODE_SUCCESS;
81 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithm(*
this, xmlHandle,
84 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ProcessAlgorithm(*
this, xmlHandle,
88 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
91 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
95 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
98 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
101 return STATUS_CODE_SUCCESS;
Header file for the clustering parent algorithm class.
std::string m_clusteringAlgorithmName
The name of the clustering algorithm to run.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_associationAlgorithmName
The name of the topological association algorithm to run.
std::string m_inputCaloHitListName
The name of the input calo hit list, containing the hits to be clustered.
pandora::StatusCode Run()
bool m_replaceCurrentCaloHitList
Whether to permanently replace the original calo hit list as the "current" list upon completion...
bool m_replaceCurrentClusterList
Whether to subsequently use the new cluster list as the "current" list.
std::string m_clusterListName
The name under which to save the new cluster list.