Constructor.
315 const ParticleFlowObject *
const pNeutrino(this->
GetNeutrino(nuPfos));
317 const PfoList &nuFinalStates(pNeutrino->GetDaughterPfoList());
320 CartesianVector nuWeightedDirTotal(0.
f, 0.
f, 0.
f);
321 unsigned int nuNHitsUsedTotal(0);
322 unsigned int nuNHitsTotal(0);
323 CartesianPointVector nuAllSpacePoints;
324 for (
const ParticleFlowObject *
const pPfo : nuFinalStates)
326 CartesianPointVector spacePoints;
329 nuAllSpacePoints.insert(nuAllSpacePoints.end(), spacePoints.begin(), spacePoints.end());
330 nuNHitsTotal += spacePoints.size();
332 if (spacePoints.size() < 5)
336 nuWeightedDirTotal +=
dir *
static_cast<float>(spacePoints.size());
337 nuNHitsUsedTotal += spacePoints.size();
340 if (nuNHitsUsedTotal == 0)
342 const CartesianVector nuWeightedDir(nuWeightedDirTotal * (1.
f / static_cast<float>(nuNHitsUsedTotal)));
344 CartesianPointVector pointsInSphere;
352 const float nuNFinalStatePfos(static_cast<float>(nuFinalStates.size()));
353 const float nuVertexY(nuVertex.GetY());
354 const float nuWeightedDirZ(nuWeightedDir.GetZ());
355 const float nuNSpacePointsInSphere(static_cast<float>(pointsInSphere.size()));
357 if (eigenValues.GetX() <= std::numeric_limits<float>::epsilon())
359 const float nuEigenRatioInSphere(eigenValues.GetY() / eigenValues.GetX());
362 unsigned int nCRHitsMax(0);
363 unsigned int nCRHitsTotal(0);
367 for (
const ParticleFlowObject *
const pPfo : crPfos)
369 CartesianPointVector spacePoints;
372 nCRHitsTotal += spacePoints.size();
374 if (spacePoints.size() < 5)
377 if (spacePoints.size() > nCRHitsMax)
379 nCRHitsMax = spacePoints.size();
383 crLongestTrackDirY = upperDir.GetY();
384 crLongestTrackDeflection = 1.f - upperDir.GetDotProduct(lowerDir * (-1.
f));
390 if (nCRHitsTotal == 0)
393 const float crFracHitsInLongestTrack =
static_cast<float>(nCRHitsMax) / static_cast<float>(nCRHitsTotal);
409 catch (StatusCodeException &)
pandora::CartesianVector EigenValues
const NeutrinoIdTool *const m_pTool
The tool that owns this.
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
pandora::CartesianVector GetLowerDirection(const pandora::CartesianPointVector &spacePoints) const
Use a sliding fit to get the lower direction of a collection of spacepoints.
bool m_isAvailable
Is the feature vector available.
LArMvaHelper::MvaFeatureVector m_featureVector
The MVA feature vector.
const pandora::ParticleFlowObject * GetNeutrino(const pandora::PfoList &nuPfos) const
Get the recontructed neutrino the input list of neutrino Pfos.
static int max(int a, int b)
pandora::CartesianVector GetDirectionFromVertex(const pandora::CartesianPointVector &spacePoints, const pandora::CartesianVector &vertex) const
Use a sliding fit to get the direction of a collection of spacepoint near a vertex position...
pandora::CartesianVector GetUpperDirection(const pandora::CartesianPointVector &spacePoints) const
Use a sliding fit to get the upper direction of a collection of spacepoints.
static void RunPca(const T &t, pandora::CartesianVector ¢roid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D p...
std::vector< pandora::CartesianVector > EigenVectors
void GetPointsInSphere(const pandora::CartesianPointVector &spacePoints, const pandora::CartesianVector &vertex, const float radius, pandora::CartesianPointVector &spacePointsInSphere) const
Get a vector of spacepoints within a given radius of a vertex point.
void GetSpacePoints(const pandora::ParticleFlowObject *const pPfo, pandora::CartesianPointVector &spacePoints) const
Get the 3D space points in a given pfo.