LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
DeltaRayMatchingAlgorithm class. More...
#include "DeltaRayMatchingAlgorithm.h"
Classes | |
class | Particle |
Particle class. More... | |
Public Member Functions | |
DeltaRayMatchingAlgorithm () | |
Default constructor. More... | |
Private Types | |
typedef std::vector< Particle > | ParticleList |
typedef KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > | HitKDTree2D |
typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > | HitKDNode2D |
typedef std::vector< HitKDNode2D > | HitKDNode2DList |
typedef std::unordered_map< const pandora::Cluster *, pandora::ClusterList > | ClusterToClustersMap |
typedef std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > | HitToClusterMap |
typedef std::unordered_map< const pandora::Cluster *, float > | ClusterLengthMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, float > | PfoLengthMap |
Private Member Functions | |
pandora::StatusCode | Run () |
void | InitializeNearbyClusterMaps () |
Initialize nearby cluster maps. More... | |
void | InitializeNearbyClusterMap (const std::string &clusterListName, ClusterToClustersMap &nearbyClusters) |
Initialize a nearby cluster map with details relating to a specific cluster list. More... | |
void | ClearNearbyClusterMaps () |
Clear nearby cluster maps. More... | |
void | GetAllPfos (const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const |
Get a vector of all Pfos in the provided input Pfo lists. More... | |
void | GetTrackPfos (const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const |
Get a vector of track-like Pfos in the provided input Pfo lists. More... | |
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. More... | |
void | ThreeViewMatching (ClusterLengthMap &clusterLengthMap) const |
Match clusters using all three views. More... | |
void | TwoViewMatching (ClusterLengthMap &clusterLengthMap) const |
Match clusters using pairs of views. More... | |
void | OneViewMatching (ClusterLengthMap &clusterLengthMap) const |
Match clusters using single views. More... | |
void | ThreeViewMatching (const pandora::ClusterVector &clusters1, const pandora::ClusterVector &clusters2, const pandora::ClusterVector &clusters3, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, ParticleList &particleList) const |
Match clusters using all three views. More... | |
void | TwoViewMatching (const pandora::ClusterVector &clusters1, const pandora::ClusterVector &clusters2, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, ParticleList &particleList) const |
Match clusters using a pair of views. More... | |
void | OneViewMatching (const pandora::ClusterVector &clusters, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, ParticleList &particleList) const |
Match clusters using a single view. More... | |
void | SelectParticles (const ParticleList &inputParticles, ClusterLengthMap &clusterLengthMap, ParticleList &outputParticles) const |
Resolve any ambiguities between candidate particles. More... | |
void | CreateParticles (const ParticleList &particleList) const |
Build new particle flow objects. More... | |
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. More... | |
float | GetLengthFromCache (const pandora::Cluster *const pCluster, ClusterLengthMap &clusterLengthMap) const |
Reduce number of length (squared) calculations by caching results when they are first obtained. More... | |
float | GetLengthFromCache (const pandora::ParticleFlowObject *const pPfo, PfoLengthMap &pfoLengthMap) const |
Reduce number of length (squared) calculations by caching results when they are first obtained. More... | |
float | GetLength (const Particle &particle, ClusterLengthMap &clusterLengthMap) const |
Get the length (squared) of a candidate particle. More... | |
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. More... | |
float | GetDistanceSquaredToPfo (const pandora::Cluster *const pCluster, const pandora::ParticleFlowObject *const pPfo) const |
Get displacementr between cluster and particle flow object. More... | |
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. More... | |
void | AddToDaughterPfo (const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const |
Merge an input cluster list with an existing daughter Pfo. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
std::string | m_parentPfoListName |
The parent pfo list name. More... | |
std::string | m_daughterPfoListName |
The daughter pfo list name for new daughter particles. More... | |
std::string | m_inputClusterListNameU |
The input cluster list name for the u view. More... | |
std::string | m_inputClusterListNameV |
The input cluster list name for the v view. More... | |
std::string | m_inputClusterListNameW |
The input cluster list name for the w view. More... | |
unsigned int | m_minCaloHitsPerCluster |
The min number of calo hits per candidate cluster. More... | |
float | m_xOverlapWindow |
The maximum allowed displacement in x position. More... | |
float | m_distanceForMatching |
The maximum allowed distance between tracks and delta rays. More... | |
float | m_pseudoChi2Cut |
Pseudo chi2 cut for three view matching. More... | |
float | m_searchRegion1D |
Search region, applied to each dimension, for look-up from kd-trees. More... | |
ClusterToClustersMap | m_nearbyClustersU |
The nearby clusters map for the u view. More... | |
ClusterToClustersMap | m_nearbyClustersV |
The nearby clusters map for the v view. More... | |
ClusterToClustersMap | m_nearbyClustersW |
The nearby clusters map for the w view. More... | |
DeltaRayMatchingAlgorithm class.
Definition at line 28 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 145 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 99 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 96 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 97 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 95 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 100 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 93 of file DeltaRayMatchingAlgorithm.h.
|
private |
Definition at line 146 of file DeltaRayMatchingAlgorithm.h.
lar_content::DeltaRayMatchingAlgorithm::DeltaRayMatchingAlgorithm | ( | ) |
Default constructor.
Definition at line 24 of file DeltaRayMatchingAlgorithm.cc.
|
private |
Merge an input cluster list with an existing daughter Pfo.
clusterList | the list of clusters |
pParentPfo | address of the parent pfo |
Definition at line 702 of file DeltaRayMatchingAlgorithm.cc.
References lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArPfoHelper::GetClusters(), m_inputClusterListNameU, m_inputClusterListNameV, and m_inputClusterListNameW.
Referenced by CreateParticles().
|
private |
Look at consistency of a combination of clusters.
pCluster1 | pointer to first luster |
pCluster2 | pointer to second cluster |
pCluster3 | pointer to third cluster |
Definition at line 436 of file DeltaRayMatchingAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArGeometryHelper::GetWirePitch(), m_pseudoChi2Cut, m_xOverlapWindow, lar_content::LArGeometryHelper::MergeTwoPositions(), n, and x.
Referenced by OneViewMatching().
|
private |
Clear nearby cluster maps.
Definition at line 125 of file DeltaRayMatchingAlgorithm.cc.
References m_nearbyClustersU, m_nearbyClustersV, and m_nearbyClustersW.
Referenced by InitializeNearbyClusterMaps(), and Run().
|
private |
Create a new Pfo from an input cluster list and set up a parent/daughter relationship.
clusterList | the list of clusters |
pParentPfo | address of the parent pfo |
Definition at line 675 of file DeltaRayMatchingAlgorithm.cc.
References f, and m_daughterPfoListName.
Referenced by CreateParticles().
|
private |
Build new particle flow objects.
particleList | the list of candidate particles |
Definition at line 385 of file DeltaRayMatchingAlgorithm.cc.
References AddToDaughterPfo(), CreateDaughterPfo(), GetAllPfos(), GetTrackPfos(), m_daughterPfoListName, and m_parentPfoListName.
Referenced by OneViewMatching(), ThreeViewMatching(), and TwoViewMatching().
|
private |
Find best Pfo to associate a UVW triplet.
pClusterU | pointer to U view cluster |
pClusterV | pointer to V view cluster |
pClusterW | pointer to W view cluster |
clusterLengthMap | the cluster length map |
pfoLengthMap | the pfo length map |
pBestPfo | to receive the address of the best Pfo |
Definition at line 525 of file DeltaRayMatchingAlgorithm.cc.
References f, GetAllPfos(), GetDistanceSquaredToPfo(), GetLengthFromCache(), lar_content::LArClusterHelper::GetLengthSquared(), GetTrackPfos(), m_daughterPfoListName, m_distanceForMatching, and m_parentPfoListName.
Referenced by OneViewMatching().
|
private |
Get a vector of all Pfos in the provided input Pfo lists.
inputPfoListName | the input Pfo list name |
pfoVector | the output vector of Pfos |
Definition at line 134 of file DeltaRayMatchingAlgorithm.cc.
References lar_content::LArPfoHelper::SortByNHits().
Referenced by CreateParticles(), FindBestParentPfo(), GetTrackPfos(), and Run().
|
private |
Get a vector containing all available input clusters in the provided cluster list, storing sliding linear fits in the algorithm cache.
clusterListName | the vector of cluster list names |
clusterVector | to receive the populated cluster vector |
Definition at line 170 of file DeltaRayMatchingAlgorithm.cc.
References m_minCaloHitsPerCluster, and lar_content::LArClusterHelper::SortByNHits().
Referenced by OneViewMatching(), ThreeViewMatching(), and TwoViewMatching().
|
private |
Get displacementr between cluster and particle flow object.
pCluster | pointer to cluster |
pPfo | pointer to particle flow object |
Definition at line 638 of file DeltaRayMatchingAlgorithm.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArPfoHelper::GetClusters(), m_nearbyClustersU, m_nearbyClustersV, and m_nearbyClustersW.
Referenced by FindBestParentPfo().
|
private |
Get the length (squared) of a candidate particle.
particle | the particle |
clusterLengthMap | the cluster length map |
Definition at line 620 of file DeltaRayMatchingAlgorithm.cc.
References f, lar_content::DeltaRayMatchingAlgorithm::Particle::GetClusterU(), lar_content::DeltaRayMatchingAlgorithm::Particle::GetClusterV(), lar_content::DeltaRayMatchingAlgorithm::Particle::GetClusterW(), and GetLengthFromCache().
Referenced by SelectParticles().
|
private |
Reduce number of length (squared) calculations by caching results when they are first obtained.
pCluster | the cluster |
clusterLengthMap | the cluster length map |
Referenced by FindBestParentPfo(), and GetLength().
|
private |
Reduce number of length (squared) calculations by caching results when they are first obtained.
pPfo | the pfo |
pfoLengthMap | the pfo length map |
Definition at line 606 of file DeltaRayMatchingAlgorithm.cc.
References lar_content::LArPfoHelper::GetTwoDLengthSquared().
|
private |
Get a vector of track-like Pfos in the provided input Pfo lists.
inputPfoListName | the input Pfo list name |
pfoVector | the output vector of Pfos |
Definition at line 150 of file DeltaRayMatchingAlgorithm.cc.
References GetAllPfos(), and lar_content::LArPfoHelper::IsTrack().
Referenced by CreateParticles(), and FindBestParentPfo().
|
private |
Initialize a nearby cluster map with details relating to a specific cluster list.
clusterListName | the cluster list name |
nearbyClustersMap | to receive the nearby clusters map |
Definition at line 72 of file DeltaRayMatchingAlgorithm.cc.
References lar_content::KDTreeLinkerAlgo< DATA, DIM >::build(), lar_content::build_2d_kd_search_region(), lar_content::fill_and_bound_2d_kd_tree(), m_searchRegion1D, and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().
Referenced by InitializeNearbyClusterMaps().
|
private |
Initialize nearby cluster maps.
Definition at line 62 of file DeltaRayMatchingAlgorithm.cc.
References ClearNearbyClusterMaps(), InitializeNearbyClusterMap(), m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, m_nearbyClustersU, m_nearbyClustersV, and m_nearbyClustersW.
Referenced by Run().
|
private |
Match clusters using single views.
clusterLengthMap | the cluster length map |
Definition at line 228 of file DeltaRayMatchingAlgorithm.cc.
References AreClustersMatched(), CreateParticles(), FindBestParentPfo(), GetClusters(), m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, SelectParticles(), ThreeViewMatching(), and TwoViewMatching().
Referenced by Run().
|
private |
Match clusters using a single view.
clusters | the list of clusters in the provided view |
clusterLengthMap | the cluster length map |
pfoLengthMap | the pfo length map |
particleList | the output list of particles |
|
private |
Definition at line 795 of file DeltaRayMatchingAlgorithm.cc.
References m_daughterPfoListName, m_distanceForMatching, m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, m_minCaloHitsPerCluster, m_parentPfoListName, m_pseudoChi2Cut, m_searchRegion1D, and m_xOverlapWindow.
|
private |
Definition at line 35 of file DeltaRayMatchingAlgorithm.cc.
References ClearNearbyClusterMaps(), GetAllPfos(), InitializeNearbyClusterMaps(), m_parentPfoListName, OneViewMatching(), ThreeViewMatching(), and TwoViewMatching().
|
private |
Resolve any ambiguities between candidate particles.
inputParticles | the input list of candidate particles |
clusterLengthMap | the cluster length map |
outputParticles | the output list of candidate particles |
Definition at line 338 of file DeltaRayMatchingAlgorithm.cc.
References GetLength().
Referenced by OneViewMatching(), ThreeViewMatching(), and TwoViewMatching().
|
private |
Match clusters using all three views.
clusterLengthMap | the cluster length map |
Definition at line 194 of file DeltaRayMatchingAlgorithm.cc.
References CreateParticles(), GetClusters(), m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, and SelectParticles().
Referenced by OneViewMatching(), and Run().
|
private |
Match clusters using all three views.
clusters1 | the list of clusters in the first view |
clusters2 | the list of clusters in the second view |
clusters3 | the list of clusters in the third view |
clusterLengthMap | the cluster length map |
pfoLengthMap | the pfo length map |
particleList | the output list of particles |
|
private |
Match clusters using pairs of views.
clusterLengthMap | the cluster length map |
Definition at line 210 of file DeltaRayMatchingAlgorithm.cc.
References CreateParticles(), GetClusters(), m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, and SelectParticles().
Referenced by OneViewMatching(), and Run().
|
private |
Match clusters using a pair of views.
clusters1 | the list of clusters in the first view |
clusters2 | the list of clusters in the second view |
clusterLengthMap | the cluster length map |
pfoLengthMap | the pfo length map |
particleList | the output list of particles |
|
private |
The daughter pfo list name for new daughter particles.
Definition at line 300 of file DeltaRayMatchingAlgorithm.h.
Referenced by CreateDaughterPfo(), CreateParticles(), FindBestParentPfo(), and ReadSettings().
|
private |
The maximum allowed distance between tracks and delta rays.
Definition at line 308 of file DeltaRayMatchingAlgorithm.h.
Referenced by FindBestParentPfo(), and ReadSettings().
|
private |
The input cluster list name for the u view.
Definition at line 302 of file DeltaRayMatchingAlgorithm.h.
Referenced by AddToDaughterPfo(), InitializeNearbyClusterMaps(), OneViewMatching(), ReadSettings(), ThreeViewMatching(), and TwoViewMatching().
|
private |
The input cluster list name for the v view.
Definition at line 303 of file DeltaRayMatchingAlgorithm.h.
Referenced by AddToDaughterPfo(), InitializeNearbyClusterMaps(), OneViewMatching(), ReadSettings(), ThreeViewMatching(), and TwoViewMatching().
|
private |
The input cluster list name for the w view.
Definition at line 304 of file DeltaRayMatchingAlgorithm.h.
Referenced by AddToDaughterPfo(), InitializeNearbyClusterMaps(), OneViewMatching(), ReadSettings(), ThreeViewMatching(), and TwoViewMatching().
|
private |
The min number of calo hits per candidate cluster.
Definition at line 306 of file DeltaRayMatchingAlgorithm.h.
Referenced by GetClusters(), and ReadSettings().
|
private |
The nearby clusters map for the u view.
Definition at line 312 of file DeltaRayMatchingAlgorithm.h.
Referenced by ClearNearbyClusterMaps(), GetDistanceSquaredToPfo(), and InitializeNearbyClusterMaps().
|
private |
The nearby clusters map for the v view.
Definition at line 313 of file DeltaRayMatchingAlgorithm.h.
Referenced by ClearNearbyClusterMaps(), GetDistanceSquaredToPfo(), and InitializeNearbyClusterMaps().
|
private |
The nearby clusters map for the w view.
Definition at line 314 of file DeltaRayMatchingAlgorithm.h.
Referenced by ClearNearbyClusterMaps(), GetDistanceSquaredToPfo(), and InitializeNearbyClusterMaps().
|
private |
The parent pfo list name.
Definition at line 299 of file DeltaRayMatchingAlgorithm.h.
Referenced by CreateParticles(), FindBestParentPfo(), ReadSettings(), and Run().
|
private |
Pseudo chi2 cut for three view matching.
Definition at line 309 of file DeltaRayMatchingAlgorithm.h.
Referenced by AreClustersMatched(), and ReadSettings().
|
private |
Search region, applied to each dimension, for look-up from kd-trees.
Definition at line 311 of file DeltaRayMatchingAlgorithm.h.
Referenced by InitializeNearbyClusterMap(), and ReadSettings().
|
private |
The maximum allowed displacement in x position.
Definition at line 307 of file DeltaRayMatchingAlgorithm.h.
Referenced by AreClustersMatched(), and ReadSettings().