Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::HitWidthClusterMergingAlgorithm Class Reference

HitWidthClusterMergingAlgorithm class. More...

#include "HitWidthClusterMergingAlgorithm.h"

Inheritance diagram for lar_content::HitWidthClusterMergingAlgorithm:
Collaboration diagram for lar_content::HitWidthClusterMergingAlgorithm:

Public Member Functions

 HitWidthClusterMergingAlgorithm ()
 Default constructor.
 
const std::string & GetType () const
 Get the type.
 
const std::string & GetInstanceName () const
 Get the instance name.
 
const PandoraGetPandora () const
 Get the associated pandora instance.
 

Protected Types

typedef std::unordered_map< const pandora::Cluster *, ClusterAssociationClusterAssociationMap
 

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 Pandoram_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 &currentClusterParameters, 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.
 

Detailed Description

Member Typedef Documentation

◆ ClusterAssociationMap

Definition at line 43 of file ClusterAssociationAlgorithm.h.

Constructor & Destructor Documentation

◆ HitWidthClusterMergingAlgorithm()

lar_content::HitWidthClusterMergingAlgorithm::HitWidthClusterMergingAlgorithm ( )

Default constructor.

Definition at line 21 of file HitWidthClusterMergingAlgorithm.cc.

Member Function Documentation

◆ AmbiguousPropagation()

void lar_content::ClusterAssociationAlgorithm::AmbiguousPropagation ( const pandora::Cluster *const  pCluster,
const bool  isForward,
ClusterAssociationMap clusterAssociationMap 
) const
privateinherited

Ambiguous propagation.

Parameters
pClusteraddress of the cluster to propagate
isForwardwhether propagation direction is forward
clusterAssociationMapthe cluster association map

Definition at line 121 of file ClusterAssociationAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AreClustersAssociated()

bool lar_content::HitWidthClusterMergingAlgorithm::AreClustersAssociated ( const LArHitWidthHelper::ClusterParameters currentClusterParameters,
const LArHitWidthHelper::ClusterParameters testClusterParameters 
) const
private

Determine whether two clusters are associated.

Parameters
currentClusterParametersparameters defining the current cluster
testClusterParametersparameters defining the test cluster
Returns
boolean whether the clusters are associated

Definition at line 129 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindClosestPointToPosition()

void lar_content::HitWidthClusterMergingAlgorithm::FindClosestPointToPosition ( const pandora::CartesianVector position,
const LArHitWidthHelper::ConstituentHitVector constituentHitVector,
pandora::CartesianVector closestPoint 
) const
private

Determine the position of the constituent hit that lies closest to a specified position.

Parameters
positionthe point to which the consituent hits will be compared
constituentHitVectorthe input vector of constituent hits
closestPointthe position of the closest constituent hit

Definition at line 206 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClusterDirection()

void lar_content::HitWidthClusterMergingAlgorithm::GetClusterDirection ( const LArHitWidthHelper::ConstituentHitVector constituentHitVector,
pandora::CartesianVector direction,
const pandora::CartesianVector fitReferencePoint,
const float  fittingWeight 
) const
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:

  1. rL & rT weighted means
  2. gradient of the fit The fit is performed using a subset of points that are closest to the fitReferencePoint
Parameters
constituentHitVectorthe input vector of constituent hits
directionthe fitted cluster direction
fitReferencePointthe hits closest to this point are included in the fit
fittingWeightthe weight that is considered in the fit

Definition at line 225 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConstituentHitSubsetVector()

void lar_content::HitWidthClusterMergingAlgorithm::GetConstituentHitSubsetVector ( const LArHitWidthHelper::ConstituentHitVector constituentHitVector,
const pandora::CartesianVector fitReferencePoint,
const float  fittingWeight,
LArHitWidthHelper::ConstituentHitVector constituentHitSubsetVector 
) const
private

Obtain a vector of the minimum number of hits closest to a reference point that exceed a given weight.

Parameters
constituentHitVectorthe input vector of constituent hits
fitReferencePointthe reference point
fittingWeightthe specified cumulative hit weight
constituentHitSubsetVectorthe subset of constituent hits

Definition at line 307 of file HitWidthClusterMergingAlgorithm.cc.

Here is the caller graph for this function:

◆ GetFittingAxes()

void lar_content::HitWidthClusterMergingAlgorithm::GetFittingAxes ( const LArHitWidthHelper::ConstituentHitVector constituentHitSubsetVector,
pandora::CartesianVector axisDirection,
pandora::CartesianVector orthoDirection 
) const
private

Obtain the axes of the fitting frame.

Parameters
constituentHitSubsetVectorthe input vector of constituent hits
axisDirectionthe fitting 'x-axis'
orthoDirectionthe fitting 'z-axis'

Definition at line 330 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFittingCoordinates()

void lar_content::HitWidthClusterMergingAlgorithm::GetFittingCoordinates ( const pandora::CartesianVector axisDirection,
const pandora::CartesianVector constituentHitPosition,
float &  rL,
float &  rT 
) const
private

Translate from (x, y, z) coordinates to (rL, rT) coordinates.

Parameters
axisDirectionthe fitting 'x-axis'
constituentHitPositionthe (x, y, z) position of a constituent hit
rLthe fitting 'x' coordinate
rTthe fitting 'z' coordinate

Definition at line 356 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGlobalDirection()

void lar_content::HitWidthClusterMergingAlgorithm::GetGlobalDirection ( const pandora::CartesianVector axisDirection,
const float  gradient,
pandora::CartesianVector globalDirection 
) const
private

Translate a gradient in the fitting coordinate frame to a direction vector in the detector frame.

Parameters
axisDirectionthe fitting 'x-axis'
gradientthe gradient dT/dL
globalDirectionthe direction vector in the detector frame

Definition at line 369 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstanceName()

const std::string & pandora::Process::GetInstanceName ( ) const
inlineinherited

Get the instance name.

Returns
The instance name

Definition at line 109 of file Process.h.

◆ GetListOfCleanClusters()

void lar_content::HitWidthClusterMergingAlgorithm::GetListOfCleanClusters ( const pandora::ClusterList *const  pClusterList,
pandora::ClusterVector clusterVector 
) const
privatevirtual

Populate cluster vector with subset of cluster list, containing clusters judged to be clean.

Parameters
pClusterListaddress of the cluster list
clusterVectorto receive the populated cluster vector

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 36 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:

◆ GetPandora()

const Pandora & pandora::Process::GetPandora ( ) const
inlineinherited

Get the associated pandora instance.

Returns
the associated pandora instance

Definition at line 116 of file Process.h.

◆ GetType()

const std::string & pandora::Process::GetType ( ) const
inlineinherited

Get the type.

Returns
The type

Definition at line 102 of file Process.h.

◆ Initialize()

StatusCode pandora::Process::Initialize ( )
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.

Here is the caller graph for this function:

◆ IsExtremalCluster()

bool lar_content::HitWidthClusterMergingAlgorithm::IsExtremalCluster ( const bool  isForward,
const pandora::Cluster *const  pCurrentCluster,
const pandora::Cluster *const  pTestCluster 
) const
privatevirtual

Determine which of two clusters is extremal.

Parameters
isForwardwhether propagation direction is forward
pCurrentClustercurrent extremal cluster
pTestClusterpotential extremal cluster
Returns
boolean

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 102 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:

◆ NavigateAlongAssociations()

void lar_content::ClusterAssociationAlgorithm::NavigateAlongAssociations ( const ClusterAssociationMap clusterAssociationMap,
const pandora::Cluster *const  pCluster,
const bool  isForward,
const pandora::Cluster *&  pExtremalCluster,
pandora::ClusterSet clusterSet 
) const
privateinherited

Navigate along cluster associations, from specified cluster, in specified direction.

Parameters
clusterAssociationMapthe cluster association map
pClusteraddress of cluster with which to begin search
isForwardwhether propagation direction is forward
pExtremalClusterto receive the extremal cluster
clusterSetto receive set of clusters traversed

Definition at line 231 of file ClusterAssociationAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateClusterAssociationMap()

void lar_content::HitWidthClusterMergingAlgorithm::PopulateClusterAssociationMap ( const pandora::ClusterVector clusterVector,
ClusterAssociationMap clusterAssociationMap 
) const
privatevirtual

Populate the cluster association map.

Parameters
clusterVectorthe cluster vector
clusterAssociationMapto receive the populated cluster association map

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 71 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:

◆ ReadSettings()

StatusCode lar_content::HitWidthClusterMergingAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Reimplemented from lar_content::ClusterAssociationAlgorithm.

Definition at line 445 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:

◆ RegisterDetails()

StatusCode pandora::Process::RegisterDetails ( const Pandora *const  pPandora,
const std::string &  type,
const std::string &  instanceName 
)
inlineprotectedinherited

Register i) the pandora instance that will run the process and ii) the process type.

Parameters
pPandoraaddress of the pandora object that will run the process
typethe process type
instanceNamethe process instance name

Definition at line 146 of file Process.h.

Here is the caller graph for this function:

◆ RemoveShortcutAssociations()

void lar_content::HitWidthClusterMergingAlgorithm::RemoveShortcutAssociations ( const pandora::ClusterVector clusterVector,
ClusterAssociationMap clusterAssociationMap 
) const
private

Remove 'shortcut' associations from the cluster association map.

Parameters
clusterVectorthe vector of clusters considered in the merging process
clusterAssociationMapthe mapping of clusters to forward/backward associations

Definition at line 384 of file HitWidthClusterMergingAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

StatusCode pandora::Process::Reset ( )
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.

Here is the caller graph for this function:

◆ Run()

StatusCode lar_content::ClusterAssociationAlgorithm::Run ( )
protectedvirtualinherited

Run the algorithm.

Implements pandora::Algorithm.

Definition at line 26 of file ClusterAssociationAlgorithm.cc.

Here is the call graph for this function:

◆ UnambiguousPropagation()

void lar_content::ClusterAssociationAlgorithm::UnambiguousPropagation ( const pandora::Cluster *const  pCluster,
const bool  isForward,
ClusterAssociationMap clusterAssociationMap 
) const
privateinherited

Unambiguous propagation.

Parameters
pClusteraddress of the cluster to propagate
isForwardwhether propagation direction is forward
clusterAssociationMapthe cluster association map

Definition at line 87 of file ClusterAssociationAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateForAmbiguousMerge()

void lar_content::ClusterAssociationAlgorithm::UpdateForAmbiguousMerge ( const pandora::Cluster *const  pCluster,
ClusterAssociationMap clusterAssociationMap 
) const
privateinherited

Update cluster association map to reflect an ambiguous cluster merge.

Parameters
pClusteraddress of the cluster to be cleared
clusterAssociationMapthe cluster association map

Definition at line 204 of file ClusterAssociationAlgorithm.cc.

Here is the caller graph for this function:

◆ UpdateForUnambiguousMerge()

void lar_content::ClusterAssociationAlgorithm::UpdateForUnambiguousMerge ( const pandora::Cluster *const  pClusterToEnlarge,
const pandora::Cluster *const  pClusterToDelete,
const bool  isForwardMerge,
ClusterAssociationMap clusterAssociationMap 
) const
privateinherited

Update cluster association map to reflect an unambiguous cluster merge.

Parameters
pClusterToEnlargeaddress of the cluster to be enlarged
pClusterToDeleteaddress of the cluster to be deleted
isForwardMergewhether merge is forward (pClusterToEnlarge is forward-associated with pClusterToDelete)
clusterAssociationMapthe cluster association map

Definition at line 166 of file ClusterAssociationAlgorithm.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ m_clusterToParametersMap

LArHitWidthHelper::ClusterToParametersMap lar_content::HitWidthClusterMergingAlgorithm::m_clusterToParametersMap
mutableprivate

The map [cluster -> cluster parameters].

Definition at line 142 of file HitWidthClusterMergingAlgorithm.h.

◆ m_fittingWeight

float lar_content::HitWidthClusterMergingAlgorithm::m_fittingWeight
private

The maximum hit weight considered in the least squared fit.

Definition at line 133 of file HitWidthClusterMergingAlgorithm.h.

◆ m_hitWidthScalingFactor

float lar_content::HitWidthClusterMergingAlgorithm::m_hitWidthScalingFactor
private

The scaling factor of the hit widths.

Definition at line 132 of file HitWidthClusterMergingAlgorithm.h.

◆ m_instanceName

std::string pandora::Process::m_instanceName
protectedinherited

The process instance name.

Definition at line 89 of file Process.h.

◆ m_maxConstituentHitWidth

float lar_content::HitWidthClusterMergingAlgorithm::m_maxConstituentHitWidth
private

The maximum hit width of a constituent hit of broken up hit, units cm.

Definition at line 131 of file HitWidthClusterMergingAlgorithm.h.

◆ m_maxXMergeDistance

float lar_content::HitWidthClusterMergingAlgorithm::m_maxXMergeDistance
private

The maximum x distance between merging points of associated clusters, units cm.

Definition at line 135 of file HitWidthClusterMergingAlgorithm.h.

◆ m_maxZMergeDistance

float lar_content::HitWidthClusterMergingAlgorithm::m_maxZMergeDistance
private

The maximum z distance between merging points of associated clusters, units cm.

Definition at line 136 of file HitWidthClusterMergingAlgorithm.h.

◆ m_mergeMade

bool lar_content::ClusterAssociationAlgorithm::m_mergeMade
mutableprivateinherited

Definition at line 123 of file ClusterAssociationAlgorithm.h.

◆ m_minClusterSparseness

float lar_content::HitWidthClusterMergingAlgorithm::m_minClusterSparseness
private

The threshold sparseness of a cluster to be considered in the merging process.

Definition at line 139 of file HitWidthClusterMergingAlgorithm.h.

◆ m_minClusterWeight

float lar_content::HitWidthClusterMergingAlgorithm::m_minClusterWeight
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.

◆ m_minDirectionDeviationCosAngle

float lar_content::HitWidthClusterMergingAlgorithm::m_minDirectionDeviationCosAngle
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.

◆ m_minMergeCosOpeningAngle

float lar_content::HitWidthClusterMergingAlgorithm::m_minMergeCosOpeningAngle
private

The minimum cosine opening angle of the directions of associated clusters.

Definition at line 137 of file HitWidthClusterMergingAlgorithm.h.

◆ m_pPandora

const Pandora* pandora::Process::m_pPandora
protectedinherited

The pandora object that will run the process.

Definition at line 87 of file Process.h.

◆ m_resolveAmbiguousAssociations

bool lar_content::ClusterAssociationAlgorithm::m_resolveAmbiguousAssociations
privateinherited

Whether to resolve ambiguous associations.

Definition at line 125 of file ClusterAssociationAlgorithm.h.

◆ m_type

std::string pandora::Process::m_type
protectedinherited

The process type.

Definition at line 88 of file Process.h.


The documentation for this class was generated from the following files: