Create specialised Pfo from an generic input Pfo.
58 LArShowerPfoFactory pfoFactory;
59 LArShowerPfoParameters pfoParameters;
61 pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
62 pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
63 pfoParameters.m_energy = 0.f;
64 pfoParameters.m_momentum = pInputPfo->GetMomentum();
65 pfoParameters.m_propertiesToAdd = pInputPfo->GetPropertiesMap();
66 pfoParameters.m_showerVertex = pInputVertex->GetPosition();
67 pfoParameters.m_showerCentroid = showerPCA.GetCentroid();
68 pfoParameters.m_showerDirection = showerPCA.GetPrimaryAxis();
69 pfoParameters.m_showerSecondaryVector = showerPCA.GetSecondaryAxis();
70 pfoParameters.m_showerTertiaryVector = showerPCA.GetTertiaryAxis();
71 pfoParameters.m_showerEigenValues = showerPCA.GetEigenValues();
72 pfoParameters.m_showerLength = showerPCA.GetAxisLengths();
73 pfoParameters.m_showerOpeningAngle =
74 (showerPCA.GetPrimaryLength() > 0.f ? std::atan(showerPCA.GetSecondaryLength() / showerPCA.GetPrimaryLength()) : 0.
f);
76 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pOutputPfo, pfoFactory));
78 const LArShowerPfo *
const pLArPfo =
dynamic_cast<const LArShowerPfo *
>(pOutputPfo);
81 throw StatusCodeException(STATUS_CODE_FAILURE);
84 const Vertex *pOutputVertex =
nullptr;
86 PandoraContentApi::Vertex::Parameters vtxParameters;
87 vtxParameters.m_position = pInputVertex->GetPosition();
88 vtxParameters.m_vertexLabel = pInputVertex->GetVertexLabel();
89 vtxParameters.m_vertexType = pInputVertex->GetVertexType();
91 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*
this, vtxParameters, pOutputVertex));
92 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo<Vertex>(*
this, pOutputPfo, pOutputVertex));
94 catch (StatusCodeException &statusCodeException)
96 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
97 throw statusCodeException;
static LArShowerPCA GetPrincipalComponents(const pandora::CartesianPointVector &pointVector, const pandora::CartesianVector &vertexPosition)
Perform PCA analysis on a set of 3D points and return results.
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
static bool IsFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a primary parent particle.
static bool IsNeutrinoFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a final-state particle from a neutrino (or antineutrino) interaction.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex