22 const PfoList *pLeadingPfoList(
nullptr);
26 if (!pLeadingPfoList || pLeadingPfoList->empty())
29 std::cout <<
"ShowerHierarchyMopUpAlgorithm: unable to find pfos in provided list, " <<
m_leadingPfoListName << std::endl;
31 return STATUS_CODE_SUCCESS;
38 return STATUS_CODE_SUCCESS;
45 for (
const Pfo *
const pLeadingPfo : *pLeadingPfoList)
60 if (parentShowerPfos.end() != std::find(parentShowerPfos.begin(), parentShowerPfos.end(), pPfo))
63 parentShowerPfos.push_back(pPfo);
76 for (
const Pfo *
const pParentShowerPfo : parentShowerPfos)
81 for (
const Pfo *
const pDownstreamPfo : downstreamPfos)
83 if (pDownstreamPfo != pParentShowerPfo)
Header file for the pfo helper class.
Header file for the shower hierarchy mop up algorithm class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
static void GetAllDownstreamPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively, of all daughters associated with those pfos in an input lis...
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
virtual void MergeAndDeletePfos(const pandora::ParticleFlowObject *const pPfoToEnlarge, const pandora::ParticleFlowObject *const pPfoToDelete) const
Merge and delete a pair of pfos, with a specific set of conventions for cluster merging,...
pandora::StatusCode Run()
Run the algorithm.
void FindParentShowerPfos(const pandora::PfoList *const pLeadingPfoList, pandora::PfoList &parentShowerPfos) const
Starting with provided leading pfos, find all shower pfos that themselves have daughter pfos.
void PerformPfoMerges(const pandora::PfoList &parentShowerPfos) const
For each parent shower pfo, merge all downstream pfos back into the parent shower.
std::string m_leadingPfoListName
The input leading pfo list name (e.g. list of neutrino or testbeam pfos)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
const PfoList & GetDaughterPfoList() const
Get the daughter pfo list.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList