8 #ifndef LAR_PFO_HELPER_H
9 #define LAR_PFO_HELPER_H 1
11 #include "Objects/Cluster.h"
12 #include "Objects/ParticleFlowObject.h"
13 #include "Objects/Vertex.h"
34 const pandora::ParticleFlowObject *
const pPfo,
const pandora::HitType &hitType, pandora::CartesianPointVector &coordinateVector);
43 static void GetCaloHits(
const pandora::PfoList &pfoList,
const pandora::HitType &hitType, pandora::CaloHitList &caloHitList);
52 static void GetCaloHits(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::HitType &hitType, pandora::CaloHitList &caloHitList);
61 static void GetIsolatedCaloHits(
const pandora::PfoList &pfoList,
const pandora::HitType &hitType, pandora::CaloHitList &caloHitList);
70 static void GetIsolatedCaloHits(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::HitType &hitType, pandora::CaloHitList &caloHitList);
78 static void GetAllCaloHits(
const pandora::ParticleFlowObject *pPfo, pandora::CaloHitList &caloHitList);
87 static void GetClusters(
const pandora::PfoList &pfoList,
const pandora::HitType &hitType, pandora::ClusterList &clusterList);
96 static void GetClusters(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::HitType &hitType, pandora::ClusterList &clusterList);
112 static void GetTwoDClusterList(
const pandora::ParticleFlowObject *
const pPfo, pandora::ClusterList &clusterList);
120 static void GetThreeDClusterList(
const pandora::ParticleFlowObject *
const pPfo, pandora::ClusterList &clusterList);
128 static void GetAllConnectedPfos(
const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList);
136 static void GetAllConnectedPfos(
const pandora::ParticleFlowObject *
const pPfo, pandora::PfoList &outputPfoList);
144 static void GetAllDownstreamPfos(
const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList);
152 static void GetAllDownstreamPfos(
const pandora::ParticleFlowObject *
const pPfo, pandora::PfoList &outputPfoList);
164 const pandora::ParticleFlowObject *
const pPfo, pandora::PfoList &outputTrackPfoList, pandora::PfoList &outputLeadingShowerPfoList);
199 static float GetClosestDistance(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::Cluster *
const pCluster);
207 static float GetThreeDSeparation(
const pandora::ParticleFlowObject *
const pPfo1,
const pandora::ParticleFlowObject *
const pPfo2);
214 static bool IsTwoD(
const pandora::ParticleFlowObject *
const pPfo);
221 static bool IsThreeD(
const pandora::ParticleFlowObject *
const pPfo);
228 static bool IsTrack(
const pandora::ParticleFlowObject *
const pPfo);
235 static bool IsShower(
const pandora::ParticleFlowObject *
const pPfo);
253 static bool IsFinalState(
const pandora::ParticleFlowObject *
const pPfo);
271 static bool IsNeutrino(
const pandora::ParticleFlowObject *
const pPfo);
289 static bool IsTestBeam(
const pandora::ParticleFlowObject *
const pPfo);
297 static void GetRecoNeutrinos(
const pandora::PfoList *
const pPfoList, pandora::PfoList &recoNeutrinos);
306 static const pandora::ParticleFlowObject *
GetParentPfo(
const pandora::ParticleFlowObject *
const pPfo);
315 static const pandora::ParticleFlowObject *
GetParentNeutrino(
const pandora::ParticleFlowObject *
const pPfo);
324 static const pandora::Vertex *
GetVertex(
const pandora::ParticleFlowObject *
const pPfo);
355 static void GetSlidingFitTrajectory(
const pandora::CartesianPointVector &pointVector,
const pandora::CartesianVector &vertexPosition,
367 static void GetSlidingFitTrajectory(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::Vertex *
const pVertex,
368 const unsigned int slidingFitHalfWindow,
const float layerPitch,
LArTrackStateVector &trackStateVector);
400 static bool SortByNHits(
const pandora::ParticleFlowObject *
const pLhs,
const pandora::ParticleFlowObject *
const pRhs);
423 template <
typename T>
424 static void SlidingFitTrajectoryImpl(
const T *
const pT,
const pandora::CartesianVector &vertexPosition,
const unsigned int layerWindow,
430 #endif // #ifndef LAR_PFO_HELPER_H
static LArShowerPCA GetPrincipalComponents(const pandora::CartesianPointVector &pointVector, const pandora::CartesianVector &vertexPosition)
Perform PCA analysis on a set of 3D points and return results.
static float GetThreeDSeparation(const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2)
Get distance between two Pfos using 3D clusters.
static unsigned int GetNumberOfTwoDHits(const pandora::ParticleFlowObject *const pPfo)
Get the number of 2D hits of a PFO.
static bool IsThreeD(const pandora::ParticleFlowObject *const pPfo)
Does Pfo contain 3D clusters.
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
static const pandora::Vertex * GetVertexWithLabel(const pandora::VertexList &vertexList, const pandora::VertexLabel vertexLabel)
Get the vertex with a specific vertex label in a given vertex list.
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
static void GetRecoNeutrinos(const pandora::PfoList *const pPfoList, pandora::PfoList &recoNeutrinos)
Get neutrino pfos from an input pfo list.
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
Header file for lar pfo objects.
static float GetThreeDLengthSquared(const pandora::ParticleFlowObject *const pPfo)
Calculate length of Pfo using 3D clusters.
static float GetClosestDistance(const pandora::ParticleFlowObject *const pPfo, const pandora::Cluster *const pCluster)
Get closest distance between Pfo and cluster.
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 IsTwoD(const pandora::ParticleFlowObject *const pPfo)
Does Pfo contain 2D clusters.
static const pandora::Vertex * GetTestBeamInteractionVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo test beam interaction vertex.
std::vector< int > IntVector
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
static float GetTwoDLengthSquared(const pandora::ParticleFlowObject *const pPfo)
Calculate length of Pfo using 2D clusters.
static void GetAllCaloHits(const pandora::ParticleFlowObject *pPfo, pandora::CaloHitList &caloHitList)
Get a list of all calo hits (including isolated) of all types from a given pfo.
static void SlidingFitTrajectoryImpl(const T *const pT, const pandora::CartesianVector &vertexPosition, const unsigned int layerWindow, const float layerPitch, LArTrackStateVector &trackStateVector, pandora::IntVector *const pIndexVector=nullptr)
Implementation of sliding fit trajectory extraction.
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
static int GetHierarchyTier(const pandora::ParticleFlowObject *const pPfo)
Determine the position in the hierarchy for the MCParticle.
static bool IsTestBeam(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a test beam particle.
static int GetPrimaryNeutrino(const pandora::ParticleFlowObject *const pPfo)
Get primary neutrino or antineutrino.
static const pandora::ParticleFlowObject * GetParentPfo(const pandora::ParticleFlowObject *const pPfo)
Get the primary parent pfo.
static void GetCoordinateVector(const pandora::ParticleFlowObject *const pPfo, const pandora::HitType &hitType, pandora::CartesianPointVector &coordinateVector)
Get a list of coordinates of a particular hit type from an input pfos.
static const pandora::ParticleFlowObject * GetParentNeutrino(const pandora::ParticleFlowObject *const pPfo)
Get primary neutrino or antineutrino.
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
static void GetThreeDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 3D clusters from an input pfo.
static bool SortByHitProjection(const LArTrackTrajectoryPoint &lhs, const LArTrackTrajectoryPoint &rhs)
Sort pfos by number of constituent hits.
static void GetBreadthFirstHierarchyRepresentation(const pandora::ParticleFlowObject *const pPfo, pandora::PfoList &pfoList)
Retrieve a linearised representation of the PFO hierarchy in breadth first order. This iterates over ...
static bool IsFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a primary parent particle.
static void GetIsolatedCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of isolated calo hits of a particular hit type from a list of pfos.
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 IsNeutrinoFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a final-state particle from a neutrino (or antineutrino) interaction.
std::vector< LArTrackState > LArTrackStateVector
LArTrackTrajectoryPoint class.
static void GetAllConnectedPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively including all daughters and parents associated with those pf...
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::list< Vertex > VertexList
static bool IsTestBeamFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a final-state particle from a test beam particle interaction.