TrackMergeRefinementAlgorithm class. More...
#include <TrackMergeRefinementAlgorithm.h>
Public Member Functions | |
TrackMergeRefinementAlgorithm () | |
Default constructor. More... | |
Public Member Functions inherited from lar_content::TrackRefinementBaseAlgorithm | |
TrackRefinementBaseAlgorithm () | |
Default constructor. More... | |
template<typename T > | |
void | InitialiseContainers (const ClusterList *pClusterList, const T sortFunction, ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
template<typename T > | |
void | UpdateContainers (const ClusterList &clustersToAdd, const ClusterList &clustersToDelete, const T sortFunction, ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Private Member Functions | |
pandora::StatusCode | Run () |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
bool | FindBestClusterAssociation (const pandora::ClusterVector &clusterVector, const SlidingFitResultMapPair &slidingFitResultMapPair, ClusterPairAssociation &clusterAssociation) const |
Find the best cluster association. More... | |
bool | AreClustersAssociated (const pandora::CartesianVector &upstreamPoint, const pandora::CartesianVector &upstreamDirection, const pandora::CartesianVector &downstreamPoint, const pandora::CartesianVector &downstreamDirection) const |
Whether two clusters are assoicated to one another. More... | |
void | GetUnavailableProtectedClusters (const ClusterPairAssociation &clusterAssociation, const pandora::ClusterList &createdMainTrackClusters, pandora::ClusterList &unavailableProtectedClusters) const |
Obtain a list of clusters whos hits are protected and cannot be reassigned. More... | |
bool | AreExtrapolatedHitsNearBoundaries (const pandora::CaloHitVector &extrapolatedHitVector, ClusterAssociation &clusterAssociation) const |
Check the separation of the extremal extrapolated hits with the cluster merge points or, in the case of no hits, the cluster merge point separation. More... | |
void | ConsiderClusterAssociation (const ClusterPairAssociation &clusterAssociation, pandora::ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Remove the cluster association from the cluster vector so that the same cluster pair is not considered again. More... | |
const pandora::Cluster * | CreateMainTrack (const ClusterPairAssociation &clusterAssociation, const ClusterToCaloHitListMap &clusterToCaloHitListMap, const pandora::ClusterList *pClusterList, pandora::ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Refine the cluster endpoints and merge together the associated clusters alongside any extrapolated hits. More... | |
Private Attributes | |
unsigned int | m_maxLoopIterations |
The maximum number of main loop iterations. More... | |
float | m_minClusterLengthSum |
The threshold cluster and associated cluster length sum. More... | |
float | m_minSeparationDistance |
The threshold separation distance between associated clusters. More... | |
float | m_minDirectionDeviationCosAngle |
The threshold cos opening angle of the associated cluster directions. More... | |
float | m_maxPredictedMergePointOffset |
The threshold separation distance between the predicted and true cluster merge points. More... | |
float | m_distanceToLine |
The threshold hit distance of an extrapolated hit from the segment connecting line. More... | |
float | m_boundaryTolerance |
The maximum allowed distance of an extremal extrapolate hit to a cluster merge point. More... | |
Additional Inherited Members | |
Protected Types inherited from lar_content::TrackRefinementBaseAlgorithm | |
typedef std::pair < TwoDSlidingFitResultMap *, TwoDSlidingFitResultMap * > | SlidingFitResultMapPair |
typedef std::unordered_map < const pandora::Cluster *, pandora::CaloHitList > | ClusterToCaloHitListMap |
Protected Member Functions inherited from lar_content::TrackRefinementBaseAlgorithm | |
template<typename T > | |
void | InitialiseContainers (const pandora::ClusterList *pClusterList, const T sortFunction, pandora::ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Fill the cluster vector and sliding fit maps with clusters that are determined to be track-like. More... | |
bool | GetClusterMergingCoordinates (const TwoDSlidingFitResult &clusterMicroFitResult, const TwoDSlidingFitResult &clusterMacroFitResult, const TwoDSlidingFitResult &associatedMacroFitResult, const bool isEndUpstream, pandora::CartesianVector &clusterMergePosition, pandora::CartesianVector &clusterMergeDirection) const |
Get the merging coordinate and direction for an input cluster with respect to an associated cluster. More... | |
void | GetHitsInBoundingBox (const pandora::CartesianVector &firstCorner, const pandora::CartesianVector &secondCorner, const pandora::ClusterList *const pClusterList, ClusterToCaloHitListMap &clusterToCaloHitListMap, const pandora::ClusterList &unavailableProtectedClusters=pandora::ClusterList(), const float distanceToLine=-1.f) const |
Find the unprotected hits that are contained within a defined box with the option to apply a cut on the distance to the connecting line. More... | |
bool | IsInBoundingBox (const float minX, const float maxX, const float minZ, const float maxZ, const pandora::CartesianVector &hitPosition) const |
check whether a hit is contained within a defined square region More... | |
bool | IsCloseToLine (const pandora::CartesianVector &hitPosition, const pandora::CartesianVector &lineStart, const pandora::CartesianVector &lineDirection, const float distanceToLine) const |
Check whether a hit is close to a line. More... | |
bool | AreExtrapolatedHitsGood (const ClusterToCaloHitListMap &clusterToCaloHitListMap, ClusterAssociation &clusterAssociation) const |
Perform topological checks on the collected hits to ensure no gaps are present. More... | |
bool | IsNearBoundary (const pandora::CaloHit *const pCaloHit, const pandora::CartesianVector &boundaryPosition2D, const float boundaryTolerance) const |
Check whether a hit is close to a boundary point. More... | |
bool | IsTrackContinuous (const ClusterAssociation &clusterAssociation, const pandora::CaloHitVector &extrapolatedCaloHitVector) const |
Check whether the extrapolatedCaloHitVector contains a continuous line of hits between the cluster merge points. More... | |
void | GetTrackSegmentBoundaries (const ClusterAssociation &clusterAssociation, pandora::CartesianPointVector &trackSegmentBoundaries) const |
Obtain the segment boundaries of the connecting line to test whether extrapolated hits are continuous. More... | |
void | RepositionIfInGap (const pandora::CartesianVector &mergeDirection, pandora::CartesianVector &trackPoint) const |
Move an input position to the higher line gap edge if it lies within a gap. More... | |
float | DistanceInGap (const pandora::CartesianVector &upstreamPoint, const pandora::CartesianVector &downstreamPoint, const pandora::CartesianVector &connectingLine, pandora::DetectorGapList &consideredGaps) const |
Calculate the track length between two points that lies in gaps. More... | |
bool | IsInLineSegment (const pandora::CartesianVector &lowerBoundary, const pandora::CartesianVector &upperBoundary, const pandora::CartesianVector &point) const |
Whether a position falls within a specified segment of the cluster connecting line. More... | |
const pandora::Cluster * | RemoveOffAxisHitsFromTrack (const pandora::Cluster *const pCluster, const pandora::CartesianVector &splitPosition, const bool isEndUpstream, const ClusterToCaloHitListMap &clusterToCaloHitListMap, pandora::ClusterList &remnantClusterList, TwoDSlidingFitResultMap µSlidingFitResultMap, TwoDSlidingFitResultMap ¯oSlidingFitResultMap) const |
Remove any hits in the upstream/downstream cluster that lie off of the main track axis (i.e. clustering errors) More... | |
void | AddHitsToMainTrack (const pandora::Cluster *const pMainTrackCluster, const pandora::Cluster *const pShowerTrackCluster, const pandora::CaloHitList &caloHitsToMerge, const ClusterAssociation &clusterAssociation, pandora::ClusterList &remnantClusterList) const |
Remove the hits from a shower cluster that belong to the main track and add them into the main track cluster. More... | |
void | ProcessRemnantClusters (const pandora::ClusterList &remnantClusterList, const pandora::Cluster *const pMainTrackCluster, const pandora::ClusterList *const pClusterList, pandora::ClusterList &createdClusters) const |
Process the remnant clusters separating those that stradle the main track. More... | |
bool | AddToNearestCluster (const pandora::Cluster *const pClusterToMerge, const pandora::Cluster *const pMainTrackCluster, const pandora::ClusterList *const pClusterList) const |
Add a cluster to the nearest cluster satisfying separation distance thresholds. More... | |
bool | IsClusterRemnantDisconnected (const pandora::Cluster *const pRemnantCluster) const |
Whether a remnant cluster is considered to be disconnected and therefore should undergo further fragmentation. More... | |
void | FragmentRemnantCluster (const pandora::Cluster *const pRemnantCluster, pandora::ClusterList &fragmentedClusterList) const |
Fragment a cluster using simple hit separation logic. More... | |
template<typename T > | |
void | UpdateContainers (const pandora::ClusterList &clustersToAdd, const pandora::ClusterList &clustersToDelete, const T sortFunction, pandora::ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Remove deleted clusters from the cluster vector and sliding fit maps and add in created clusters that are determined to be track-like. More... | |
void | RemoveClusterFromContainers (const pandora::Cluster *const pClustertoRemove, pandora::ClusterVector &clusterVector, SlidingFitResultMapPair &slidingFitResultMapPair) const |
Remove a cluster from the cluster vector and sliding fit maps. More... | |
Protected Attributes inherited from lar_content::TrackRefinementBaseAlgorithm | |
float | m_minClusterLength |
The minimum length of a considered cluster. More... | |
unsigned int | m_microSlidingFitWindow |
The sliding fit window used in the fits contained within the microSlidingFitResultMap. More... | |
unsigned int | m_macroSlidingFitWindow |
The sliding fit window used in the fits contained within the macroSlidingFitResultMap. More... | |
float | m_stableRegionClusterFraction |
The threshold fraction of fit contributing layers which defines the stable region. More... | |
float | m_mergePointMinCosAngleDeviation |
The threshold cos opening angle between the cluster local gradient and the associated cluster global gradient used to determine merge points. More... | |
float | m_minHitFractionForHitRemoval |
The threshold fraction of hits to be removed from the cluster for hit removal to proceed. More... | |
float | m_maxDistanceFromMainTrack |
The threshold distance for a hit to be added to the main track. More... | |
float | m_maxHitDistanceFromCluster |
The threshold separation between a hit and cluster for the hit to be merged into the cluster. More... | |
float | m_maxHitSeparationForConnectedCluster |
The maximum separation between two adjacent (in z) hits in a connected cluster. More... | |
unsigned int | m_maxTrackGaps |
The maximum number of graps allowed in the extrapolated hit vector. More... | |
float | m_lineSegmentLength |
The length of a track gap. More... | |
bool | m_hitWidthMode |
Whether to consider the width of hits. More... | |
TrackMergeRefinementAlgorithm class.
Definition at line 18 of file TrackMergeRefinementAlgorithm.h.
lar_content::TrackMergeRefinementAlgorithm::TrackMergeRefinementAlgorithm | ( | ) |
Default constructor.
Definition at line 21 of file TrackMergeRefinementAlgorithm.cc.
|
private |
Whether two clusters are assoicated to one another.
upstreamPoint | the merge point of the upstream cluster |
upstreamDirection | the local direction of the upstream cluster at the merge point |
downstreamPoint | the merge point of the downstream cluster |
downstreamDirection | the local direction of the downstrean cluster at the merge point |
Definition at line 175 of file TrackMergeRefinementAlgorithm.cc.
|
privatevirtual |
Check the separation of the extremal extrapolated hits with the cluster merge points or, in the case of no hits, the cluster merge point separation.
extrapolatedHitVector | the extrapolated hit vector (ordered closest hit to the upstream merge point -> furthest hit) |
clusterAssociation | the cluster association |
Implements lar_content::TrackRefinementBaseAlgorithm.
Definition at line 217 of file TrackMergeRefinementAlgorithm.cc.
|
private |
Remove the cluster association from the cluster vector so that the same cluster pair is not considered again.
clusterAssociation | the cluster pair association |
clusterVector | the vector of clusters considered in future iterations of the algorithm |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
Definition at line 236 of file TrackMergeRefinementAlgorithm.cc.
|
private |
Refine the cluster endpoints and merge together the associated clusters alongside any extrapolated hits.
clusterAssociation | the cluster pair association |
clusterToCaloHitListMap | the map [parent cluster -> list of hits which belong to the main track] |
pClusterList | the list of all clusters |
clusterVector | the vector of clusters considered in future iterations of the algorithm |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
Definition at line 246 of file TrackMergeRefinementAlgorithm.cc.
|
private |
Find the best cluster association.
clusterVector | the vector of clusters to consider |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
clusterAssociation | the cluster pair association |
Definition at line 91 of file TrackMergeRefinementAlgorithm.cc.
|
private |
Obtain a list of clusters whos hits are protected and cannot be reassigned.
clusterAssociation | the clusterPairAssociation |
createdMainTrackClusters | the list of main track clusters that have hitherto collected |
unavailableProtectedClusters | the output list of protected clusters |
Definition at line 205 of file TrackMergeRefinementAlgorithm.cc.
|
privatevirtual |
Implements lar_content::TrackRefinementBaseAlgorithm.
Definition at line 291 of file TrackMergeRefinementAlgorithm.cc.
|
privatevirtual |
Implements lar_content::TrackRefinementBaseAlgorithm.
Definition at line 34 of file TrackMergeRefinementAlgorithm.cc.
|
private |
The maximum allowed distance of an extremal extrapolate hit to a cluster merge point.
Definition at line 105 of file TrackMergeRefinementAlgorithm.h.
|
private |
The threshold hit distance of an extrapolated hit from the segment connecting line.
Definition at line 104 of file TrackMergeRefinementAlgorithm.h.
|
private |
The maximum number of main loop iterations.
Definition at line 99 of file TrackMergeRefinementAlgorithm.h.
|
private |
The threshold separation distance between the predicted and true cluster merge points.
Definition at line 103 of file TrackMergeRefinementAlgorithm.h.
|
private |
The threshold cluster and associated cluster length sum.
Definition at line 100 of file TrackMergeRefinementAlgorithm.h.
|
private |
The threshold cos opening angle of the associated cluster directions.
Definition at line 102 of file TrackMergeRefinementAlgorithm.h.
|
private |
The threshold separation distance between associated clusters.
Definition at line 101 of file TrackMergeRefinementAlgorithm.h.