LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
TransverseAssociationAlgorithm class. More...
#include "TransverseAssociationAlgorithm.h"
Classes | |
class | LArTransverseCluster |
LArTransverseCluster class. More... | |
Public Member Functions | |
TransverseAssociationAlgorithm () | |
Default constructor. More... | |
Protected Types | |
typedef std::unordered_map< const pandora::Cluster *, ClusterAssociation > | ClusterAssociationMap |
Protected Member Functions | |
virtual pandora::StatusCode | Run () |
Private Types | |
typedef std::vector< LArTransverseCluster * > | TransverseClusterList |
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::ClusterSet > | ClusterToClustersMap |
typedef std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > | HitToClusterMap |
Private Member Functions | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
void | GetListOfCleanClusters (const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const |
Populate cluster vector with subset of cluster list, containing clusters judged to be clean. More... | |
void | PopulateClusterAssociationMap (const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const |
Populate the cluster association map. More... | |
bool | IsExtremalCluster (const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const |
Determine which of two clusters is extremal. More... | |
void | GetNearbyClusterMap (const pandora::ClusterVector &allClusters, ClusterToClustersMap &nearbyClusters) const |
Use a kd-tree to obtain details of all nearby cluster combinations. More... | |
void | SortInputClusters (const pandora::ClusterVector &inputClusters, pandora::ClusterVector &shortClusters, pandora::ClusterVector &transverseMediumClusters, pandora::ClusterVector &longitudinalMediumClusters, pandora::ClusterVector &longClusters) const |
Separate input clusters by length. More... | |
void | FillReducedAssociationMap (const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &firstVector, const pandora::ClusterVector &secondVector, ClusterAssociationMap &clusterAssociationMap) const |
Form a reduced set of associations between two input lists of clusters. More... | |
void | FillAssociationMap (const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &firstVector, const pandora::ClusterVector &secondVector, ClusterAssociationMap &firstAssociationMap, ClusterAssociationMap &secondAssociationMap) const |
Form associations between two input lists of cluster. More... | |
void | FillTransverseClusterList (const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &inputClusters, const ClusterAssociationMap &inputAssociationMap, TransverseClusterList &transverseClusterList) const |
Create transverse cluster objects, these are protoclusters with a direction and inner/outer vertices. More... | |
void | FillTransverseAssociationMap (const ClusterToClustersMap &nearbyClusters, const TransverseClusterList &transverseClusterList, const ClusterAssociationMap &transverseAssociationMap, ClusterAssociationMap &clusterAssociationMap) const |
Form associations between transverse cluster objects. More... | |
void | GetAssociatedClusters (const ClusterToClustersMap &nearbyClusters, const pandora::Cluster *const pCluster, const ClusterAssociationMap &inputAssociationMap, pandora::ClusterVector &associatedClusters) const |
Find the clusters that are transversely associated with a target cluster. More... | |
bool | IsAssociated (const bool isForward, const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const ClusterToClustersMap &nearbyClusters) const |
Determine whether clusters are association. More... | |
bool | IsTransverseAssociated (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const ClusterToClustersMap &nearbyClusters) const |
Determine whether two clusters are within the same cluster window. More... | |
bool | IsTransverseAssociated (const LArTransverseCluster *const pTransverseCluster1, const LArTransverseCluster *const pTransverseCluster2, const ClusterToClustersMap &nearbyClusters) const |
Determine whether two transverse clusters are associated. More... | |
bool | IsTransverseAssociated (const LArTransverseCluster *const pTransverseCluster, const pandora::CartesianVector &testPosition) const |
Determine whether one transverse cluster is associated with the vertex from a second transverse cluster. More... | |
bool | IsOverlapping (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const |
Determine whether two clusters are overlapping. More... | |
float | GetTransverseSpan (const pandora::Cluster *const pCluster) const |
Calculate the overall span in X for a clusters. More... | |
float | GetLongitudinalSpan (const pandora::Cluster *const pCluster) const |
Calculate the overall span in Z for a clusters. More... | |
float | GetTransverseSpan (const pandora::Cluster *const pCluster, const pandora::ClusterVector &associatedClusters) const |
Calculate the overall span in X for a set of clusters. More... | |
void | GetExtremalCoordinatesX (const pandora::Cluster *const pCluster, float &minX, float &maxX) const |
Get minimum and maximum X coordinates for a given cluster. More... | |
void | GetExtremalCoordinatesZ (const pandora::Cluster *const pCluster, float &minZ, float &maxZ) const |
Get minimum and maximum Z coordinates for a given cluster. More... | |
void | GetExtremalCoordinatesXZ (const pandora::Cluster *const pCluster, const bool useX, float &minXZ, float &maxXZ) const |
Get minimum and maximum X or Z coordinates for a given cluster. More... | |
void | GetExtremalCoordinatesX (const pandora::Cluster *const pCluster, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate) const |
Get extremal 2D coordinates for a given cluster (ordered by X) More... | |
void | FillReducedAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Remove double-counting from association map. More... | |
void | FillReducedAssociationMap (const ClusterAssociationMap &firstAssociationMap, const ClusterAssociationMap &secondAssociationMap, const ClusterAssociationMap &secondAssociationMapSwapped, ClusterAssociationMap &clusterAssociationMap) const |
Use one map to block associations from another map. More... | |
void | FillSymmetricAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Symmetrise an association map. More... | |
void | FinalizeClusterAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Symmetrise and then remove double-counting from an association map. More... | |
Private Attributes | |
float | m_firstLengthCut |
float | m_secondLengthCut |
float | m_clusterWindow |
float | m_clusterAngle |
float | m_clusterCosAngle |
float | m_clusterTanAngle |
float | m_maxTransverseOverlap |
float | m_maxProjectedOverlap |
float | m_maxLongitudinalOverlap |
float | m_transverseClusterMinCosTheta |
float | m_transverseClusterMinLength |
float | m_transverseClusterMaxDisplacement |
float | m_searchRegionX |
Search region, applied to x dimension, for look-up from kd-trees. More... | |
float | m_searchRegionZ |
Search region, applied to u/v/w dimension, for look-up from kd-trees. More... | |
TransverseAssociationAlgorithm class.
Definition at line 28 of file TransverseAssociationAlgorithm.h.
|
protectedinherited |
Definition at line 43 of file ClusterAssociationAlgorithm.h.
|
private |
Definition at line 100 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 97 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 98 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 96 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 101 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 94 of file TransverseAssociationAlgorithm.h.
lar_content::TransverseAssociationAlgorithm::TransverseAssociationAlgorithm | ( | ) |
Default constructor.
Definition at line 23 of file TransverseAssociationAlgorithm.cc.
|
private |
Form associations between two input lists of cluster.
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
firstVector | the first input vector of clusters |
secondVector | the second input vector of clusters |
firstAssociationMap | the map of associations between first and second cluster vectors |
secondAssociationMap | the reversed map of associations between first and cluster vectors |
Definition at line 213 of file TransverseAssociationAlgorithm.cc.
References IsAssociated().
Referenced by SortInputClusters().
|
private |
Form a reduced set of associations between two input lists of clusters.
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
firstVector | the first input vector of clusters |
secondVector | the second input vector of clusters |
clusterAssociationMap | the output map of associations between clusters |
Referenced by FillReducedAssociationMap(), FinalizeClusterAssociationMap(), PopulateClusterAssociationMap(), and SortInputClusters().
|
private |
Remove double-counting from association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 601 of file TransverseAssociationAlgorithm.cc.
References FillReducedAssociationMap().
|
private |
Use one map to block associations from another map.
firstAssociationMap | the first association map |
secondAssociationMap | the second association map |
secondAssociationMap | the second association map reversed |
clusterAssociationMap | the outputted association map |
Definition at line 609 of file TransverseAssociationAlgorithm.cc.
References lar_content::LArClusterHelper::SortByNHits().
|
private |
Symmetrise an association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 694 of file TransverseAssociationAlgorithm.cc.
References lar_content::LArClusterHelper::SortByNHits().
Referenced by FinalizeClusterAssociationMap().
|
private |
Form associations between transverse cluster objects.
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
transverseClusterList | the input vector of transverse cluster objects |
transverseAssociationMap | the external map of associations between clusters |
clusterAssociationMap | the output map of associations between clusters |
Definition at line 266 of file TransverseAssociationAlgorithm.cc.
References lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetSeedCluster(), IsExtremalCluster(), and IsTransverseAssociated().
Referenced by PopulateClusterAssociationMap().
|
private |
Create transverse cluster objects, these are protoclusters with a direction and inner/outer vertices.
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
inputClusters | the input vector of clusters |
inputAssociationMap | the map of associations between input clusters |
transverseClusterList | the output vector of transverse cluster objects |
Definition at line 244 of file TransverseAssociationAlgorithm.cc.
References GetAssociatedClusters(), lar_content::LArClusterHelper::GetClusterHitType(), GetTransverseSpan(), lar_content::LArGeometryHelper::GetWirePitchRatio(), and m_transverseClusterMinLength.
Referenced by PopulateClusterAssociationMap().
|
private |
Symmetrise and then remove double-counting from an association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 778 of file TransverseAssociationAlgorithm.cc.
References FillReducedAssociationMap(), and FillSymmetricAssociationMap().
Referenced by PopulateClusterAssociationMap().
|
private |
Find the clusters that are transversely associated with a target cluster.
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
pCluster | the target cluster |
inputAssociationMap | the map of associations between clusters |
outputClusters | the output vector of clusters transversely associated with target cluster |
Definition at line 309 of file TransverseAssociationAlgorithm.cc.
References IsTransverseAssociated(), and lar_content::LArClusterHelper::SortByNHits().
Referenced by FillTransverseClusterList().
|
private |
Get minimum and maximum X coordinates for a given cluster.
pCluster | the input cluster |
minX | the minimum X position |
maxX | the maximum X position |
Referenced by GetExtremalCoordinatesXZ(), GetLongitudinalSpan(), IsAssociated(), IsExtremalCluster(), and IsOverlapping().
|
private |
Get extremal 2D coordinates for a given cluster (ordered by X)
pCluster | the input cluster |
innerCoordinate | the inner coordinate |
outerCoordinate | the outer coordinate |
|
private |
Get minimum and maximum X or Z coordinates for a given cluster.
pCluster | the input cluster |
useX | calculate extermal coordinates for X (rather than Z) |
minXZ | the minimum X or Z position |
maxXZ | the maximum X or Z position |
Definition at line 562 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetExtremalCoordinates(), and GetExtremalCoordinatesX().
Referenced by GetExtremalCoordinatesZ(), and IsExtremalCluster().
|
private |
Get minimum and maximum Z coordinates for a given cluster.
pCluster | the input cluster |
minZ | the minimum Z position |
maxZ | the maximum Z position |
Definition at line 555 of file TransverseAssociationAlgorithm.cc.
References GetExtremalCoordinatesXZ().
Referenced by GetLongitudinalSpan().
|
privatevirtual |
Populate cluster vector with subset of cluster list, containing clusters judged to be clean.
pClusterList | address of the cluster list |
clusterVector | to receive the populated cluster vector |
Implements lar_content::ClusterAssociationAlgorithm.
Definition at line 43 of file TransverseAssociationAlgorithm.cc.
References lar_content::LArClusterHelper::SortByNHits().
|
private |
Calculate the overall span in Z for a clusters.
pCluster | the target cluster |
Definition at line 484 of file TransverseAssociationAlgorithm.cc.
References GetExtremalCoordinatesX(), GetExtremalCoordinatesZ(), and GetTransverseSpan().
Referenced by SortInputClusters().
|
private |
Use a kd-tree to obtain details of all nearby cluster combinations.
allClusters | the list of all clusters |
nearbyClusters | to obtain the nearby cluster map |
Definition at line 119 of file TransverseAssociationAlgorithm.cc.
References lar_content::KDTreeLinkerAlgo< DATA, DIM >::build(), lar_content::build_2d_kd_search_region(), lar_content::fill_and_bound_2d_kd_tree(), m_searchRegionX, m_searchRegionZ, and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().
Referenced by PopulateClusterAssociationMap().
|
private |
Calculate the overall span in X for a clusters.
pCluster | the target cluster |
Referenced by FillTransverseClusterList(), GetLongitudinalSpan(), IsOverlapping(), and SortInputClusters().
|
private |
Calculate the overall span in X for a set of clusters.
pCluster | the target cluster |
associatedClusters | the vector of associated clusters |
|
private |
Determine whether clusters are association.
isForward | whether the association is forwards or backwards |
pCluster1 | the first cluster |
pCluster2 | the second cluster |
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
Definition at line 339 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClosestPosition(), GetExtremalCoordinatesX(), IsTransverseAssociated(), m_clusterTanAngle, m_clusterWindow, m_maxLongitudinalOverlap, and m_maxTransverseOverlap.
Referenced by FillAssociationMap().
|
privatevirtual |
Determine which of two clusters is extremal.
isForward | whether propagation direction is forward |
pCurrentCluster | current extremal cluster |
pTestCluster | potential extremal cluster |
Implements lar_content::ClusterAssociationAlgorithm.
Definition at line 524 of file TransverseAssociationAlgorithm.cc.
References f, GetExtremalCoordinatesX(), GetExtremalCoordinatesXZ(), and lar_content::LArClusterHelper::SortByNHits().
Referenced by FillTransverseAssociationMap().
|
private |
Determine whether two clusters are overlapping.
pCluster1 | the first cluster |
pCluster2 | the second cluster |
Definition at line 454 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClosestPosition(), GetExtremalCoordinatesX(), GetTransverseSpan(), and m_maxProjectedOverlap.
Referenced by IsTransverseAssociated().
|
private |
Determine whether two clusters are within the same cluster window.
pCluster1 | the first cluster |
pCluster2 | the second cluster |
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
Referenced by FillTransverseAssociationMap(), GetAssociatedClusters(), IsAssociated(), and IsTransverseAssociated().
|
private |
Determine whether two transverse clusters are associated.
pTransverseCluster1 | the first transverse cluster |
pTransverseCluster2 | the second transverse cluster |
nearbyClusters | the nearby cluster map, extracted via use of a kd-tree |
Definition at line 408 of file TransverseAssociationAlgorithm.cc.
References lar_content::LArClusterHelper::GetClusterHitType(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetDirection(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetInnerVertex(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetOuterVertex(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetSeedCluster(), lar_content::LArGeometryHelper::GetWirePitchRatio(), IsOverlapping(), IsTransverseAssociated(), m_clusterWindow, m_transverseClusterMaxDisplacement, and m_transverseClusterMinCosTheta.
|
private |
Determine whether one transverse cluster is associated with the vertex from a second transverse cluster.
pTransverseCluster | the target cluster |
theVertex | the vertex position |
|
privatevirtual |
Populate the cluster association map.
clusterVector | the cluster vector |
clusterAssociationMap | to receive the populated cluster association map |
Implements lar_content::ClusterAssociationAlgorithm.
Definition at line 52 of file TransverseAssociationAlgorithm.cc.
References FillReducedAssociationMap(), FillTransverseAssociationMap(), FillTransverseClusterList(), FinalizeClusterAssociationMap(), GetNearbyClusterMap(), and SortInputClusters().
|
privatevirtual |
Reimplemented from lar_content::ClusterAssociationAlgorithm.
Definition at line 859 of file TransverseAssociationAlgorithm.cc.
References f, m_clusterAngle, m_clusterCosAngle, m_clusterTanAngle, m_clusterWindow, m_firstLengthCut, m_maxLongitudinalOverlap, m_maxProjectedOverlap, m_maxTransverseOverlap, m_secondLengthCut, m_transverseClusterMaxDisplacement, m_transverseClusterMinCosTheta, m_transverseClusterMinLength, and lar_content::ClusterAssociationAlgorithm::ReadSettings().
|
protectedvirtualinherited |
Definition at line 28 of file ClusterAssociationAlgorithm.cc.
References lar_content::ClusterAssociationAlgorithm::AmbiguousPropagation(), lar_content::ClusterAssociationAlgorithm::GetListOfCleanClusters(), lar_content::ClusterAssociationAlgorithm::m_mergeMade, lar_content::ClusterAssociationAlgorithm::m_resolveAmbiguousAssociations, lar_content::ClusterAssociationAlgorithm::PopulateClusterAssociationMap(), and lar_content::ClusterAssociationAlgorithm::UnambiguousPropagation().
|
private |
Separate input clusters by length.
inputClusters | the input vector of clusters |
shortClusters | the output vector of short clusters |
transverseMediumClusters | the output vector of transverse medium clusters |
longitudinalMediumClusters | the output vector of longitudinal medium clusters |
longClusters | the output vector of all long clusters |
Definition at line 160 of file TransverseAssociationAlgorithm.cc.
References FillAssociationMap(), FillReducedAssociationMap(), GetLongitudinalSpan(), GetTransverseSpan(), m_clusterTanAngle, m_firstLengthCut, m_secondLengthCut, and lar_content::LArClusterHelper::SortByNHits().
Referenced by PopulateClusterAssociationMap().
|
private |
Definition at line 340 of file TransverseAssociationAlgorithm.h.
Referenced by ReadSettings().
|
private |
Definition at line 341 of file TransverseAssociationAlgorithm.h.
Referenced by ReadSettings().
|
private |
Definition at line 342 of file TransverseAssociationAlgorithm.h.
Referenced by IsAssociated(), ReadSettings(), and SortInputClusters().
|
private |
Definition at line 339 of file TransverseAssociationAlgorithm.h.
Referenced by IsAssociated(), IsTransverseAssociated(), and ReadSettings().
|
private |
Definition at line 336 of file TransverseAssociationAlgorithm.h.
Referenced by ReadSettings(), and SortInputClusters().
|
private |
Definition at line 346 of file TransverseAssociationAlgorithm.h.
Referenced by IsAssociated(), and ReadSettings().
|
private |
Definition at line 345 of file TransverseAssociationAlgorithm.h.
Referenced by IsOverlapping(), and ReadSettings().
|
private |
Definition at line 344 of file TransverseAssociationAlgorithm.h.
Referenced by IsAssociated(), and ReadSettings().
|
private |
Search region, applied to x dimension, for look-up from kd-trees.
Definition at line 352 of file TransverseAssociationAlgorithm.h.
Referenced by GetNearbyClusterMap().
|
private |
Search region, applied to u/v/w dimension, for look-up from kd-trees.
Definition at line 353 of file TransverseAssociationAlgorithm.h.
Referenced by GetNearbyClusterMap().
|
private |
Definition at line 337 of file TransverseAssociationAlgorithm.h.
Referenced by ReadSettings(), and SortInputClusters().
|
private |
Definition at line 350 of file TransverseAssociationAlgorithm.h.
Referenced by IsTransverseAssociated(), and ReadSettings().
|
private |
Definition at line 348 of file TransverseAssociationAlgorithm.h.
Referenced by IsTransverseAssociated(), and ReadSettings().
|
private |
Definition at line 349 of file TransverseAssociationAlgorithm.h.
Referenced by FillTransverseClusterList(), and ReadSettings().