8 #ifndef LAR_DELTA_RAY_MATCHING_ALGORITHM_H
9 #define LAR_DELTA_RAY_MATCHING_ALGORITHM_H 1
11 #include "Pandora/Algorithm.h"
18 template <
typename,
unsigned int>
19 class KDTreeLinkerAlgo;
20 template <
typename,
unsigned int>
21 class KDTreeNodeInfoT;
37 pandora::StatusCode
Run();
53 Particle(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const pandora::Cluster *
const pCluster3,
54 const pandora::ParticleFlowObject *
const pPfo);
100 typedef std::unordered_map<const pandora::CaloHit *, const pandora::Cluster *>
HitToClusterMap;
126 void GetAllPfos(
const std::string &inputPfoListName, pandora::PfoVector &pfoVector)
const;
134 void GetTrackPfos(
const std::string &inputPfoListName, pandora::PfoVector &pfoVector)
const;
146 typedef std::unordered_map<const pandora::ParticleFlowObject *, float>
PfoLengthMap;
231 void FindBestParentPfo(
const pandora::Cluster *
const pClusterU,
const pandora::Cluster *
const pClusterV,
const pandora::Cluster *
const pClusterW,
271 bool AreClustersMatched(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const pandora::Cluster *
const pCluster3)
const;
279 float GetDistanceSquaredToPfo(
const pandora::Cluster *
const pCluster,
const pandora::ParticleFlowObject *
const pPfo)
const;
287 void CreateDaughterPfo(
const pandora::ClusterList &clusterList,
const pandora::ParticleFlowObject *
const pParentPfo)
const;
295 void AddToDaughterPfo(
const pandora::ClusterList &clusterList,
const pandora::ParticleFlowObject *
const pParentPfo)
const;
297 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
345 #endif // #ifndef LAR_DELTA_RAY_MATCHING_ALGORITHM_H
void InitializeNearbyClusterMap(const std::string &clusterListName, ClusterToClustersMap &nearbyClusters)
Initialize a nearby cluster map with details relating to a specific cluster list. ...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_xOverlapWindow
The maximum allowed displacement in x position.
float m_pseudoChi2Cut
Pseudo chi2 cut for three view matching.
std::vector< HitKDNode2D > HitKDNode2DList
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
DeltaRayMatchingAlgorithm()
Default constructor.
std::unordered_map< const pandora::Cluster *, float > ClusterLengthMap
const pandora::Cluster * GetClusterV() const
Get cluster in V view.
Particle(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, const pandora::ParticleFlowObject *const pPfo)
Constructor.
void GetTrackPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const
Get a vector of track-like Pfos in the provided input Pfo lists.
ClusterToClustersMap m_nearbyClustersU
The nearby clusters map for the u view.
void TwoViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using pairs of views.
ClusterToClustersMap m_nearbyClustersV
The nearby clusters map for the v view.
void CreateParticles(const ParticleList &particleList) const
Build new particle flow objects.
ClusterToClustersMap m_nearbyClustersW
The nearby clusters map for the w view.
unsigned int GetNCaloHits() const
Get number of calo hits.
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
std::string m_inputClusterListNameV
The input cluster list name for the v view.
Data stored in each KDTree node. The dim1/dim2 fields are usually the duplication of some PFRecHit va...
const pandora::Cluster * m_pClusterU
Address of cluster in U view.
void GetAllPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const
Get a vector of all Pfos in the provided input Pfo lists.
pandora::StatusCode Run()
std::string m_parentPfoListName
The parent pfo list name.
std::string m_inputClusterListNameW
The input cluster list name for the w view.
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-trees.
void OneViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using single views.
std::unordered_map< const pandora::ParticleFlowObject *, float > PfoLengthMap
void ThreeViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using all three views.
DeltaRayMatchingAlgorithm class.
Header file for the lar two dimensional sliding fit result class.
void InitializeNearbyClusterMaps()
Initialize nearby cluster maps.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterToClustersMap
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
float GetDistanceSquaredToPfo(const pandora::Cluster *const pCluster, const pandora::ParticleFlowObject *const pPfo) const
Get displacementr between cluster and particle flow object.
bool AreClustersMatched(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const
Look at consistency of a combination of clusters.
const pandora::ParticleFlowObject * GetParentPfo() const
Get parent Pfo.
void FindBestParentPfo(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, const pandora::ParticleFlowObject *&pBestPfo) const
Find best Pfo to associate a UVW triplet.
void AddToDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const
Merge an input cluster list with an existing daughter Pfo.
std::string m_inputClusterListNameU
The input cluster list name for the u view.
float m_distanceForMatching
The maximum allowed distance between tracks and delta rays.
const pandora::Cluster * GetClusterW() const
Get cluster in W view.
void CreateDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const
Create a new Pfo from an input cluster list and set up a parent/daughter relationship.
KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
float GetLength(const Particle &particle, ClusterLengthMap &clusterLengthMap) const
Get the length (squared) of a candidate particle.
const pandora::ParticleFlowObject * m_pParentPfo
Address of parent Pfo.
void ClearNearbyClusterMaps()
Clear nearby cluster maps.
void SelectParticles(const ParticleList &inputParticles, ClusterLengthMap &clusterLengthMap, ParticleList &outputParticles) const
Resolve any ambiguities between candidate particles.
const pandora::Cluster * m_pClusterV
Address of cluster in V view.
void GetClusters(const std::string &clusterListName, pandora::ClusterVector &clusterVector) const
Get a vector containing all available input clusters in the provided cluster list, storing sliding linear fits in the algorithm cache.
float GetLengthFromCache(const pandora::Cluster *const pCluster, ClusterLengthMap &clusterLengthMap) const
Reduce number of length (squared) calculations by caching results when they are first obtained...
std::vector< art::Ptr< recob::Cluster > > ClusterVector
const pandora::Cluster * m_pClusterW
Address of cluster in W view.
const pandora::Cluster * GetClusterU() const
Get cluster in U view.
std::vector< Particle > ParticleList
unsigned int GetNViews() const
Get number of views.
std::string m_daughterPfoListName
The daughter pfo list name for new daughter particles.