Pandora
Pandora source code navigator
|
HitWidthClusterMergingAlgorithm class. More...
#include "HitWidthClusterMergingAlgorithm.h"
Public Member Functions | |
HitWidthClusterMergingAlgorithm () | |
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 Member Functions | |
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. | |
bool | AreClustersAssociated (const LArHitWidthHelper::ClusterParameters ¤tClusterParameters, const LArHitWidthHelper::ClusterParameters &testClusterParameters) const |
Determine whether two clusters are associated. | |
void | FindClosestPointToPosition (const pandora::CartesianVector &position, const LArHitWidthHelper::ConstituentHitVector &constituentHitVector, pandora::CartesianVector &closestPoint) const |
Determine the position of the constituent hit that lies closest to a specified position. | |
void | GetClusterDirection (const LArHitWidthHelper::ConstituentHitVector &constituentHitVector, pandora::CartesianVector &direction, const pandora::CartesianVector &fitReferencePoint, const float fittingWeight) const |
Determine the cluster direction at a reference point by performing a weighted least squared fit to the input consitutent hit positions The fit is performed in a rotated cartesian coordinate system defined by a fitting axis determined by eigen The function is composed of two main loops that calculate the: | |
void | GetConstituentHitSubsetVector (const LArHitWidthHelper::ConstituentHitVector &constituentHitVector, const pandora::CartesianVector &fitReferencePoint, const float fittingWeight, LArHitWidthHelper::ConstituentHitVector &constituentHitSubsetVector) const |
Obtain a vector of the minimum number of hits closest to a reference point that exceed a given weight. | |
void | GetFittingAxes (const LArHitWidthHelper::ConstituentHitVector &constituentHitSubsetVector, pandora::CartesianVector &axisDirection, pandora::CartesianVector &orthoDirection) const |
Obtain the axes of the fitting frame. | |
void | GetFittingCoordinates (const pandora::CartesianVector &axisDirection, const pandora::CartesianVector &constituentHitPosition, float &rL, float &rT) const |
Translate from (x, y, z) coordinates to (rL, rT) coordinates. | |
void | GetGlobalDirection (const pandora::CartesianVector &axisDirection, const float gradient, pandora::CartesianVector &globalDirection) const |
Translate a gradient in the fitting coordinate frame to a direction vector in the detector frame. | |
void | RemoveShortcutAssociations (const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const |
Remove 'shortcut' associations from the cluster association map. | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Read the algorithm settings. | |
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_maxConstituentHitWidth |
The maximum hit width of a constituent hit of broken up hit, units cm. | |
float | m_hitWidthScalingFactor |
The scaling factor of the hit widths. | |
float | m_fittingWeight |
The maximum hit weight considered in the least squared fit. | |
float | m_minClusterWeight |
The threshold hit weight of the original, unscaled cluster to be considered in the merging process. | |
float | m_maxXMergeDistance |
The maximum x distance between merging points of associated clusters, units cm. | |
float | m_maxZMergeDistance |
The maximum z distance between merging points of associated clusters, units cm. | |
float | m_minMergeCosOpeningAngle |
The minimum cosine opening angle of the directions of associated clusters. | |
float | m_minDirectionDeviationCosAngle |
The minimum cosine opening angle of the direction of and associated cluster before and after merge. | |
float | m_minClusterSparseness |
The threshold sparseness of a cluster to be considered in the merging process. | |
LArHitWidthHelper::ClusterToParametersMap | m_clusterToParametersMap |
The map [cluster -> cluster parameters]. | |
bool | m_mergeMade |
bool | m_resolveAmbiguousAssociations |
Whether to resolve ambiguous associations. | |
HitWidthClusterMergingAlgorithm class.
Definition at line 23 of file HitWidthClusterMergingAlgorithm.h.
|
protectedinherited |
Definition at line 43 of file ClusterAssociationAlgorithm.h.
lar_content::HitWidthClusterMergingAlgorithm::HitWidthClusterMergingAlgorithm | ( | ) |
Default constructor.
Definition at line 21 of file HitWidthClusterMergingAlgorithm.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 |
Determine whether two clusters are associated.
currentClusterParameters | parameters defining the current cluster |
testClusterParameters | parameters defining the test cluster |
Definition at line 129 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Determine the position of the constituent hit that lies closest to a specified position.
position | the point to which the consituent hits will be compared |
constituentHitVector | the input vector of constituent hits |
closestPoint | the position of the closest constituent hit |
Definition at line 206 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Determine the cluster direction at a reference point by performing a weighted least squared fit to the input consitutent hit positions The fit is performed in a rotated cartesian coordinate system defined by a fitting axis determined by eigen The function is composed of two main loops that calculate the:
constituentHitVector | the input vector of constituent hits |
direction | the fitted cluster direction |
fitReferencePoint | the hits closest to this point are included in the fit |
fittingWeight | the weight that is considered in the fit |
Definition at line 225 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Obtain a vector of the minimum number of hits closest to a reference point that exceed a given weight.
constituentHitVector | the input vector of constituent hits |
fitReferencePoint | the reference point |
fittingWeight | the specified cumulative hit weight |
constituentHitSubsetVector | the subset of constituent hits |
Definition at line 307 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Obtain the axes of the fitting frame.
constituentHitSubsetVector | the input vector of constituent hits |
axisDirection | the fitting 'x-axis' |
orthoDirection | the fitting 'z-axis' |
Definition at line 330 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Translate from (x, y, z) coordinates to (rL, rT) coordinates.
axisDirection | the fitting 'x-axis' |
constituentHitPosition | the (x, y, z) position of a constituent hit |
rL | the fitting 'x' coordinate |
rT | the fitting 'z' coordinate |
Definition at line 356 of file HitWidthClusterMergingAlgorithm.cc.
|
private |
Translate a gradient in the fitting coordinate frame to a direction vector in the detector frame.
axisDirection | the fitting 'x-axis' |
gradient | the gradient dT/dL |
globalDirection | the direction vector in the detector frame |
Definition at line 369 of file HitWidthClusterMergingAlgorithm.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 36 of file HitWidthClusterMergingAlgorithm.cc.
|
inlineinherited |
|
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.
|
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 102 of file HitWidthClusterMergingAlgorithm.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 71 of file HitWidthClusterMergingAlgorithm.cc.
|
privatevirtual |
Read the algorithm settings.
xmlHandle | the relevant xml handle |
Reimplemented from lar_content::ClusterAssociationAlgorithm.
Definition at line 445 of file HitWidthClusterMergingAlgorithm.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.
|
private |
Remove 'shortcut' associations from the cluster association map.
clusterVector | the vector of clusters considered in the merging process |
clusterAssociationMap | the mapping of clusters to forward/backward associations |
Definition at line 384 of file HitWidthClusterMergingAlgorithm.cc.
|
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.
|
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.
|
mutableprivate |
The map [cluster -> cluster parameters].
Definition at line 142 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The maximum hit weight considered in the least squared fit.
Definition at line 133 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The scaling factor of the hit widths.
Definition at line 132 of file HitWidthClusterMergingAlgorithm.h.
|
protectedinherited |
|
private |
The maximum hit width of a constituent hit of broken up hit, units cm.
Definition at line 131 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The maximum x distance between merging points of associated clusters, units cm.
Definition at line 135 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The maximum z distance between merging points of associated clusters, units cm.
Definition at line 136 of file HitWidthClusterMergingAlgorithm.h.
|
mutableprivateinherited |
Definition at line 123 of file ClusterAssociationAlgorithm.h.
|
private |
The threshold sparseness of a cluster to be considered in the merging process.
Definition at line 139 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The threshold hit weight of the original, unscaled cluster to be considered in the merging process.
Definition at line 134 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The minimum cosine opening angle of the direction of and associated cluster before and after merge.
Definition at line 138 of file HitWidthClusterMergingAlgorithm.h.
|
private |
The minimum cosine opening angle of the directions of associated clusters.
Definition at line 137 of file HitWidthClusterMergingAlgorithm.h.
|
protectedinherited |
|
privateinherited |
Whether to resolve ambiguous associations.
Definition at line 125 of file ClusterAssociationAlgorithm.h.
|
protectedinherited |