Pandora
Pandora source code navigator
|
TransverseAssociationAlgorithm class. More...
#include "TransverseAssociationAlgorithm.h"
Classes | |
class | LArTransverseCluster |
LArTransverseCluster class. More... | |
Public Member Functions | |
TransverseAssociationAlgorithm () | |
Default constructor. | |
const std::string & | GetType () const |
Get the type. | |
const std::string & | GetInstanceName () const |
Get the instance name. | |
const Pandora & | GetPandora () const |
Get the associated pandora instance. | |
Protected Types | |
typedef std::unordered_map< const pandora::Cluster *, ClusterAssociation > | ClusterAssociationMap |
Protected Member Functions | |
virtual pandora::StatusCode | Run () |
Run the algorithm. | |
virtual StatusCode | Initialize () |
Perform any operations that must occur after reading settings, but before running the process. | |
virtual StatusCode | Reset () |
Perform any operations when pandora is reset, typically at the end of each event. | |
StatusCode | RegisterDetails (const Pandora *const pPandora, const std::string &type, const std::string &instanceName) |
Register i) the pandora instance that will run the process and ii) the process type. | |
Protected Attributes | |
const Pandora * | m_pPandora |
The pandora object that will run the process. | |
std::string | m_type |
The process type. | |
std::string | m_instanceName |
The process instance name. | |
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) |
Read the algorithm settings. | |
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. | |
void | PopulateClusterAssociationMap (const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const |
Populate the cluster association map. | |
bool | IsExtremalCluster (const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const |
Determine which of two clusters is extremal. | |
void | GetNearbyClusterMap (const pandora::ClusterVector &allClusters, ClusterToClustersMap &nearbyClusters) const |
Use a kd-tree to obtain details of all nearby cluster combinations. | |
void | SortInputClusters (const pandora::ClusterVector &inputClusters, pandora::ClusterVector &shortClusters, pandora::ClusterVector &transverseMediumClusters, pandora::ClusterVector &longitudinalMediumClusters, pandora::ClusterVector &longClusters) const |
Separate input clusters by length. | |
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. | |
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. | |
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. | |
void | FillTransverseAssociationMap (const ClusterToClustersMap &nearbyClusters, const TransverseClusterList &transverseClusterList, const ClusterAssociationMap &transverseAssociationMap, ClusterAssociationMap &clusterAssociationMap) const |
Form associations between transverse cluster objects. | |
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. | |
bool | IsAssociated (const bool isForward, const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const ClusterToClustersMap &nearbyClusters) const |
Determine whether clusters are association. | |
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. | |
bool | IsTransverseAssociated (const LArTransverseCluster *const pTransverseCluster1, const LArTransverseCluster *const pTransverseCluster2, const ClusterToClustersMap &nearbyClusters) const |
Determine whether two transverse clusters are associated. | |
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. | |
bool | IsOverlapping (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const |
Determine whether two clusters are overlapping. | |
float | GetTransverseSpan (const pandora::Cluster *const pCluster) const |
Calculate the overall span in X for a clusters. | |
float | GetLongitudinalSpan (const pandora::Cluster *const pCluster) const |
Calculate the overall span in Z for a clusters. | |
float | GetTransverseSpan (const pandora::Cluster *const pCluster, const pandora::ClusterVector &associatedClusters) const |
Calculate the overall span in X for a set of clusters. | |
void | GetExtremalCoordinatesX (const pandora::Cluster *const pCluster, float &minX, float &maxX) const |
Get minimum and maximum X coordinates for a given cluster. | |
void | GetExtremalCoordinatesZ (const pandora::Cluster *const pCluster, float &minZ, float &maxZ) const |
Get minimum and maximum Z coordinates for a given cluster. | |
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. | |
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) | |
void | FillReducedAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Remove double-counting from association map. | |
void | FillReducedAssociationMap (const ClusterAssociationMap &firstAssociationMap, const ClusterAssociationMap &secondAssociationMap, const ClusterAssociationMap &secondAssociationMapSwapped, ClusterAssociationMap &clusterAssociationMap) const |
Use one map to block associations from another map. | |
void | FillSymmetricAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Symmetrise an association map. | |
void | FinalizeClusterAssociationMap (const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const |
Symmetrise and then remove double-counting from an association map. | |
void | UnambiguousPropagation (const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const |
Unambiguous propagation. | |
void | AmbiguousPropagation (const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const |
Ambiguous propagation. | |
void | UpdateForUnambiguousMerge (const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete, const bool isForwardMerge, ClusterAssociationMap &clusterAssociationMap) const |
Update cluster association map to reflect an unambiguous cluster merge. | |
void | UpdateForAmbiguousMerge (const pandora::Cluster *const pCluster, ClusterAssociationMap &clusterAssociationMap) const |
Update cluster association map to reflect an ambiguous cluster merge. | |
void | NavigateAlongAssociations (const ClusterAssociationMap &clusterAssociationMap, const pandora::Cluster *const pCluster, const bool isForward, const pandora::Cluster *&pExtremalCluster, pandora::ClusterSet &clusterSet) const |
Navigate along cluster associations, from specified cluster, in specified direction. | |
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. | |
float | m_searchRegionZ |
Search region, applied to u/v/w dimension, for look-up from kd-trees. | |
bool | m_mergeMade |
bool | m_resolveAmbiguousAssociations |
Whether to resolve ambiguous associations. | |
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 22 of file TransverseAssociationAlgorithm.cc.
|
privateinherited |
Ambiguous propagation.
pCluster | address of the cluster to propagate |
isForward | whether propagation direction is forward |
clusterAssociationMap | the cluster association map |
Definition at line 121 of file ClusterAssociationAlgorithm.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 212 of file TransverseAssociationAlgorithm.cc.
|
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 600 of file TransverseAssociationAlgorithm.cc.
|
private |
Remove double-counting from association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 592 of file TransverseAssociationAlgorithm.cc.
|
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 |
Definition at line 195 of file TransverseAssociationAlgorithm.cc.
|
private |
Symmetrise an association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 685 of file TransverseAssociationAlgorithm.cc.
|
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 262 of file TransverseAssociationAlgorithm.cc.
|
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 243 of file TransverseAssociationAlgorithm.cc.
|
private |
Symmetrise and then remove double-counting from an association map.
inputAssociationMap | the inputted association map |
outputAssociationMap | the outputted association map |
Definition at line 769 of file TransverseAssociationAlgorithm.cc.
|
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 305 of file TransverseAssociationAlgorithm.cc.
|
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 |
Definition at line 539 of file TransverseAssociationAlgorithm.cc.
|
private |
Get extremal 2D coordinates for a given cluster (ordered by X)
pCluster | the input cluster |
innerCoordinate | the inner coordinate |
outerCoordinate | the outer coordinate |
Definition at line 580 of file TransverseAssociationAlgorithm.cc.
|
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 553 of file TransverseAssociationAlgorithm.cc.
|
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 546 of file TransverseAssociationAlgorithm.cc.
|
inlineinherited |
|
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.
|
private |
Calculate the overall span in Z for a clusters.
pCluster | the target cluster |
Definition at line 475 of file TransverseAssociationAlgorithm.cc.
|
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.
|
inlineinherited |
|
private |
Calculate the overall span in X for a clusters.
pCluster | the target cluster |
Definition at line 463 of file TransverseAssociationAlgorithm.cc.
|
private |
Calculate the overall span in X for a set of clusters.
pCluster | the target cluster |
associatedClusters | the vector of associated clusters |
Definition at line 487 of file TransverseAssociationAlgorithm.cc.
|
inlineinherited |
|
inlineprotectedvirtualinherited |
Perform any operations that must occur after reading settings, but before running the process.
Reimplemented in lar_content::BdtBeamParticleIdTool, lar_content::BeamParticleIdTool, lar_content::CosmicRayTaggingTool, lar_content::EventReadingAlgorithm, lar_content::EventWritingAlgorithm, lar_content::LArPseudoLayerPlugin, lar_content::LArRotationalTransformationPlugin, EventReadingAlgorithm, and EventWritingAlgorithm.
Definition at line 126 of file Process.h.
|
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 335 of file TransverseAssociationAlgorithm.cc.
|
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 515 of file TransverseAssociationAlgorithm.cc.
|
private |
Determine whether two clusters are overlapping.
pCluster1 | the first cluster |
pCluster2 | the second cluster |
Definition at line 445 of file TransverseAssociationAlgorithm.cc.
|
private |
Determine whether one transverse cluster is associated with the vertex from a second transverse cluster.
pTransverseCluster | the target cluster |
theVertex | the vertex position |
Definition at line 427 of file TransverseAssociationAlgorithm.cc.
|
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 404 of file TransverseAssociationAlgorithm.cc.
|
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 |
Definition at line 371 of file TransverseAssociationAlgorithm.cc.
|
privateinherited |
Navigate along cluster associations, from specified cluster, in specified direction.
clusterAssociationMap | the cluster association map |
pCluster | address of cluster with which to begin search |
isForward | whether propagation direction is forward |
pExtremalCluster | to receive the extremal cluster |
clusterSet | to receive set of clusters traversed |
Definition at line 231 of file ClusterAssociationAlgorithm.cc.
|
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.
|
privatevirtual |
Read the algorithm settings.
xmlHandle | the relevant xml handle |
Reimplemented from lar_content::ClusterAssociationAlgorithm.
Definition at line 850 of file TransverseAssociationAlgorithm.cc.
|
inlineprotectedinherited |
Register i) the pandora instance that will run the process and ii) the process type.
pPandora | address of the pandora object that will run the process |
type | the process type |
instanceName | the process instance name |
Definition at line 146 of file Process.h.
|
inlineprotectedvirtualinherited |
Perform any operations when pandora is reset, typically at the end of each event.
Reimplemented in lar_content::MasterAlgorithm, lar_content::PostProcessingAlgorithm, and lar_content::PreProcessingAlgorithm.
Definition at line 133 of file Process.h.
|
protectedvirtualinherited |
Run the algorithm.
Implements pandora::Algorithm.
Definition at line 26 of file ClusterAssociationAlgorithm.cc.
|
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.
|
privateinherited |
Unambiguous propagation.
pCluster | address of the cluster to propagate |
isForward | whether propagation direction is forward |
clusterAssociationMap | the cluster association map |
Definition at line 87 of file ClusterAssociationAlgorithm.cc.
|
privateinherited |
Update cluster association map to reflect an ambiguous cluster merge.
pCluster | address of the cluster to be cleared |
clusterAssociationMap | the cluster association map |
Definition at line 204 of file ClusterAssociationAlgorithm.cc.
|
privateinherited |
Update cluster association map to reflect an unambiguous cluster merge.
pClusterToEnlarge | address of the cluster to be enlarged |
pClusterToDelete | address of the cluster to be deleted |
isForwardMerge | whether merge is forward (pClusterToEnlarge is forward-associated with pClusterToDelete) |
clusterAssociationMap | the cluster association map |
Definition at line 166 of file ClusterAssociationAlgorithm.cc.
|
private |
Definition at line 340 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 341 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 342 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 339 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 336 of file TransverseAssociationAlgorithm.h.
|
protectedinherited |
|
private |
Definition at line 346 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 345 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 344 of file TransverseAssociationAlgorithm.h.
|
mutableprivateinherited |
Definition at line 123 of file ClusterAssociationAlgorithm.h.
|
protectedinherited |
|
privateinherited |
Whether to resolve ambiguous associations.
Definition at line 125 of file ClusterAssociationAlgorithm.h.
|
private |
Search region, applied to x dimension, for look-up from kd-trees.
Definition at line 352 of file TransverseAssociationAlgorithm.h.
|
private |
Search region, applied to u/v/w dimension, for look-up from kd-trees.
Definition at line 353 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 337 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 350 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 348 of file TransverseAssociationAlgorithm.h.
|
private |
Definition at line 349 of file TransverseAssociationAlgorithm.h.
|
protectedinherited |