TrackRefinementBaseAlgorithm class. More...
#include <TrackRefinementBaseAlgorithm.h>
Classes | |
class | SortByDistanceAlongLine |
SortByDistanceAlongLine class. More... | |
Public Member Functions | |
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 |
Protected Types | |
typedef std::pair< TwoDSlidingFitResultMap *, TwoDSlidingFitResultMap * > | SlidingFitResultMapPair |
typedef std::unordered_map< const pandora::Cluster *, pandora::CaloHitList > | ClusterToCaloHitListMap |
Protected Member Functions | |
virtual pandora::StatusCode | Run ()=0 |
virtual pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle)=0 |
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... | |
virtual bool | AreExtrapolatedHitsNearBoundaries (const pandora::CaloHitVector &extrapolatedHitVector, ClusterAssociation &clusterAssociation) const =0 |
Check the separation of the extremal extrapolated hits with the expected endpoints or, in the case of no hits, the clusterMergePoint themselves. 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 | |
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... | |
TrackRefinementBaseAlgorithm class.
Definition at line 21 of file TrackRefinementBaseAlgorithm.h.
|
protected |
Definition at line 31 of file TrackRefinementBaseAlgorithm.h.
|
protected |
Definition at line 30 of file TrackRefinementBaseAlgorithm.h.
lar_content::TrackRefinementBaseAlgorithm::TrackRefinementBaseAlgorithm | ( | ) |
Default constructor.
Definition at line 21 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Remove the hits from a shower cluster that belong to the main track and add them into the main track cluster.
pMainTrackCluster | the main track cluster |
pShowerCluster | the input shower cluster |
caloHitsToMerge | the list of calo hits to remove from the shower cluster |
clusterAssociation | the clusterAssociation |
remnantClusterList | the input list to store the remnant clusters |
Definition at line 573 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Add a cluster to the nearest cluster satisfying separation distance thresholds.
pClusterToMerge | the cluster to merge |
pMainTrackCluster | the main track cluster |
pClusterList | the list of all clusters |
Definition at line 668 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Perform topological checks on the collected hits to ensure no gaps are present.
clusterToCaloHitListMap | the input map [parent cluster -> list of hits which belong to the main track] |
clusterAssociation | the clusterAssociation |
Definition at line 188 of file TrackRefinementBaseAlgorithm.cc.
|
protectedpure virtual |
Check the separation of the extremal extrapolated hits with the expected endpoints or, in the case of no hits, the clusterMergePoint themselves.
extrapolatedHitVector | the extrapolated hit vector (ordered closest hit to the upstream merge point -> furthest hit) |
clusterAssociation | the clusterAssociation |
Implemented in lar_content::TrackMergeRefinementAlgorithm.
|
protected |
Calculate the track length between two points that lies in gaps.
upstreamPoint | the upstream point |
downstreamPoint | the downstream point |
connectingLine | the track direction |
consideredGaps | the list of gaps to ignore |
Definition at line 385 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Fragment a cluster using simple hit separation logic.
pRemnantCluster | the input remnant cluster to fragment |
fragmentedClusterList | the input list to store the final remnant clusters |
Definition at line 731 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Get the merging coordinate and direction for an input cluster with respect to an associated cluster.
clusterMicroFitResult | the local TwoDSlidingFitResult of the cluster |
clusterMacroFitResult | the global TwoDSlidingFitResult of the cluster |
associatedMacroFitReult | the global TwoDSlidingFitResult of the associated cluster |
isEndUpstream | whether the sought cluster merge point is the upstream |
clusterMergePosition | the merge position of the cluster |
clusterMergeDirection | the merge direction of the cluster |
Definition at line 69 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
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.
firstCorner | the position of one corner |
secondCorner | the position of the opposite corner |
pClusterList | the list of all clusters |
clusterToCaloHitListMap | the output map [parent cluster -> list of hits which belong to the main track] |
unavailableProtectedClusters | the list of clusters whose hits are protected |
distanceToLine | the maximum perpendicular distance of a collected hit from the connecting line |
Definition at line 130 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Obtain the segment boundaries of the connecting line to test whether extrapolated hits are continuous.
clusterAssociation | the clusterAssociation |
trackSegmentBoundaries | the output vector of segment boundaries |
Definition at line 275 of file TrackRefinementBaseAlgorithm.cc.
void lar_content::TrackRefinementBaseAlgorithm::InitialiseContainers | ( | const ClusterList * | pClusterList, |
const T | sortFunction, | ||
ClusterVector & | clusterVector, | ||
SlidingFitResultMapPair & | slidingFitResultMapPair | ||
) | const |
Definition at line 40 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Fill the cluster vector and sliding fit maps with clusters that are determined to be track-like.
pClusterList | the list of input clusters |
sortFunction | the sort class or function used to sort the clusterVector |
clusterVector | the input vector to store clusters considered within the algorithm |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
|
protected |
Check whether a hit is close to a line.
hitPosition | the position of the hit |
lineStart | the start point of the line (can actually be any point on the line) |
lineDirection | the unit vector of the line direction |
distanceToLine | the definition of 'close' |
Definition at line 178 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Whether a remnant cluster is considered to be disconnected and therefore should undergo further fragmentation.
pRemnantCluster | the input remnant cluster |
Definition at line 702 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
check whether a hit is contained within a defined square region
minX | the minimum x coordinate of the square region |
maxX | the maximum x coordinate of the square region |
minZ | the minimum z coordinate of the square region |
maxZ | the maximum z coordinate of the square region |
hitPosition | the position of the hit |
Definition at line 170 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Whether a position falls within a specified segment of the cluster connecting line.
lowerBoundary | the lower boundary of the segment |
upperBoundary | the upper boundary of the segment |
point | the position |
Definition at line 472 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Check whether a hit is close to a boundary point.
pCaloHit | the input calo hit |
boundaryPosition2D | the position of the 2D boundary point |
boundaryTolerance | the definition of close |
Definition at line 212 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Check whether the extrapolatedCaloHitVector contains a continuous line of hits between the cluster merge points.
clusterAssociation | the clusterAssociation |
extrapolatedCaloHitVector | the vector of extrapolated calo hits |
Definition at line 221 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Process the remnant clusters separating those that stradle the main track.
remnantClusterList | the list of remnant clusters to process |
pMainTrackCluster | the main track cluster |
pClusterList | the list of all clusters |
createdClusters | the input list to store the final remnant clusters |
Definition at line 641 of file TrackRefinementBaseAlgorithm.cc.
|
protectedpure virtual |
Implemented in lar_content::TrackMergeRefinementAlgorithm.
Definition at line 823 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Remove a cluster from the cluster vector and sliding fit maps.
pClustertoRemove | the clusters to remove from the containers |
clusterVector | the vector to store clusters considered within the algorithm |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
Definition at line 805 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Remove any hits in the upstream/downstream cluster that lie off of the main track axis (i.e. clustering errors)
pCluster | the input cluster |
splitPosition | the position after which hits are considered for removal |
isEndUpstream | whether the upstream end is to be refined |
clusterToCaloHitListMap | the map [parent cluster -> list of hits which belong to the main track] |
remnantClusterList | the input list to store the remnant clusters |
microSlidingFitResultMap | the mapping [cluster -> TwoDSlidingFitResult] where fits correspond to local gradients |
macroSlidingFitResultMap | the mapping [cluster -> TwoDSlidingFitResult] where fits correspond to global cluster gradients |
Definition at line 496 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Move an input position to the higher line gap edge if it lies within a gap.
mergeDirection | the direction of the track |
trackPoint | the input position |
Definition at line 341 of file TrackRefinementBaseAlgorithm.cc.
|
protectedpure virtual |
Implemented in lar_content::TrackMergeRefinementAlgorithm.
|
protected |
Remove deleted clusters from the cluster vector and sliding fit maps and add in created clusters that are determined to be track-like.
clustersToAdd | the list of clusters to add to the containers |
clustersToDelete | the list of clusters to remove from the containers |
sortFunction | the sort class or function used to sort the clusterVector |
clusterVector | the vector to store clusters considered within the algorithm |
slidingFitResultMapPair | the {micro, macro} pair of [cluster -> TwoDSlidingFitResult] maps |
void lar_content::TrackRefinementBaseAlgorithm::UpdateContainers | ( | const ClusterList & | clustersToAdd, |
const ClusterList & | clustersToDelete, | ||
const T | sortFunction, | ||
ClusterVector & | clusterVector, | ||
SlidingFitResultMapPair & | slidingFitResultMapPair | ||
) | const |
Definition at line 793 of file TrackRefinementBaseAlgorithm.cc.
|
protected |
Whether to consider the width of hits.
Definition at line 318 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The length of a track gap.
Definition at line 317 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The sliding fit window used in the fits contained within the macroSlidingFitResultMap.
Definition at line 309 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The threshold distance for a hit to be added to the main track.
Definition at line 313 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The threshold separation between a hit and cluster for the hit to be merged into the cluster.
Definition at line 314 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The maximum separation between two adjacent (in z) hits in a connected cluster.
Definition at line 315 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The maximum number of graps allowed in the extrapolated hit vector.
Definition at line 316 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The threshold cos opening angle between the cluster local gradient and the associated cluster global gradient used to determine merge points.
Definition at line 311 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The sliding fit window used in the fits contained within the microSlidingFitResultMap.
Definition at line 308 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The minimum length of a considered cluster.
Definition at line 307 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The threshold fraction of hits to be removed from the cluster for hit removal to proceed.
Definition at line 312 of file TrackRefinementBaseAlgorithm.h.
|
protected |
The threshold fraction of fit contributing layers which defines the stable region.
Definition at line 310 of file TrackRefinementBaseAlgorithm.h.