9 #include "Pandora/AlgorithmHeaders.h" 18 ClusteringParentAlgorithm::ClusteringParentAlgorithm() : m_replaceCurrentCaloHitList(false), m_replaceCurrentClusterList(true)
31 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentListName<CaloHit>(*
this, originalCaloHitListName));
32 const StatusCode statusCode(PandoraContentApi::ReplaceCurrentList<CaloHit>(*
this,
m_inputCaloHitListName));
34 if (STATUS_CODE_NOT_FOUND == statusCode)
36 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
39 return STATUS_CODE_SUCCESS;
42 if (STATUS_CODE_SUCCESS != statusCode)
47 const ClusterList *pClusterList = NULL;
49 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=,
57 if (!pClusterList->empty())
59 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Cluster>(*
this,
m_clusterListName));
62 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*
this,
m_clusterListName));
68 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<CaloHit>(*
this, originalCaloHitListName));
71 return STATUS_CODE_SUCCESS;
79 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithm(*
this, xmlHandle,
"ClusterFormation",
m_clusteringAlgorithmName));
81 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
85 PANDORA_RETURN_RESULT_IF_AND_IF(
86 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"InputCaloHitListName",
m_inputCaloHitListName));
88 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"ReplaceCurrentCaloHitList",
m_replaceCurrentCaloHitList));
91 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"ClusterListName",
m_clusterListName));
93 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"ReplaceCurrentClusterList",
m_replaceCurrentClusterList));
95 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.
QTextStream & endl(QTextStream &s)
std::string m_clusterListName
The name under which to save the new cluster list.