Create specialised Pfo from an generic input Pfo.
54 const LArTPC *
const pFirstLArTPC(this->GetPandora().GetGeometry()->GetLArTPCMap().
begin()->
second);
55 const float layerPitch(pFirstLArTPC->GetWirePitchW());
61 if (trackStateVector.empty())
65 LArTrackPfoFactory trackFactory;
66 LArTrackPfoParameters pfoParameters;
67 pfoParameters.m_particleId = (
LArPfoHelper::IsTrack(pInputPfo) ? pInputPfo->GetParticleId() : MU_MINUS);
68 pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
69 pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
70 pfoParameters.m_energy = 0.f;
71 pfoParameters.m_momentum = pInputPfo->GetMomentum();
72 pfoParameters.m_propertiesToAdd = pInputPfo->GetPropertiesMap();
73 pfoParameters.m_trackStateVector = trackStateVector;
75 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pOutputPfo, trackFactory));
77 const LArTrackPfo *
const pLArPfo =
dynamic_cast<const LArTrackPfo *
>(pOutputPfo);
79 throw StatusCodeException(STATUS_CODE_FAILURE);
82 PandoraContentApi::ParticleFlowObject::Metadata pfodata;
83 pfodata.m_momentum = pLArPfo->GetVertexDirection();
84 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*
this, pOutputPfo, pfodata));
86 const Vertex *pOutputVertex(NULL);
89 vtxParameters.m_position = pLArPfo->GetVertexPosition();
90 vtxParameters.m_vertexLabel = pInputVertex->GetVertexLabel();
91 vtxParameters.m_vertexType = pInputVertex->GetVertexType();
93 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*
this, vtxParameters, pOutputVertex));
94 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo(*
this, pOutputPfo, pOutputVertex));
96 catch (StatusCodeException &statusCodeException)
98 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
99 throw statusCodeException;
unsigned int m_slidingFitHalfWindow
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
static void GetSlidingFitTrajectory(const pandora::CartesianPointVector &pointVector, const pandora::CartesianVector &vertexPosition, const unsigned int layerWindow, const float layerPitch, LArTrackStateVector &trackStateVector, pandora::IntVector *const pIndexVector=nullptr)
Apply 3D sliding fit to a set of 3D points and return track trajectory.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
auto begin(FixedBins< T, C > const &) noexcept
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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.
std::vector< LArTrackState > LArTrackStateVector