LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
CandidateVertexCreationAlgorithm::Algorithm class. More...
#include "CandidateVertexCreationAlgorithm.h"
Public Member Functions | |
CandidateVertexCreationAlgorithm () | |
Default constructor. More... | |
Private Types | |
typedef std::unordered_map< const pandora::Cluster *, pandora::CartesianPointVector > | ClusterToSpacepointsMap |
Private Member Functions | |
pandora::StatusCode | Run () |
void | SelectClusters (pandora::ClusterVector &clusterVectorU, pandora::ClusterVector &clusterVectorV, pandora::ClusterVector &clusterVectorW) |
Select a subset of input clusters (contained in the input list names) for processing in this algorithm. More... | |
void | CreateEndpointCandidates (const pandora::ClusterVector &clusterVector1, const pandora::ClusterVector &clusterVector2) const |
Create candidate vertex positions by comparing pairs of cluster end positions. More... | |
void | CreateEndpointVertex (const pandora::CartesianVector &position1, const pandora::HitType hitType1, const TwoDSlidingFitResult &fitResult2) const |
Create a candidate vertex position, using an end-point position from one cluster and sliding fit to a second cluster. More... | |
void | CreateCrossingCandidates (const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV, const pandora::ClusterVector &clusterVectorW) const |
Extrapolate 2D clusters, find where they cross, and match crossing points between views to create vertex candidates. More... | |
void | FindCrossingPoints (const pandora::ClusterVector &clusterVector, pandora::CartesianPointVector &crossingPoints) const |
Identify where (extrapolated) clusters plausibly cross in 2D. More... | |
void | GetSpacepoints (const pandora::Cluster *const pCluster, pandora::CartesianPointVector &spacePoints) const |
Get a list of spacepoints representing cluster 2D hit positions and extrapolated positions. More... | |
void | FindCrossingPoints (const pandora::CartesianPointVector &spacepoints1, const pandora::CartesianPointVector &spacepoints2, pandora::CartesianPointVector &crossingPoints) const |
Identify where (extrapolated) clusters plausibly cross in 2D. More... | |
void | CreateCrossingVertices (const pandora::CartesianPointVector &crossingPoints1, const pandora::CartesianPointVector &crossingPoints2, const pandora::HitType hitType1, const pandora::HitType hitType2, unsigned int &nCrossingCandidates) const |
Attempt to create candidate vertex positions, using 2D crossing points in 2 views. More... | |
void | AddInputVertices () const |
Add candidate vertices from any input vertices. More... | |
void | AddToSlidingFitCache (const pandora::Cluster *const pCluster) |
Creates a 2D sliding fit of a cluster and stores it for later use. More... | |
const TwoDSlidingFitResult & | GetCachedSlidingFitResult (const pandora::Cluster *const pCluster) const |
Get a sliding fit result from the algorithm cache. More... | |
void | TidyUp () |
Clear relevant algorithm member variables between events. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
pandora::StringVector | m_inputClusterListNames |
The list of cluster list names. More... | |
std::string | m_inputVertexListName |
The list name for existing candidate vertices. More... | |
std::string | m_outputVertexListName |
The name under which to save the output vertex list. More... | |
bool | m_replaceCurrentVertexList |
Whether to replace the current vertex list with the output list. More... | |
unsigned int | m_slidingFitWindow |
The layer window for the sliding linear fits. More... | |
TwoDSlidingFitResultMap | m_slidingFitResultMap |
The sliding fit result map. More... | |
unsigned int | m_minClusterCaloHits |
The min number of hits in base cluster selection method. More... | |
float | m_minClusterLengthSquared |
The min length (squared) in base cluster selection method. More... | |
float | m_chiSquaredCut |
The chi squared cut (accept only 3D vertex positions with values below cut) More... | |
bool | m_enableEndpointCandidates |
Whether to create endpoint-based candidates. More... | |
float | m_maxEndpointXDiscrepancy |
The max cluster endpoint discrepancy. More... | |
bool | m_enableCrossingCandidates |
Whether to create crossing vertex candidates. More... | |
unsigned int | m_nMaxCrossingCandidates |
The max number of crossing candidates to create. More... | |
float | m_maxCrossingXDiscrepancy |
The max cluster endpoint discrepancy. More... | |
unsigned int | m_extrapolationNSteps |
Number of extrapolation steps, at each end of cluster, of specified size. More... | |
float | m_extrapolationStepSize |
The extrapolation step size in cm. More... | |
float | m_maxCrossingSeparationSquared |
The separation (squared) between spacepoints below which a crossing can be identified. More... | |
float | m_minNearbyCrossingDistanceSquared |
The minimum allowed distance between identified crossing positions. More... | |
bool | m_reducedCandidates |
Whether to reduce the number of candidates. More... | |
float | m_selectionCutFactorMax |
Maximum factor to multiply the base cluster selection cuts. More... | |
float | m_nClustersPassingMaxCutsPar |
Parameter for number of clusters passing the max base cluster selection cuts. More... | |
CandidateVertexCreationAlgorithm::Algorithm class.
Definition at line 23 of file CandidateVertexCreationAlgorithm.h.
|
private |
Definition at line 134 of file CandidateVertexCreationAlgorithm.h.
lar_content::CandidateVertexCreationAlgorithm::CandidateVertexCreationAlgorithm | ( | ) |
Default constructor.
Definition at line 23 of file CandidateVertexCreationAlgorithm.cc.
|
private |
Add candidate vertices from any input vertices.
Definition at line 387 of file CandidateVertexCreationAlgorithm.cc.
References m_inputVertexListName.
Referenced by Run().
|
private |
Creates a 2D sliding fit of a cluster and stores it for later use.
pCluster | address of the relevant cluster |
Definition at line 415 of file CandidateVertexCreationAlgorithm.cc.
References lar_content::LArGeometryHelper::GetWireZPitch(), m_slidingFitResultMap, and m_slidingFitWindow.
Referenced by SelectClusters().
|
private |
Extrapolate 2D clusters, find where they cross, and match crossing points between views to create vertex candidates.
clusterVectorU | the clusters in the u view |
clusterVectorV | the clusters in the v view |
clusterVectorW | the clusters in the w view |
Definition at line 240 of file CandidateVertexCreationAlgorithm.cc.
References CreateCrossingVertices(), FindCrossingPoints(), and GetSpacepoints().
Referenced by Run().
|
private |
Attempt to create candidate vertex positions, using 2D crossing points in 2 views.
crossingPoints1 | the crossing points in view 1 |
crossingPoints2 | the crossing points in view 2 |
hitType1 | the hit type of crossing points 1 |
hitType2 | the hit type of crossing points 2 |
nCrossingCandidates | to count the number of crossing candidates created |
Definition at line 352 of file CandidateVertexCreationAlgorithm.cc.
References f, m_chiSquaredCut, m_maxCrossingXDiscrepancy, m_nMaxCrossingCandidates, and lar_content::LArGeometryHelper::MergeTwoPositions3D().
Referenced by CreateCrossingCandidates().
|
private |
Create candidate vertex positions by comparing pairs of cluster end positions.
clusterVector1 | the clusters in view 1 |
clusterVector1 | the clusters in view 2 |
Definition at line 174 of file CandidateVertexCreationAlgorithm.cc.
References CreateEndpointVertex(), GetCachedSlidingFitResult(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), and lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition().
Referenced by Run().
|
private |
Create a candidate vertex position, using an end-point position from one cluster and sliding fit to a second cluster.
position1 | an end-point position for the first cluster |
hitType1 | the hit type of the first cluster |
fitResult2 | the two dimensional sliding fit result for the second cluster |
Definition at line 202 of file CandidateVertexCreationAlgorithm.cc.
References f, lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::TwoDSlidingFitResult::GetExtrapolatedPositionAtX(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), m_chiSquaredCut, m_maxEndpointXDiscrepancy, and lar_content::LArGeometryHelper::MergeTwoPositions3D().
Referenced by CreateEndpointCandidates().
|
private |
Identify where (extrapolated) clusters plausibly cross in 2D.
clusterVector | the input clusters |
crossingPoints | to receive the 2D crossing points |
Referenced by CreateCrossingCandidates(), and GetSpacepoints().
|
private |
Identify where (extrapolated) clusters plausibly cross in 2D.
spacepoints1 | space points for cluster 1 |
spacepoints2 | space points for cluster 2 |
crossingPoints | to receive the list of plausible 2D crossing points |
|
private |
Get a sliding fit result from the algorithm cache.
pCluster | address of the relevant cluster |
Definition at line 426 of file CandidateVertexCreationAlgorithm.cc.
References m_slidingFitResultMap.
Referenced by CreateEndpointCandidates(), and GetSpacepoints().
|
private |
Get a list of spacepoints representing cluster 2D hit positions and extrapolated positions.
pCluster | address of the cluster |
spacePoints | to receive the list of spacepoints |
Definition at line 280 of file CandidateVertexCreationAlgorithm.cc.
References f, FindCrossingPoints(), GetCachedSlidingFitResult(), lar_content::LArClusterHelper::GetCoordinateVector(), lar_content::TwoDSlidingFitResult::GetExtrapolatedPosition(), lar_content::TwoDSlidingFitResult::GetL(), lar_content::TwoDSlidingFitResult::GetMaxLayer(), lar_content::TwoDSlidingFitResult::GetMinLayer(), m_extrapolationNSteps, m_extrapolationStepSize, m_maxCrossingSeparationSquared, m_minNearbyCrossingDistanceSquared, and lar_content::LArClusterHelper::SortCoordinatesByPosition().
Referenced by CreateCrossingCandidates().
|
private |
Definition at line 445 of file CandidateVertexCreationAlgorithm.cc.
References m_chiSquaredCut, m_enableCrossingCandidates, m_enableEndpointCandidates, m_extrapolationNSteps, m_extrapolationStepSize, m_inputClusterListNames, m_inputVertexListName, m_maxCrossingSeparationSquared, m_maxCrossingXDiscrepancy, m_maxEndpointXDiscrepancy, m_minClusterCaloHits, m_minClusterLengthSquared, m_minNearbyCrossingDistanceSquared, m_nClustersPassingMaxCutsPar, m_nMaxCrossingCandidates, m_outputVertexListName, m_reducedCandidates, m_replaceCurrentVertexList, m_selectionCutFactorMax, and m_slidingFitWindow.
|
private |
Definition at line 46 of file CandidateVertexCreationAlgorithm.cc.
References AddInputVertices(), CreateCrossingCandidates(), CreateEndpointCandidates(), m_enableCrossingCandidates, m_enableEndpointCandidates, m_inputVertexListName, m_outputVertexListName, m_replaceCurrentVertexList, SelectClusters(), and TidyUp().
|
private |
Select a subset of input clusters (contained in the input list names) for processing in this algorithm.
clusterVectorU | to receive the selected clusters in the u view |
clusterVectorV | to receive the selected clusters in the v view |
clusterVectorW | to receive the selected clusters in the w view |
Definition at line 91 of file CandidateVertexCreationAlgorithm.cc.
References AddToSlidingFitCache(), f, lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArClusterHelper::GetLengthSquared(), m_inputClusterListNames, m_minClusterCaloHits, m_minClusterLengthSquared, m_nClustersPassingMaxCutsPar, m_reducedCandidates, m_selectionCutFactorMax, and lar_content::LArClusterHelper::SortByNHits().
Referenced by Run().
|
private |
Clear relevant algorithm member variables between events.
Definition at line 438 of file CandidateVertexCreationAlgorithm.cc.
References m_slidingFitResultMap.
Referenced by Run().
|
private |
The chi squared cut (accept only 3D vertex positions with values below cut)
Definition at line 146 of file CandidateVertexCreationAlgorithm.h.
Referenced by CreateCrossingVertices(), CreateEndpointVertex(), and ReadSettings().
|
private |
Whether to create crossing vertex candidates.
Definition at line 151 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to create endpoint-based candidates.
Definition at line 148 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Number of extrapolation steps, at each end of cluster, of specified size.
Definition at line 154 of file CandidateVertexCreationAlgorithm.h.
Referenced by GetSpacepoints(), and ReadSettings().
|
private |
The extrapolation step size in cm.
Definition at line 155 of file CandidateVertexCreationAlgorithm.h.
Referenced by GetSpacepoints(), and ReadSettings().
|
private |
The list of cluster list names.
Definition at line 136 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
The list name for existing candidate vertices.
Definition at line 137 of file CandidateVertexCreationAlgorithm.h.
Referenced by AddInputVertices(), ReadSettings(), and Run().
|
private |
The separation (squared) between spacepoints below which a crossing can be identified.
Definition at line 156 of file CandidateVertexCreationAlgorithm.h.
Referenced by GetSpacepoints(), and ReadSettings().
|
private |
The max cluster endpoint discrepancy.
Definition at line 153 of file CandidateVertexCreationAlgorithm.h.
Referenced by CreateCrossingVertices(), and ReadSettings().
|
private |
The max cluster endpoint discrepancy.
Definition at line 149 of file CandidateVertexCreationAlgorithm.h.
Referenced by CreateEndpointVertex(), and ReadSettings().
|
private |
The min number of hits in base cluster selection method.
Definition at line 144 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
The min length (squared) in base cluster selection method.
Definition at line 145 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
The minimum allowed distance between identified crossing positions.
Definition at line 157 of file CandidateVertexCreationAlgorithm.h.
Referenced by GetSpacepoints(), and ReadSettings().
|
private |
Parameter for number of clusters passing the max base cluster selection cuts.
Definition at line 161 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
The max number of crossing candidates to create.
Definition at line 152 of file CandidateVertexCreationAlgorithm.h.
Referenced by CreateCrossingVertices(), and ReadSettings().
|
private |
The name under which to save the output vertex list.
Definition at line 138 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to reduce the number of candidates.
Definition at line 159 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
Whether to replace the current vertex list with the output list.
Definition at line 139 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Maximum factor to multiply the base cluster selection cuts.
Definition at line 160 of file CandidateVertexCreationAlgorithm.h.
Referenced by ReadSettings(), and SelectClusters().
|
private |
The sliding fit result map.
Definition at line 142 of file CandidateVertexCreationAlgorithm.h.
Referenced by AddToSlidingFitCache(), GetCachedSlidingFitResult(), and TidyUp().
|
private |
The layer window for the sliding linear fits.
Definition at line 141 of file CandidateVertexCreationAlgorithm.h.
Referenced by AddToSlidingFitCache(), and ReadSettings().