8#ifndef LAR_HIT_WIDTH_CLUSTER_MERGING_ALGORITHM_H
9#define LAR_HIT_WIDTH_CLUSTER_MERGING_ALGORITHM_H 1
Header file for the algorithm class.
Header file for the cluster association algorithm class.
Header file for the lar hit width helper class.
ClusterAssociationAlgorithm class.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
HitWidthClusterMergingAlgorithm class.
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.
float m_minClusterSparseness
The threshold sparseness of a cluster to be considered in the merging process.
float m_minMergeCosOpeningAngle
The minimum cosine opening angle of the directions of associated clusters.
bool AreClustersAssociated(const LArHitWidthHelper::ClusterParameters ¤tClusterParameters, const LArHitWidthHelper::ClusterParameters &testClusterParameters) const
Determine whether two clusters are associated.
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...
float m_maxXMergeDistance
The maximum x distance between merging points of associated clusters, units cm.
void RemoveShortcutAssociations(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Remove 'shortcut' associations from the cluster association map.
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.
HitWidthClusterMergingAlgorithm()
Default constructor.
float m_maxConstituentHitWidth
The maximum hit width of a constituent hit of broken up hit, units cm.
float m_minClusterWeight
The threshold hit weight of the original, unscaled cluster to be considered in the merging process.
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 PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Populate the cluster association map.
float m_fittingWeight
The maximum hit weight considered in the least squared fit.
float m_maxZMergeDistance
The maximum z distance between merging points of associated clusters, units cm.
LArHitWidthHelper::ClusterToParametersMap m_clusterToParametersMap
The map [cluster -> cluster parameters].
float m_hitWidthScalingFactor
The scaling factor of the hit widths.
bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const
Determine which of two clusters is extremal.
void GetFittingAxes(const LArHitWidthHelper::ConstituentHitVector &constituentHitSubsetVector, pandora::CartesianVector &axisDirection, pandora::CartesianVector &orthoDirection) const
Obtain the axes of the fitting frame.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
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 th...
float m_minDirectionDeviationCosAngle
The minimum cosine opening angle of the direction of and associated cluster before and after merge.
std::vector< ConstituentHit > ConstituentHitVector
std::unordered_map< const pandora::Cluster *, const ClusterParameters > ClusterToParametersMap
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.