9 #include "Pandora/AlgorithmHeaders.h"
20 StatusCode PfoHitCleaningAlgorithm::Run()
22 for (
unsigned int i = 0; i < m_pfoListNames.size(); ++i)
25 const std::string &pfoListName{m_pfoListNames.at(i)};
26 const std::string &clusterListName{m_clusterListNames.at(i)};
27 const PfoList *pList(
nullptr);
28 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*
this, pfoListName, pList));
30 if (pList && !pList->empty())
32 for (
const ParticleFlowObject *pPfo : *pList)
34 ClusterList clustersToRemove;
35 LArPfoHelper::GetClusters(pPfo, TPC_3D, clustersToRemove);
37 for (
const Cluster *pCluster : clustersToRemove)
39 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::RemoveFromPfo(*
this, pPfo, pCluster));
40 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
41 PandoraContentApi::Delete<Cluster>(*
this, pCluster, clusterListName));
47 return STATUS_CODE_SUCCESS;
52 StatusCode PfoHitCleaningAlgorithm::ReadSettings(
const TiXmlHandle xmlHandle)
54 PANDORA_RETURN_RESULT_IF_AND_IF(
55 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"PfoListNames", m_pfoListNames));
56 PANDORA_RETURN_RESULT_IF_AND_IF(
57 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"ClusterListNames", m_clusterListNames));
59 if (m_pfoListNames.size() != m_clusterListNames.size())
61 std::cout <<
"PfoHitCleaningAlgorithm: Mismatch between PFO and Cluster list sizes" << std::endl;
62 return STATUS_CODE_INVALID_PARAMETER;
65 return STATUS_CODE_SUCCESS;
Header file for the pfo helper class.
Header file for the cluster helper class.
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
Header file for the pfo hit cleaning algorithm class.
BEGIN_PROLOG could also be cout