LArSoft
v06_85_00
Liquid Argon Software toolkit - http://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 26 of file TransverseAssociationAlgorithm.h.
|
protectedinherited |
Definition at line 43 of file ClusterAssociationAlgorithm.h.
|
private |
Definition at line 98 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 95 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 96 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 94 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 99 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 92 of file TransverseAssociationAlgorithm.h.
lar_content::TransverseAssociationAlgorithm::TransverseAssociationAlgorithm | ( | ) |
Default constructor.
Definition at line 22 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 211 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 589 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 596 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 677 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 261 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 242 of file TransverseAssociationAlgorithm.cc.
References GetAssociatedClusters(), GetTransverseSpan(), 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 759 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 304 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 551 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetExtremalCoordinates(), GetExtremalCoordinatesX(), and max.
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 544 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 42 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 473 of file TransverseAssociationAlgorithm.cc.
References GetExtremalCoordinatesX(), GetExtremalCoordinatesZ(), GetTransverseSpan(), and max.
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 118 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 332 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClosestPosition(), GetExtremalCoordinatesX(), IsTransverseAssociated(), m_clusterTanAngle, m_clusterWindow, m_maxLongitudinalOverlap, m_maxTransverseOverlap, max, and min.
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 513 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 443 of file TransverseAssociationAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClosestPosition(), GetExtremalCoordinatesX(), GetTransverseSpan(), m_maxProjectedOverlap, and max.
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 403 of file TransverseAssociationAlgorithm.cc.
References lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetDirection(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetInnerVertex(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetOuterVertex(), lar_content::TransverseAssociationAlgorithm::LArTransverseCluster::GetSeedCluster(), 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 51 of file TransverseAssociationAlgorithm.cc.
References FillReducedAssociationMap(), FillTransverseAssociationMap(), FillTransverseClusterList(), FinalizeClusterAssociationMap(), GetNearbyClusterMap(), and SortInputClusters().
|
privatevirtual |
Reimplemented from lar_content::ClusterAssociationAlgorithm.
Definition at line 838 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 159 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().