9 #include "Pandora/AlgorithmHeaders.h"
18 StatusCode ListMergingAlgorithm::Run()
21 if (m_sourceClusterListNames.size() != m_targetClusterListNames.size())
22 return STATUS_CODE_FAILURE;
24 for (
unsigned int iIndex = 0, iIndexEnd = m_sourceClusterListNames.size(); iIndex < iIndexEnd; ++iIndex)
26 const std::string &sourceListName(m_sourceClusterListNames.at(iIndex));
27 const std::string &targetListName(m_targetClusterListNames.at(iIndex));
29 const StatusCode statusCode(PandoraContentApi::SaveList<Cluster>(*
this, sourceListName, targetListName));
31 if (STATUS_CODE_SUCCESS != statusCode)
33 if (STATUS_CODE_NOT_FOUND == statusCode)
35 if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
36 std::cout <<
"ListMergingAlgorithm: cluster list not found, source: " << sourceListName
37 <<
", target: " << targetListName << std::endl;
39 else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
41 if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
42 std::cout <<
"ListMergingAlgorithm: no clusters to move, source: " << sourceListName <<
", target: " << targetListName << std::endl;
46 std::cout <<
"ListMergingAlgorithm: error in cluster merging, source: " << sourceListName <<
", target: " << targetListName
54 if (m_sourcePfoListNames.size() != m_targetPfoListNames.size())
55 return STATUS_CODE_FAILURE;
57 for (
unsigned int iIndex = 0, iIndexEnd = m_sourcePfoListNames.size(); iIndex < iIndexEnd; ++iIndex)
59 const std::string &sourceListName(m_sourcePfoListNames.at(iIndex));
60 const std::string &targetListName(m_targetPfoListNames.at(iIndex));
62 const StatusCode statusCode(PandoraContentApi::SaveList<Pfo>(*
this, sourceListName, targetListName));
64 if (STATUS_CODE_SUCCESS != statusCode)
66 if (STATUS_CODE_NOT_FOUND == statusCode)
68 if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
69 std::cout <<
"ListMergingAlgorithm: pfo list not found, source: " << sourceListName <<
", target: " << targetListName << std::endl;
71 else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
73 if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
74 std::cout <<
"ListMergingAlgorithm: no pfos to move, source: " << sourceListName <<
", target: " << targetListName << std::endl;
78 std::cout <<
"ListMergingAlgorithm: error in pfo merging, source: " << sourceListName <<
", target: " << targetListName << std::endl;
84 return STATUS_CODE_SUCCESS;
89 StatusCode ListMergingAlgorithm::ReadSettings(
const TiXmlHandle xmlHandle)
91 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
92 XmlHelper::ReadVectorOfValues(xmlHandle,
"SourceClusterListNames", m_sourceClusterListNames));
94 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
95 XmlHelper::ReadVectorOfValues(xmlHandle,
"TargetClusterListNames", m_targetClusterListNames));
97 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
98 XmlHelper::ReadVectorOfValues(xmlHandle,
"SourcePfoListNames", m_sourcePfoListNames));
100 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
101 XmlHelper::ReadVectorOfValues(xmlHandle,
"TargetPfoListNames", m_targetPfoListNames));
103 if ((m_sourceClusterListNames.size() != m_targetClusterListNames.size()) || (m_sourcePfoListNames.size() != m_targetPfoListNames.size()))
105 std::cout <<
"ListMergingAlgorithm::ReadSettings: invalid list configuration " << std::endl;
106 return STATUS_CODE_INVALID_PARAMETER;
109 return STATUS_CODE_SUCCESS;
Header file for the list merging algorithm class.
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
BEGIN_PROLOG could also be cout