9 #include "Pandora/AlgorithmHeaders.h" 18 ListPruningAlgorithm::ListPruningAlgorithm() :
19 m_warnIfObjectsUnavailable(true)
31 const PfoList *pPfoList(
nullptr);
32 const StatusCode statusCode(PandoraContentApi::GetList(*
this, listName, pPfoList));
34 if (STATUS_CODE_SUCCESS != statusCode)
35 throw StatusCodeException(statusCode);
37 const PfoList pfoList(*pPfoList);
39 for (
const ParticleFlowObject *
const pPfo : pfoList)
41 if (STATUS_CODE_SUCCESS != PandoraContentApi::Delete(*
this, pPfo, listName))
42 std::cout <<
"ListPruningAlgorithm: Could not delete Pfo." << std::endl;
45 catch (StatusCodeException &)
47 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
48 std::cout <<
"ListPruningAlgorithm: pfo list " << listName <<
" unavailable." << std::endl;
56 const ClusterList *pClusterList(
nullptr);
57 const StatusCode statusCode(PandoraContentApi::GetList(*
this, listName, pClusterList));
59 if (STATUS_CODE_SUCCESS != statusCode)
60 throw StatusCodeException(statusCode);
62 const ClusterList clusterList(*pClusterList);
64 for (
const Cluster *
const pCluster : clusterList)
70 std::cout <<
"ListPruningAlgorithm: Could not delete Cluster." << std::endl;
73 catch (StatusCodeException &)
75 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
76 std::cout <<
"ListPruningAlgorithm: cluster list " << listName <<
" unavailable." << std::endl;
85 const StatusCode statusCode(PandoraContentApi::GetList(*
this, listName, pVertexList));
87 if (STATUS_CODE_SUCCESS != statusCode)
88 throw StatusCodeException(statusCode);
92 for (
const Vertex *
const pVertex : vertexList)
98 std::cout <<
"ListPruningAlgorithm: Could not delete Vertex." << std::endl;
101 catch (StatusCodeException &)
103 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
104 std::cout <<
"ListPruningAlgorithm: vertex list " << listName <<
" unavailable." << std::endl;
108 return STATUS_CODE_SUCCESS;
115 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
118 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
121 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
124 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
127 return STATUS_CODE_SUCCESS;
pandora::StringVector m_clusterListNames
The cluster list names.
pandora::StringVector m_pfoListNames
The pfo list names.
Header file for the list pruning algorithm class.
pandora::StatusCode Run()
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool m_warnIfObjectsUnavailable
Whether to print warning if attempt made to delete unavailable objects.
std::list< Vertex > VertexList
pandora::StringVector m_vertexListNames
The vertex list names.