LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
ThreeViewTrackFragmentsAlgorithm class. More...
#include "ThreeViewTrackFragmentsAlgorithm.h"
Public Types | |
typedef NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > > | BaseAlgorithm |
typedef ThreeViewMatchingControl< FragmentOverlapResult > | MatchingType |
Public Member Functions | |
ThreeViewTrackFragmentsAlgorithm () | |
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 | PrepareInputClusters (pandora::ClusterList &preparedClusterList) |
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results. More... | |
virtual void | SetPfoParticleId (PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const |
Set pfo particle id. More... | |
const std::string & | GetClusterListName (const pandora::HitType hitType) const |
Get the cluster list name corresponding to a specified hit type. More... | |
const pandora::ClusterList & | GetInputClusterList (const pandora::HitType hitType) const |
Get the input cluster list corresponding to a specified hit type. More... | |
const pandora::ClusterList & | GetSelectedClusterList (const pandora::HitType hitType) const |
Get the selected cluster list corresponding to a specified hit type. More... | |
virtual bool | MakeClusterMerges (const ClusterMergeMap &clusterMergeMap) |
Merge clusters together. More... | |
virtual bool | CreateThreeDParticles (const ProtoParticleVector &protoParticleVector) |
Create particles using findings from recent algorithm processing. More... | |
virtual void | SetPfoParameters (const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const |
Set Pfo properties. 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 overlap container. 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 container. 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 | ExamineOverlapContainer () |
Examine contents of overlap container, collect together best-matching 2D particles and modify clusters as required. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
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 | TidyUp () |
Tidy member variables in derived class. More... | |
MatchingType & | GetMatchingControl () |
Get the matching control. More... | |
virtual void | SelectAllInputClusters () |
Select a subset of input clusters for processing in this algorithm. More... | |
virtual void | PrepareAllInputClusters () |
Perform any preparatory steps required, e.g. caching expensive fit results for clusters. 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... | |
MatchingType | m_matchingControl |
The matching control. More... | |
ThreeViewTrackFragmentsAlgorithm class.
Definition at line 31 of file ThreeViewTrackFragmentsAlgorithm.h.
typedef NViewTrackMatchingAlgorithm<ThreeViewMatchingControl<FragmentOverlapResult> > lar_content::ThreeViewTrackFragmentsAlgorithm::BaseAlgorithm |
Definition at line 34 of file ThreeViewTrackFragmentsAlgorithm.h.
|
protected |
Definition at line 142 of file ThreeViewTrackFragmentsAlgorithm.h.
|
protected |
Definition at line 69 of file ThreeViewTrackFragmentsAlgorithm.h.
|
inherited |
Definition at line 23 of file NViewMatchingAlgorithm.h.
|
protected |
Definition at line 146 of file ThreeViewTrackFragmentsAlgorithm.h.
lar_content::ThreeViewTrackFragmentsAlgorithm::ThreeViewTrackFragmentsAlgorithm | ( | ) |
Default constructor.
Definition at line 21 of file ThreeViewTrackFragmentsAlgorithm.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 container.
pCluster1 | address of cluster1 |
pCluster2 | address of cluster2 |
pCluster3 | address of cluster3 |
Implements lar_content::MatchingBaseAlgorithm.
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 556 of file ThreeViewTrackFragmentsAlgorithm.cc.
References f, and lar_content::LArClusterHelper::GetClusterBoundingBox().
Referenced by PerformMainLoop().
|
protected |
Whether the matched clusters and hits pass the algorithm quality cuts.
fragmentOverlapResult | the fragment overlap result |
Definition at line 611 of file ThreeViewTrackFragmentsAlgorithm.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 |
Definition at line 88 of file MatchingBaseAlgorithm.cc.
Referenced by lar_content::NViewDeltaRayMatchingAlgorithm< T >::CreatePfos(), lar_content::ClearRemnantsTool::CreateThreeDParticles(), lar_content::TwoViewClearTracksTool::CreateThreeDParticles(), lar_content::ClearLongitudinalTracksTool::CreateThreeDParticles(), lar_content::ClearTracksTool::CreateThreeDParticles(), lar_content::ClearTrackFragmentsTool::FindTrackFragments(), lar_content::SimpleShowersTool::Run(), lar_content::TwoViewSimpleTracksTool::Run(), lar_content::ConnectedRemnantsTool::Run(), lar_content::MopUpRemnantsTool::Run(), lar_content::MissingTrackTool::Run(), lar_content::MatchedEndPointsTool::Run(), lar_content::TracksCrossingGapsTool::Run(), lar_content::MissingTrackSegmentTool::Run(), lar_content::LongTracksTool::Run(), lar_content::TwoViewLongTracksTool::Run(), and lar_content::ClearShowersTool::Run().
|
protectedvirtual |
Examine contents of overlap container, collect together best-matching 2D particles and modify clusters as required.
Implements lar_content::MatchingBaseAlgorithm.
Definition at line 625 of file ThreeViewTrackFragmentsAlgorithm.cc.
References m_algorithmToolVector, and m_nMaxTensorToolRepeats.
|
inherited |
Get a sliding fit result from the algorithm cache.
pCluster | address of the relevant cluster |
Referenced by PerformMainLoop().
|
virtualinherited |
Get the cluster list name corresponding to a specified hit type.
hitType | the hit type |
Implements lar_content::MatchingBaseAlgorithm.
|
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 523 of file ThreeViewTrackFragmentsAlgorithm.cc.
References f, m_maxPointDisplacementSquared, and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by PerformMainLoop().
|
virtualinherited |
Get the input cluster list corresponding to a specified hit type.
hitType | the hit type |
Implements lar_content::MatchingBaseAlgorithm.
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 472 of file ThreeViewTrackFragmentsAlgorithm.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 418 of file ThreeViewTrackFragmentsAlgorithm.cc.
References f, m_maxPointDisplacementSquared, and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by PerformMainLoop().
|
protectedinherited |
Get the matching control.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
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 272 of file ThreeViewTrackFragmentsAlgorithm.cc.
References f, lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::LArClusterHelper::GetClusterHitType(), 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::GetWirePitch(), m_minXOverlap, m_minXOverlapFraction, lar_content::LArGeometryHelper::MergeTwoPositions(), lar_content::LArGeometryHelper::MergeTwoPositions3D(), lar_content::LArGeometryHelper::ProjectPosition(), and x.
Referenced by PerformMainLoop().
|
virtualinherited |
Get the selected cluster list corresponding to a specified hit type.
hitType | the hit type |
Implements lar_content::MatchingBaseAlgorithm.
Referenced by PerformMainLoop(), and UpdateForNewCluster().
|
inherited |
Get the layer window for the sliding linear fits.
|
virtualinherited |
Merge clusters together.
clusterMergeMap | the cluster merge map |
Definition at line 48 of file MatchingBaseAlgorithm.cc.
Referenced by lar_content::SplitShowersTool::ApplyChanges(), lar_content::ThreeDKinkBaseTool::ApplyChanges(), lar_content::TwoViewThreeDKinkTool::ApplyChanges(), lar_content::ConnectedRemnantsTool::Run(), and lar_content::MissingTrackSegmentTool::Run().
|
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 overlap container. Responsible for calling CalculateOverlapResult.
Reimplemented from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >.
Definition at line 118 of file ThreeViewTrackFragmentsAlgorithm.cc.
References CalculateOverlapResult(), CheckMatchedClusters(), CheckOverlapResult(), f, lar_content::NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetCachedSlidingFitResult(), lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::FragmentOverlapResult::GetFragmentCaloHitList(), GetFragmentOverlapResult(), lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetInputClusterList(), GetMatchedClusters(), GetMatchedHits(), lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetMatchingControl(), lar_content::OverlapTensor< T >::GetOverlapResult(), GetProjectedPositions(), lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetSelectedClusterList(), lar_content::TrackOverlapResult::IsInitialized(), 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.
Implements lar_content::MatchingBaseAlgorithm.
|
virtualinherited |
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.
preparedClusterList | to receive the prepared cluster list, non const so as to be able to modify input selected list |
Reimplemented from lar_content::MatchingBaseAlgorithm.
|
protectedvirtual |
Reimplemented from lar_content::NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >.
Definition at line 647 of file ThreeViewTrackFragmentsAlgorithm.cc.
References m_algorithmToolVector, m_maxPointDisplacementSquared, m_minMatchedHits, m_minMatchedSamplingPointFraction, m_minXOverlap, m_minXOverlapFraction, m_nMaxTensorToolRepeats, m_reclusteringAlgorithmName, and lar_content::NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::ReadSettings().
void lar_content::ThreeViewTrackFragmentsAlgorithm::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 103 of file ThreeViewTrackFragmentsAlgorithm.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 |
|
protectedvirtualinherited |
Select a subset of input clusters for processing in this algorithm.
Implements lar_content::MatchingBaseAlgorithm.
|
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 |
Reimplemented from lar_content::MatchingBaseAlgorithm.
|
virtualinherited |
Set Pfo properties.
protoParticle | the input proto particle |
pfoParameters | the output pfo parameters |
Definition at line 116 of file MatchingBaseAlgorithm.cc.
References f, and lar_content::ProtoParticle::m_clusterList.
|
virtualinherited |
Set pfo particle id.
pfoParameters | the output pfo parameters |
Reimplemented from lar_content::MatchingBaseAlgorithm.
|
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::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >.
|
virtual |
Update to reflect addition of a new cluster to the problem space.
pNewCluster | address of the new cluster |
Reimplemented from lar_content::NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >.
Definition at line 33 of file ThreeViewTrackFragmentsAlgorithm.cc.
References lar_content::NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::AddToSlidingFitCache(), CalculateOverlapResult(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetMatchingControl(), lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >::GetSelectedClusterList(), lar_content::ThreeViewMatchingControl< T >::m_clusterListU, lar_content::ThreeViewMatchingControl< T >::m_clusterListV, lar_content::ThreeViewMatchingControl< T >::m_clusterListW, and lar_content::LArClusterHelper::SortByNHits().
Referenced by lar_content::ClearTrackFragmentsTool::ProcessTensorElement().
|
virtualinherited |
Update to reflect cluster deletion.
pDeletedCluster | address of the deleted cluster |
Reimplemented from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > >.
|
protected |
The algorithm tool list.
Definition at line 147 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by ExamineOverlapContainer(), and ReadSettings().
|
protectedinherited |
The matching control.
Definition at line 53 of file NViewMatchingAlgorithm.h.
|
protected |
maximum allowed distance (squared) between projected points and associated hits
Definition at line 153 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by GetFragmentOverlapResult(), GetMatchedHits(), and ReadSettings().
|
protected |
minimum number of matched calo hits
Definition at line 155 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by CheckOverlapResult(), and ReadSettings().
|
protected |
minimum fraction of matched sampling points
Definition at line 154 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by CheckOverlapResult(), and ReadSettings().
|
protected |
requirement on minimum X overlap for associated clusters
Definition at line 151 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by GetProjectedPositions(), and ReadSettings().
|
protected |
requirement on minimum X overlap fraction for associated clusters
Definition at line 152 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by GetProjectedPositions(), and ReadSettings().
|
protected |
The maximum number of repeat loops over tensor tools.
Definition at line 149 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by ExamineOverlapContainer(), and ReadSettings().
|
protected |
Name of daughter algorithm to use for cluster re-building.
Definition at line 144 of file ThreeViewTrackFragmentsAlgorithm.h.
Referenced by ReadSettings(), and RebuildClusters().