Set up the test beam pfo.
57 pTestBeamPfo =
nullptr;
58 testBeamStartVertex = CartesianVector(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
60 for (
const Pfo *
const pNuDaughterPfo : pNuPfo->GetDaughterPfoList())
62 CaloHitList collectedHits;
65 for (
const CaloHit *
const pCaloHit : collectedHits)
67 if (pCaloHit->GetPositionVector().GetZ() < testBeamStartVertex.GetZ())
69 testBeamStartVertex = pCaloHit->GetPositionVector();
70 pTestBeamPfo = pNuDaughterPfo;
76 return STATUS_CODE_NOT_FOUND;
78 for (
const Pfo *
const pNuDaughterPfo : pNuPfo->GetDaughterPfoList())
80 if (pNuDaughterPfo != pTestBeamPfo)
81 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SetPfoParentDaughterRelationship(*
this, pTestBeamPfo, pNuDaughterPfo));
86 PANDORA_RETURN_RESULT_IF(
87 STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList(*
this, originalListName,
m_parentPfoListName, PfoList(1, pTestBeamPfo)));
90 PandoraContentApi::ParticleFlowObject::Metadata pfoMetadata;
91 pfoMetadata.m_propertiesToAdd[
"IsTestBeam"] = 1.f;
92 pfoMetadata.m_propertiesToAdd[
"TestBeamScore"] =
93 (pNuPfo->GetPropertiesMap().count(
"TestBeamScore")) ? pNuPfo->GetPropertiesMap().at(
"TestBeamScore") : 1.f;
94 pfoMetadata.m_particleId = (std::fabs(pTestBeamPfo->GetParticleId()) == E_MINUS) ? E_MINUS : PI_PLUS;
95 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*
this, pTestBeamPfo, pfoMetadata));
97 return STATUS_CODE_SUCCESS;
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
std::string m_parentPfoListName
The parent pfo list name.
std::string m_trackPfoListName
The track pfo list name.
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
std::string m_showerPfoListName
The shower pfo list name.