LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
ThreeDTrackFragmentsAlgorithm class. More...
#include "ThreeDTrackFragmentsAlgorithm.h"
Public Types | |
typedef OverlapTensor< FragmentOverlapResult > | TensorType |
Public Member Functions | |
ThreeDTrackFragmentsAlgorithm () | |
Default constructor. More... | |
void | UpdateForNewCluster (const pandora::Cluster *const pNewCluster) |
Update to reflect addition of a new cluster to the problem space. More... | |
void | RebuildClusters (const pandora::ClusterList &rebuildList, pandora::ClusterList &newClusters) const |
Rebuild clusters after fragmentation. More... | |
const TwoDSlidingFitResult & | GetCachedSlidingFitResult (const pandora::Cluster *const pCluster) const |
Get a sliding fit result from the algorithm cache. More... | |
unsigned int | GetSlidingFitWindow () const |
Get the layer window for the sliding linear fits. More... | |
virtual bool | MakeClusterSplits (const SplitPositionMap &splitPositionMap) |
Make cluster splits. More... | |
virtual bool | MakeClusterSplit (const pandora::CartesianVector &splitPosition, const pandora::Cluster *&pCurrentCluster, const pandora::Cluster *&pLowXCluster, const pandora::Cluster *&pHighXCluster) const |
Make a cluster split. More... | |
virtual void | UpdateUponDeletion (const pandora::Cluster *const pDeletedCluster) |
Update to reflect cluster deletion. More... | |
virtual void | SelectInputClusters (const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const |
Select a subset of input clusters for processing in this algorithm. More... | |
virtual void | SetPfoParameters (const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const |
Calculate Pfo properties from proto particle. More... | |
virtual bool | CreateThreeDParticles (const ProtoParticleVector &protoParticleVector) |
Create particles using findings from recent algorithm processing. More... | |
virtual bool | MakeClusterMerges (const ClusterMergeMap &clusterMergeMap) |
Merge clusters together. More... | |
virtual void | RemoveUnavailableTensorElements () |
Update tensor to remove all elements that have been added to pfos and so are unavailable. More... | |
const pandora::ClusterList & | GetInputClusterListU () const |
Get the input u cluster list. More... | |
const pandora::ClusterList & | GetInputClusterListV () const |
Get the input v cluster list. More... | |
const pandora::ClusterList & | GetInputClusterListW () const |
Get the input w cluster list. More... | |
const pandora::ClusterList & | GetSelectedClusterListU () const |
Get the selected u cluster list. More... | |
const pandora::ClusterList & | GetSelectedClusterListV () const |
Get the selected v cluster list. More... | |
const pandora::ClusterList & | GetSelectedClusterListW () const |
Get the selected w cluster list. More... | |
const std::string & | GetClusterListNameU () const |
Get the name of the u cluster list. More... | |
const std::string & | GetClusterListNameV () const |
Get the name of the v cluster list. More... | |
const std::string & | GetClusterListNameW () const |
Get the name of the w cluster list. More... | |
Static Public Member Functions | |
static bool | SortSplitPositions (const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs) |
Sort split position cartesian vectors by increasing x coordinate. More... | |
Protected Types | |
typedef std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > | HitToClusterMap |
typedef std::unordered_map< const pandora::Cluster *, unsigned int > | ClusterToMatchedHitsMap |
typedef std::vector< FragmentTensorTool * > | TensorToolVector |
Protected Member Functions | |
void | PerformMainLoop () |
Main loop over cluster combinations in order to populate the tensor. Responsible for calling CalculateOverlapResult. More... | |
void | CalculateOverlapResult (const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW) |
Calculate cluster overlap result and store in tensor. More... | |
pandora::StatusCode | CalculateOverlapResult (const TwoDSlidingFitResult &fitResult1, const TwoDSlidingFitResult &fitResult2, const pandora::ClusterList &inputClusterList, const pandora::Cluster *&pBestMatchedCluster, FragmentOverlapResult &fragmentOverlapResult) const |
Calculate overlap result for track fragment candidate consisting of two sliding fit results and a list of available clusters. More... | |
pandora::StatusCode | GetProjectedPositions (const TwoDSlidingFitResult &fitResult1, const TwoDSlidingFitResult &fitResult2, pandora::CartesianPointVector &projectedPositions) const |
Get the list of projected positions, in the third view, corresponding to a pair of sliding fit results. More... | |
pandora::StatusCode | GetMatchedHits (const pandora::ClusterList &inputClusterList, const pandora::CartesianPointVector &projectedPositions, HitToClusterMap &hitToClusterMap, pandora::CaloHitList &matchedCaloHits) const |
Get the list of hits associated with the projected positions and a useful hit to cluster map. More... | |
pandora::StatusCode | GetMatchedClusters (const pandora::CaloHitList &matchedHits, const HitToClusterMap &hitToClusterMap, pandora::ClusterList &matchedClusters, const pandora::Cluster *&pBestMatchedCluster) const |
Get the list of the relevant clusters and the address of the single best matched cluster. More... | |
void | GetFragmentOverlapResult (const pandora::CartesianPointVector &projectedPositions, const pandora::CaloHitList &matchedHits, const pandora::ClusterList &matchedClusters, FragmentOverlapResult &fragmentOverlapResult) const |
Get the populated fragment overlap result. More... | |
bool | CheckMatchedClusters (const pandora::CartesianPointVector &projectedPositions, const pandora::ClusterList &matchedClusters) const |
Whether the matched clusters are consistent with the projected positions. More... | |
bool | CheckOverlapResult (const FragmentOverlapResult &overlapResult) const |
Whether the matched clusters and hits pass the algorithm quality cuts. More... | |
void | ExamineTensor () |
Examine contents of tensor, collect together best-matching 2D particles and modify clusters as required. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
virtual void | PreparationStep () |
Perform any preparatory steps required, e.g. caching expensive fit results for clusters. More... | |
virtual void | PreparationStep (pandora::ClusterList &clusterList) |
Preparation step for a specific cluster list. More... | |
virtual void | TidyUp () |
Tidy member variables in derived class. More... | |
void | AddToSlidingFitCache (const pandora::Cluster *const pCluster) |
Add a new sliding fit result, for the specified cluster, to the algorithm cache. More... | |
void | RemoveFromSlidingFitCache (const pandora::Cluster *const pCluster) |
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache. More... | |
virtual void | SelectAllInputClusters () |
Select a subset of input clusters for processing in this algorithm. More... | |
Protected Attributes | |
std::string | m_reclusteringAlgorithmName |
Name of daughter algorithm to use for cluster re-building. More... | |
TensorToolVector | m_algorithmToolVector |
The algorithm tool list. More... | |
unsigned int | m_nMaxTensorToolRepeats |
The maximum number of repeat loops over tensor tools. More... | |
float | m_minXOverlap |
requirement on minimum X overlap for associated clusters More... | |
float | m_minXOverlapFraction |
requirement on minimum X overlap fraction for associated clusters More... | |
float | m_maxPointDisplacementSquared |
maximum allowed distance (squared) between projected points and associated hits More... | |
float | m_minMatchedSamplingPointFraction |
minimum fraction of matched sampling points More... | |
unsigned int | m_minMatchedHits |
minimum number of matched calo hits 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... | |
const pandora::ClusterList * | m_pInputClusterListU |
Address of the input cluster list U. More... | |
const pandora::ClusterList * | m_pInputClusterListV |
Address of the input cluster list V. More... | |
const pandora::ClusterList * | m_pInputClusterListW |
Address of the input cluster list W. More... | |
pandora::ClusterList | m_clusterListU |
The selected modified cluster list U. More... | |
pandora::ClusterList | m_clusterListV |
The selected modified cluster list V. More... | |
pandora::ClusterList | m_clusterListW |
The selected modified cluster list W. More... | |
TensorType | m_overlapTensor |
The overlap tensor. More... | |
ThreeDTrackFragmentsAlgorithm class.
Definition at line 30 of file ThreeDTrackFragmentsAlgorithm.h.
|
protected |
Definition at line 139 of file ThreeDTrackFragmentsAlgorithm.h.
|
protected |
Definition at line 66 of file ThreeDTrackFragmentsAlgorithm.h.
|
protected |
Definition at line 143 of file ThreeDTrackFragmentsAlgorithm.h.
|
inherited |
Definition at line 45 of file ThreeDBaseAlgorithm.h.
lar_content::ThreeDTrackFragmentsAlgorithm::ThreeDTrackFragmentsAlgorithm | ( | ) |
Default constructor.
Definition at line 21 of file ThreeDTrackFragmentsAlgorithm.cc.
|
protectedinherited |
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
pCluster | address of the relevant cluster |
Referenced by UpdateForNewCluster().
|
protectedvirtual |
Calculate cluster overlap result and store in tensor.
pClusterU | address of U view cluster |
pClusterV | address of V view cluster |
pClusterW | address of W view cluster |
Implements lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
protected |
Calculate overlap result for track fragment candidate consisting of two sliding fit results and a list of available clusters.
fitResult1 | the first sliding fit result |
fitResult2 | the second sliding fit result |
inputClusterList | the input cluster list |
pBestMatchedCluster | to receive the address of the best matched cluster |
fragmentOverlapResult | to receive the populated fragment overlap result |
|
protected |
Whether the matched clusters are consistent with the projected positions.
projectedPositions | the list of projected positions |
matchedClusters | the list of matched clusters |
Definition at line 543 of file ThreeDTrackFragmentsAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClusterBoundingBox(), max, and min.
Referenced by PerformMainLoop().
|
protected |
Whether the matched clusters and hits pass the algorithm quality cuts.
fragmentOverlapResult | the fragment overlap result |
Definition at line 598 of file ThreeDTrackFragmentsAlgorithm.cc.
References lar_content::FragmentOverlapResult::GetFragmentCaloHitList(), lar_content::TrackOverlapResult::GetMatchedFraction(), m_minMatchedHits, and m_minMatchedSamplingPointFraction.
Referenced by PerformMainLoop().
|
virtualinherited |
Create particles using findings from recent algorithm processing.
protoParticleVector | the proto particle vector |
whether | particles were created |
|
protectedvirtual |
Examine contents of tensor, collect together best-matching 2D particles and modify clusters as required.
Implements lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
Definition at line 612 of file ThreeDTrackFragmentsAlgorithm.cc.
References m_algorithmToolVector, m_nMaxTensorToolRepeats, and lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_overlapTensor.
|
inherited |
Get a sliding fit result from the algorithm cache.
pCluster | address of the relevant cluster |
Referenced by PerformMainLoop().
|
inherited |
Get the name of the u cluster list.
|
inherited |
Get the name of the v cluster list.
|
inherited |
Get the name of the w cluster list.
|
protected |
Get the populated fragment overlap result.
projectedPositions | the list of projected positions |
matchedHits | the list of matched hits |
matchedClusters | the list of matched clusters |
fragmentOverlapResult | to receive the populated fragment overlap result |
Definition at line 510 of file ThreeDTrackFragmentsAlgorithm.cc.
References f, m_maxPointDisplacementSquared, max, and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by PerformMainLoop().
|
inherited |
Get the input u cluster list.
Referenced by PerformMainLoop().
|
inherited |
Get the input v cluster list.
Referenced by PerformMainLoop().
|
inherited |
Get the input w cluster list.
Referenced by PerformMainLoop().
|
protected |
Get the list of the relevant clusters and the address of the single best matched cluster.
matchedHits | the list of matched calo hits |
hitToClusterMap | the hit to cluster map |
matchedClusters | to receive the list of matched clusters |
pBestMatchedCluster | to receive the address of the single best matched cluster |
Definition at line 460 of file ThreeDTrackFragmentsAlgorithm.cc.
References f, and lar_content::LArClusterHelper::SortByNHits().
Referenced by PerformMainLoop().
|
protected |
Get the list of hits associated with the projected positions and a useful hit to cluster map.
inputClusterList | the input cluster list |
projectedPositions | the list of projected positions |
hitToClusterMap | to receive the hit to cluster map |
matchedCaloHits | to receive the list of associated calo hits |
Definition at line 409 of file ThreeDTrackFragmentsAlgorithm.cc.
References f, m_maxPointDisplacementSquared, max, and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by PerformMainLoop().
|
protected |
Get the list of projected positions, in the third view, corresponding to a pair of sliding fit results.
fitResult1 | the first sliding fit result |
fitResult2 | the second sliding fit result |
projectedPositions | to receive the list of projected positions |
Definition at line 268 of file ThreeDTrackFragmentsAlgorithm.cc.
References f, lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArClusterHelper::GetClusterSpanX(), lar_content::TwoDSlidingFitResult::GetFitSegment(), lar_content::TwoDSlidingFitResult::GetGlobalFitProjection(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), lar_content::TwoDSlidingFitResult::GetLocalPosition(), lar_content::TwoDSlidingFitResult::GetTransverseProjection(), lar_content::LArGeometryHelper::GetWireZPitch(), m_minXOverlap, m_minXOverlapFraction, max, lar_content::LArGeometryHelper::MergeTwoPositions(), lar_content::LArGeometryHelper::MergeTwoPositions3D(), min, lar_content::LArGeometryHelper::ProjectPosition(), and x.
Referenced by PerformMainLoop().
|
inherited |
Get the selected u cluster list.
|
inherited |
Get the selected v cluster list.
|
inherited |
Get the selected w cluster list.
|
inherited |
Get the layer window for the sliding linear fits.
|
virtualinherited |
Merge clusters together.
clusterMergeMap | the cluster merge map |
|
virtualinherited |
Make a cluster split.
splitPosition | the split position |
pCurrentCluster | the cluster to split |
pLowXCluster | to receive the low x cluster |
pHighXCluster | to receive the high x cluster |
|
virtualinherited |
Make cluster splits.
splitPositionMap | the split position map |
|
protectedvirtual |
Main loop over cluster combinations in order to populate the tensor. Responsible for calling CalculateOverlapResult.
Reimplemented from lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
Definition at line 118 of file ThreeDTrackFragmentsAlgorithm.cc.
References CalculateOverlapResult(), CheckMatchedClusters(), CheckOverlapResult(), f, lar_content::ThreeDTracksBaseAlgorithm< FragmentOverlapResult >::GetCachedSlidingFitResult(), lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::LArClusterHelper::GetClusterSpanX(), lar_content::FragmentOverlapResult::GetFragmentCaloHitList(), GetFragmentOverlapResult(), lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::GetInputClusterListU(), lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::GetInputClusterListV(), lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::GetInputClusterListW(), GetMatchedClusters(), GetMatchedHits(), lar_content::OverlapTensor< T >::GetOverlapResult(), GetProjectedPositions(), lar_content::TrackOverlapResult::IsInitialized(), lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListU, lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListV, lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListW, lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_overlapTensor, max, min, lar_content::OverlapTensor< T >::ReplaceOverlapResult(), lar_content::OverlapTensor< T >::SetOverlapResult(), and lar_content::LArClusterHelper::SortByNHits().
|
protectedvirtualinherited |
Perform any preparatory steps required, e.g. caching expensive fit results for clusters.
Reimplemented from lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
|
protectedvirtualinherited |
Preparation step for a specific cluster list.
clusterList | the cluster list |
|
protectedvirtual |
Reimplemented from lar_content::ThreeDTracksBaseAlgorithm< FragmentOverlapResult >.
Definition at line 634 of file ThreeDTrackFragmentsAlgorithm.cc.
References m_algorithmToolVector, m_maxPointDisplacementSquared, m_minMatchedHits, m_minMatchedSamplingPointFraction, m_minXOverlap, m_minXOverlapFraction, m_nMaxTensorToolRepeats, m_reclusteringAlgorithmName, and lar_content::ThreeDTracksBaseAlgorithm< T >::ReadSettings().
void lar_content::ThreeDTrackFragmentsAlgorithm::RebuildClusters | ( | const pandora::ClusterList & | rebuildList, |
pandora::ClusterList & | newClusters | ||
) | const |
Rebuild clusters after fragmentation.
rebuildList | the list of clusters containing hits to be rebuilt |
newClusters | the output list of clusters |
Definition at line 102 of file ThreeDTrackFragmentsAlgorithm.cc.
References m_reclusteringAlgorithmName.
Referenced by lar_content::ClearTrackFragmentsTool::RebuildClusters().
|
protectedinherited |
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache.
pCluster | address of the relevant cluster |
|
virtualinherited |
Update tensor to remove all elements that have been added to pfos and so are unavailable.
|
protectedvirtualinherited |
Select a subset of input clusters for processing in this algorithm.
|
virtualinherited |
Select a subset of input clusters for processing in this algorithm.
pInputClusterList | address of an input cluster list |
selectedClusterList | to receive the selected cluster list |
Implements lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
|
virtualinherited |
Calculate Pfo properties from proto particle.
protoParticle | the input proto particle |
pfoParameters | the output pfo parameters |
Implements lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
|
staticinherited |
Sort split position cartesian vectors by increasing x coordinate.
lhs | the first cartesian vector |
rhs | the second cartesian vector |
|
protectedvirtualinherited |
Tidy member variables in derived class.
Reimplemented from lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
|
virtual |
Update to reflect addition of a new cluster to the problem space.
pNewCluster | address of the new cluster |
Reimplemented from lar_content::ThreeDTracksBaseAlgorithm< FragmentOverlapResult >.
Definition at line 33 of file ThreeDTrackFragmentsAlgorithm.cc.
References lar_content::ThreeDTracksBaseAlgorithm< FragmentOverlapResult >::AddToSlidingFitCache(), CalculateOverlapResult(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListU, lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListV, lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >::m_clusterListW, and lar_content::LArClusterHelper::SortByNHits().
Referenced by lar_content::ClearTrackFragmentsTool::UpdateTensor().
|
virtualinherited |
Update to reflect cluster deletion.
pDeletedCluster | address of the deleted cluster |
Reimplemented from lar_content::ThreeDBaseAlgorithm< FragmentOverlapResult >.
|
protected |
The algorithm tool list.
Definition at line 144 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by ExamineTensor(), and ReadSettings().
|
protectedinherited |
The selected modified cluster list U.
Definition at line 196 of file ThreeDBaseAlgorithm.h.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
protectedinherited |
The selected modified cluster list V.
Definition at line 197 of file ThreeDBaseAlgorithm.h.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
protectedinherited |
The selected modified cluster list W.
Definition at line 198 of file ThreeDBaseAlgorithm.h.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
protected |
maximum allowed distance (squared) between projected points and associated hits
Definition at line 150 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by GetFragmentOverlapResult(), GetMatchedHits(), and ReadSettings().
|
protectedinherited |
The min number of hits in base cluster selection method.
Definition at line 121 of file ThreeDTracksBaseAlgorithm.h.
|
protectedinherited |
The min length (squared) in base cluster selection method.
Definition at line 122 of file ThreeDTracksBaseAlgorithm.h.
|
protected |
minimum number of matched calo hits
Definition at line 152 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by CheckOverlapResult(), and ReadSettings().
|
protected |
minimum fraction of matched sampling points
Definition at line 151 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by CheckOverlapResult(), and ReadSettings().
|
protected |
requirement on minimum X overlap for associated clusters
Definition at line 148 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by GetProjectedPositions(), and ReadSettings().
|
protected |
requirement on minimum X overlap fraction for associated clusters
Definition at line 149 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by GetProjectedPositions(), and ReadSettings().
|
protected |
The maximum number of repeat loops over tensor tools.
Definition at line 146 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by ExamineTensor(), and ReadSettings().
|
protectedinherited |
The overlap tensor.
Definition at line 200 of file ThreeDBaseAlgorithm.h.
Referenced by ExamineTensor(), and PerformMainLoop().
|
protectedinherited |
Address of the input cluster list U.
Definition at line 192 of file ThreeDBaseAlgorithm.h.
|
protectedinherited |
Address of the input cluster list V.
Definition at line 193 of file ThreeDBaseAlgorithm.h.
|
protectedinherited |
Address of the input cluster list W.
Definition at line 194 of file ThreeDBaseAlgorithm.h.
|
protected |
Name of daughter algorithm to use for cluster re-building.
Definition at line 141 of file ThreeDTrackFragmentsAlgorithm.h.
Referenced by ReadSettings(), and RebuildClusters().
|
protectedinherited |
The sliding fit result map.
Definition at line 119 of file ThreeDTracksBaseAlgorithm.h.
|
protectedinherited |
The layer window for the sliding linear fits.
Definition at line 118 of file ThreeDTracksBaseAlgorithm.h.