LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::TwoViewDeltaRayMatchingAlgorithm Class Reference

TwoViewDeltaRayMatchingAlgorithm class. More...

#include "TwoViewDeltaRayMatchingAlgorithm.h"

Inheritance diagram for lar_content::TwoViewDeltaRayMatchingAlgorithm:
lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > > lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > > lar_content::MatchingBaseAlgorithm

Public Types

typedef NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > > BaseAlgorithm
 
typedef TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType MatrixType
 
typedef std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
 
typedef std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
 
typedef std::map< const pandora::Cluster *, pandora::ClusterList > ClusterProximityMap
 
typedef KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
 
typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
 
typedef std::vector< HitKDNode2DHitKDNode2DList
 
typedef std::vector< pandora::HitType > HitTypeVector
 
typedef TwoViewMatchingControl< TwoViewDeltaRayOverlapResultMatchingType
 

Public Member Functions

 TwoViewDeltaRayMatchingAlgorithm ()
 Default constructor. More...
 
const std::string & GetThirdViewClusterListName () const
 Get the name of the third view clusters. More...
 
const std::string & GetClusteringAlgName () const
 Get the name of the clustering algorithm to be used to recluster created delta ray remnants. More...
 
HitTypeVector GetHitTypeVector ()
 Obtain the HitTypeVector of input views. More...
 
const pandora::Cluster * GetCluster (const MatrixType::Element &element, const pandora::HitType hitType)
 Get the address of the given hit type cluster. More...
 
bool CreatePfo (const MatrixType::Element &element)
 Create delta ray pfos out of a given element, merging the third view clusters together and adding in any stray clusters. More...
 
void UpdateForThirdViewClusterModification (const pandora::Cluster *const pModifiedCluster, const bool isMuon)
 Update the matrix after a third view cluster modification - remove delta ray clusters and reassess the matching of cosmic ray clusters. More...
 
pandora::StatusCode GetMuonCluster (const pandora::PfoList &commonMuonPfoList, const pandora::HitType hitType, const pandora::Cluster *&pMuonCluster) const
 Return the cluster of the common cosmic ray pfo in a given view (function demands there to be only one common CR pfo) More...
 
pandora::StatusCode PerformThreeViewMatching (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
 To determine how well three clusters (one in each view) map onto one another expressing this in terms of a chi-squared like parameter. More...
 
pandora::StatusCode PerformThreeViewMatching (const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, float &chiSquaredSum, unsigned int &nSamplingPoints, unsigned int &nMatchedSamplingPoints, XOverlap &XOverlap) const
 To determine how well three clusters (one in each view) map onto one another expressing this in terms of a chi-squared like parameter. More...
 
pandora::StatusCode PerformThreeViewMatching (const pandora::CaloHitList &pCluster1, const pandora::CaloHitList &pCluster2, const pandora::CaloHitList &pCluster3, float &reducedChiSquared) const
 To determine how well three CaloHitLists (one in each view) map onto one another expressing this in terms of a chi-squared like parameter. More...
 
pandora::StatusCode PerformThreeViewMatching (const pandora::CaloHitList &clusterU, const pandora::CaloHitList &clusterV, const pandora::CaloHitList &clusterW, float &chiSquaredSum, unsigned int &nSamplingPoints, unsigned int &nMatchedSamplingPoints, XOverlap &XOverlap) const
 To determine how well three CaloHitLists (one for each view) map onto one another expressing this in terms of a chi-squared like parameter. More...
 
pandora::StatusCode ProjectMuonPositions (const pandora::HitType &thirdViewHitType, const pandora::ParticleFlowObject *const pParentMuon, pandora::CartesianPointVector &projectedPositions) const
 Use two views of a cosmic ray pfo to calculate projected positions in a given the third view. More...
 
pandora::StatusCode GetProjectedPositions (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::CartesianPointVector &projectedPositions) const
 Use two clusters from different views to calculate projected positions in the remaining third view. More...
 
pandora::StatusCode CollectHitsFromMuon (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pThirdViewCluster, const pandora::ParticleFlowObject *const pParentMuon, const float minDistanceFromMuon, const float maxDistanceToCollected, pandora::CaloHitList &collectedHits) const
 In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster. More...
 
void CollectHitsFromMuon (const pandora::CartesianVector &positionOnMuon, const pandora::CartesianVector &muonDirection, const pandora::Cluster *const pMuonCluster, const pandora::CartesianPointVector &deltaRayProjectedPositions, const float &minDistanceFromMuon, const float maxDistanceToCollected, pandora::CaloHitList &collectedHits) const
 In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster. More...
 
pandora::StatusCode ParameteriseMuon (const pandora::ParticleFlowObject *const pParentMuon, const pandora::Cluster *const pDeltaRayCluster, pandora::CartesianVector &positionOnMuon, pandora::CartesianVector &muonDirection) const
 Parameterise the projection of a cosmic ray track in order to avoid poor/sparse projections. More...
 
pandora::StatusCode ParameteriseMuon (const pandora::ParticleFlowObject *const pParentMuon, const pandora::CartesianPointVector &deltaRayProjectedPositions, const pandora::HitType hitType, pandora::CartesianVector &positionOnMuon, pandora::CartesianVector &muonDirection) const
 Parameterise the projection of a cosmic ray track in order to avoid poor/sparse projections. More...
 
void SplitMuonCluster (const std::string &clusterListName, const pandora::Cluster *const pMuonCluster, const pandora::CaloHitList &collectedHits, const pandora::Cluster *&pDeltaRayCluster) const
 Move a list of hits from a cosmic ray cluster into the given child delta ray cluster. More...
 
bool CreatePfos (ProtoParticleVector &protoParticleVector)
 Create delta ray pfos maxmising completeness by searching for and merging in any stray clusters. More...
 
void UpdateForNewClusters (const pandora::ClusterVector &newClusterVector, const pandora::PfoVector &pfoVector)
 Add a new cluster to algorithm ownership maps and, if it a delta ray cluster, to the underlying matches container (tensor/matrix) More...
 
void UpdateUponDeletion (const pandora::Cluster *const pDeletedCluster)
 Update to reflect cluster deletion. More...
 
void SelectInputClusters (const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
 Select a subset of input clusters for processing in this algorithm. More...
 
void PrepareInputClusters (pandora::ClusterList &preparedClusterList)
 Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results. More...
 
void UpdateForNewCluster (const pandora::Cluster *const pNewCluster)
 Update to reflect addition of a new cluster to the problem space. 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...
 
virtual void SetPfoParticleId (PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
 Set pfo particle id. More...
 

Protected Member Functions

void FillStrayClusterList (const pandora::HitType hitType)
 Fill the stray cluster list with clusters that do not pass the tensor threshold requirement. More...
 
void GetNearbyMuonPfos (const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::PfoList &nearbyMuonPfos) const
 Use the cluster proximity map to travel along paths of nearby clusters finding the cosmic ray clusters on which they terminate. More...
 
void GetClusterSpanX (const pandora::CaloHitList &caloHitList, float &xMin, float &xMax) const
 Calculate the xSpan of a list of CaloHits. More...
 
pandora::StatusCode GetClusterSpanZ (const pandora::CaloHitList &caloHitList, const float xMin, const float xMax, float &zMin, float &zMax) const
 Calculate the zSpan of a list of CaloHits in a specified x range. More...
 
void CollectStrayClusters (const pandora::Cluster *const pClusterToEnlarge, const float rangeMinX, const float rangeMaxX, pandora::ClusterList &collectedClusters)
 Collect the stray clusters that are close to a specified cluster and that lie within a given x range. More...
 
void AddInStrayClusters (const pandora::Cluster *const pClusterToEnlarge, const pandora::ClusterList &collectedClusters)
 Merge in the collected stray clusters of a given delta ray cluster. More...
 
void TidyUp ()
 Tidy member variables in derived class. More...
 
MatchingTypeGetMatchingControl ()
 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...
 
virtual void PerformMainLoop ()
 Main loop over cluster combinations in order to populate the overlap container. Responsible for calling CalculateOverlapResult. More...
 

Protected Attributes

std::string m_muonPfoListName
 The list of reconstructed cosmic ray pfos. More...
 
pandora::ClusterList m_strayClusterListU
 The list of U clusters that do not pass the tensor threshold requirement. More...
 
pandora::ClusterList m_strayClusterListV
 The list of V clusters that do not pass the tensor threshold requirement. More...
 
pandora::ClusterList m_strayClusterListW
 The list of W clusters that do not pass the tensor threshold requirement. More...
 
DeltaRayMatchingContainers m_deltaRayMatchingContainers
 The class of hit, cluster and pfo ownership and proximity maps. More...
 
float m_pseudoChi2Cut
 Pseudo chi2 cut for three view matching. More...
 
float m_xOverlapWindow
 The maximum allowed displacement in x position. More...
 
float m_minMatchedFraction
 The threshold matched fraction of sampling points for a good match. More...
 
unsigned int m_minMatchedPoints
 The threshold number of matched sampling points for a good match. More...
 
unsigned int m_minProjectedPositions
 The threshold number of projected points for a good projection. More...
 
float m_maxCosmicRayHitFraction
 The maximum allowed fraction of hits to be removed from the cosmic ray track. More...
 
float m_maxDistanceToCluster
 the maximum distance of a projected point to the cosmic ray cluster used when parameterising the cosmic ray cluster More...
 
float m_maxDistanceToReferencePoint
 the maximum distance of a projected point to the cosmic ray vertex used when parameterising the cosmic ray cluster More...
 
float m_strayClusterSeparation
 The maximum allowed separation of a stray cluster and a delta ray cluster for merge. More...
 
MatchingType m_matchingControl
 The matching control. More...
 

Private Types

typedef std::vector< DeltaRayMatrixTool * > MatrixToolVector
 

Private Member Functions

void CalculateOverlapResult (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3)
 Calculate cluster overlap result and store in container. More...
 
virtual bool DoesClusterPassTensorThreshold (const pandora::Cluster *const pCluster) const
 To check whether a given cluster meets the requirements to be added into the matching container (tensor/matrix) More...
 
pandora::StatusCode CalculateOverlapResult (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, TwoViewDeltaRayOverlapResult &overlapResult) const
 Calculate the overlap result for given pair of clusters. More...
 
void FindCommonMuonParents (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::PfoList &commonMuonPfoList) const
 Find the cosmic ray pfos that, in each view, lie close to the clusters of the matrix element. More...
 
void CollectThirdViewClusters (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::CartesianPointVector &projectedPositions, pandora::ClusterList &matchedClusters) const
 Collect the available and unavailable third view clusters that lie close to the projected delta ray hits. More...
 
const pandora::Cluster * GetBestMatchedCluster (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::PfoList &commonMuonPfoList, const pandora::ClusterList &matchedClusters, float &reducedChiSquared) const
 Determine the best matched third view cluster and calculate the reduced chi-squared value of the three cluster match. More...
 
void FormThirdViewCluster (const MatrixType::Element &element, ProtoParticle &protoParticle)
 Form the third view cluster by removing hits from cosmic ray clusters and merging the matched clusters where appropriate. More...
 
void MergeThirdView (const MatrixType::Element &element, const pandora::Cluster *const pSeedCluster)
 Starting with an input seed cluster, sequentially merge in matched clusters that retain a good reduced chi-squared. 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)
 

Private Attributes

std::string m_inputClusterListName
 The name of the cluster list in the view in which to project into. More...
 
std::string m_reclusteringAlgorithmName
 The name of the clustering algorithm to be used to recluster created delta ray remnants. More...
 
MatrixToolVector m_algorithmToolVector
 The algorithm tool vector. More...
 
unsigned int m_nMaxMatrixToolRepeats
 The maximum number of repeat loops over matrix tools. More...
 
unsigned int m_minClusterCaloHits
 The threshold number of hits for a cluster to be considered. More...
 
float m_maxDistanceFromPrediction
 The maximum distance of a matched cluster from the third view projection points. More...
 
float m_maxGoodMatchReducedChiSquared
 The maximum reduced chi squared value of a good 1:1:1 match. More...
 
float m_minDistanceFromMuon
 The minimum distance of a hit from the cosmic ray track required for removal. More...
 
float m_maxDistanceToCollected
 The maximim distance of a hit from the projected delta ray hits required for removal. More...
 

Detailed Description

Member Typedef Documentation

typedef std::map<const pandora::Cluster *, pandora::ClusterList> lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ClusterProximityMap
inherited

Definition at line 28 of file NViewDeltaRayMatchingAlgorithm.h.

typedef std::map<const pandora::Cluster *, const pandora::ParticleFlowObject *> lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ClusterToPfoMap
inherited

Definition at line 27 of file NViewDeltaRayMatchingAlgorithm.h.

typedef std::map<const pandora::CaloHit *, const pandora::Cluster *> lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::HitToClusterMap
inherited

Definition at line 26 of file NViewDeltaRayMatchingAlgorithm.h.

Constructor & Destructor Documentation

lar_content::TwoViewDeltaRayMatchingAlgorithm::TwoViewDeltaRayMatchingAlgorithm ( )

Default constructor.

Definition at line 24 of file TwoViewDeltaRayMatchingAlgorithm.cc.

24  :
31 {
32 }
unsigned int m_minClusterCaloHits
The threshold number of hits for a cluster to be considered.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
float m_maxDistanceFromPrediction
The maximum distance of a matched cluster from the third view projection points.
float m_maxDistanceToCollected
The maximim distance of a hit from the projected delta ray hits required for removal.
TFile f
Definition: plotHisto.C:6
float m_minDistanceFromMuon
The minimum distance of a hit from the cosmic ray track required for removal.

Member Function Documentation

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::AddInStrayClusters ( const pandora::Cluster *const  pClusterToEnlarge,
const pandora::ClusterList &  collectedClusters 
)
protectedinherited

Merge in the collected stray clusters of a given delta ray cluster.

Parameters
pClusterToEnlargethe delta ray cluster to enlarge
collectedClustersthe list of collected stray clusters
void lar_content::TwoViewDeltaRayMatchingAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::Cluster *const  pCluster3 
)
privatevirtual

Calculate cluster overlap result and store in container.

Parameters
pCluster1address of cluster1
pCluster2address of cluster2
pCluster3address of cluster3

Implements lar_content::MatchingBaseAlgorithm.

Referenced by DoesClusterPassTensorThreshold().

pandora::StatusCode lar_content::TwoViewDeltaRayMatchingAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
TwoViewDeltaRayOverlapResult overlapResult 
) const
private

Calculate the overlap result for given pair of clusters.

Parameters
pCluster1the cluster from the first input view
pCluster2the cluster from the second input view
overlapResultto receive the overlap result
Returns
statusCode, faster than throwing in regular use-cases
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::CollectHitsFromMuon ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::Cluster *const  pThirdViewCluster,
const pandora::ParticleFlowObject *const  pParentMuon,
const float  minDistanceFromMuon,
const float  maxDistanceToCollected,
pandora::CaloHitList &  collectedHits 
) const
inherited

In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster.

Parameters
pCluster1the address of a delta ray cluster in a view that is to go unmodified
pCluster2the address of a delta ray cluster in the other view that is to unmodified
pThirdViewClusterthe address of the delta ray cluster in the view in which the hit removal process will run
pParentMuonthe address of the parent cosmic ray pfo
minDistanceFromMuonthe minimum distance of a hit from the cosmic ray track required for removal
maxDistanceToCollectedthe maximim distance of a hit from the projected delta ray hits required for removal
collectedHitsthe list of hits to be removed from the cosmic ray
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good

Referenced by FormThirdViewCluster().

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::CollectHitsFromMuon ( const pandora::CartesianVector &  positionOnMuon,
const pandora::CartesianVector &  muonDirection,
const pandora::Cluster *const  pMuonCluster,
const pandora::CartesianPointVector &  deltaRayProjectedPositions,
const float &  minDistanceFromMuon,
const float  maxDistanceToCollected,
pandora::CaloHitList &  collectedHits 
) const
inherited

In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster.

Parameters
positionOnMuonthe parameterised cosmic ray position
muonDirectionthe parameterised cosmic ray direction
pMuonthe address of the parent cosmic ray pfo
deltaRayProjectedPositionsthe projected positions of the delta ray
minDistanceFromMuonthe minimum distance of a hit from the cosmic ray track required for removal
maxDistanceToCollectedthe maximim distance of a hit from the projected delta ray hits required for removal
collectedHitsthe list of hits to be removed from the cosmic ray
void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::CollectStrayClusters ( const pandora::Cluster *const  pClusterToEnlarge,
const float  rangeMinX,
const float  rangeMaxX,
pandora::ClusterList &  collectedClusters 
)
protectedinherited

Collect the stray clusters that are close to a specified cluster and that lie within a given x range.

Parameters
pClusterToEnlargethe specified cluster
rangeMinXthe minimum x coordinate of the region of interest
rangeMaxXthe maximum x coordinate of the region of interest
collectedClustersthe list of collected stray clusters
void lar_content::TwoViewDeltaRayMatchingAlgorithm::CollectThirdViewClusters ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::CartesianPointVector &  projectedPositions,
pandora::ClusterList &  matchedClusters 
) const
private

Collect the available and unavailable third view clusters that lie close to the projected delta ray hits.

Parameters
pCluster1the cluster from the first input view
pCluster2the cluster from the second input view
projectedPositionsthe projected positions of the matched cluster pair
matchedClustersthe output list of collected clusters

Definition at line 170 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References f, lar_content::LArMuonLeadingHelper::GetClosestDistance(), m_inputClusterListName, m_maxDistanceFromPrediction, m_maxGoodMatchReducedChiSquared, and lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching().

Referenced by DoesClusterPassTensorThreshold().

172 {
173  const ClusterList *pInputClusterList(nullptr);
174  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListName, pInputClusterList));
175 
176  if (!pInputClusterList || pInputClusterList->empty())
177  return;
178 
179  for (const Cluster *const pCluster : *pInputClusterList)
180  {
181  const float separation(LArMuonLeadingHelper::GetClosestDistance(pCluster, projectedPositions));
182 
183  if (separation > m_maxDistanceFromPrediction)
184  continue;
185 
186  float reducedChiSquared(0.f);
187  if (this->PerformThreeViewMatching(pCluster1, pCluster2, pCluster, reducedChiSquared) == STATUS_CODE_NOT_FOUND)
188  continue;
189 
190  if (reducedChiSquared > m_maxGoodMatchReducedChiSquared)
191  continue;
192 
193  matchedClusters.push_back(pCluster);
194  }
195 }
static float GetClosestDistance(const pandora::Cluster *const pCluster, const pandora::CartesianPointVector &cartesianPointVector)
Get closest distance between a specified cluster and list of positions.
std::string m_inputClusterListName
The name of the cluster list in the view in which to project into.
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
float m_maxDistanceFromPrediction
The maximum distance of a matched cluster from the third view projection points.
TFile f
Definition: plotHisto.C:6
pandora::StatusCode PerformThreeViewMatching(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
To determine how well three clusters (one in each view) map onto one another expressing this in terms...
bool lar_content::TwoViewDeltaRayMatchingAlgorithm::CreatePfo ( const MatrixType::Element &  element)

Create delta ray pfos out of a given element, merging the third view clusters together and adding in any stray clusters.

Parameters
elementthe matrix element
Returns
whether any pfos were created

Definition at line 241 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::CreatePfos(), FormThirdViewCluster(), and lar_content::ProtoParticle::m_clusterList.

242 {
243  ProtoParticle protoParticle;
244 
245  protoParticle.m_clusterList.push_back(protoParticleElement.GetCluster1());
246  protoParticle.m_clusterList.push_back(protoParticleElement.GetCluster2());
247 
248  const Cluster *const pBestMatchedCluster(protoParticleElement.GetOverlapResult().GetBestMatchedCluster());
249 
250  if (pBestMatchedCluster)
251  this->FormThirdViewCluster(protoParticleElement, protoParticle);
252 
253  ProtoParticleVector protoParticleVector({protoParticle});
254 
255  return (this->CreatePfos(protoParticleVector));
256 }
std::vector< ProtoParticle > ProtoParticleVector
void FormThirdViewCluster(const MatrixType::Element &element, ProtoParticle &protoParticle)
Form the third view cluster by removing hits from cosmic ray clusters and merging the matched cluster...
bool CreatePfos(ProtoParticleVector &protoParticleVector)
Create delta ray pfos maxmising completeness by searching for and merging in any stray clusters...

Create delta ray pfos maxmising completeness by searching for and merging in any stray clusters.

Parameters
protoParticleVectorthe proto particle vector
Returns
whether any pfos were created

Referenced by CreatePfo().

bool lar_content::MatchingBaseAlgorithm::CreateThreeDParticles ( const ProtoParticleVector protoParticleVector)
virtualinherited

Create particles using findings from recent algorithm processing.

Parameters
protoParticleVectorthe proto particle vector
whetherparticles were created

Definition at line 88 of file MatchingBaseAlgorithm.cc.

Referenced by lar_content::NViewDeltaRayMatchingAlgorithm< T >::CreatePfos(), lar_content::ClearRemnantsTool::CreateThreeDParticles(), lar_content::ClearTracksTool::CreateThreeDParticles(), lar_content::TwoViewClearTracksTool::CreateThreeDParticles(), lar_content::ClearLongitudinalTracksTool::CreateThreeDParticles(), lar_content::ClearTrackFragmentsTool::FindTrackFragments(), lar_content::MissingTrackTool::Run(), lar_content::MatchedEndPointsTool::Run(), lar_content::ConnectedRemnantsTool::Run(), lar_content::MopUpRemnantsTool::Run(), lar_content::SimpleShowersTool::Run(), lar_content::TwoViewSimpleTracksTool::Run(), lar_content::TracksCrossingGapsTool::Run(), lar_content::MissingTrackSegmentTool::Run(), lar_content::LongTracksTool::Run(), lar_content::TwoViewLongTracksTool::Run(), and lar_content::ClearShowersTool::Run().

89 {
90  bool particlesMade(false);
91  const PfoList *pPfoList(nullptr);
92  std::string pfoListName;
93  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pPfoList, pfoListName));
94 
95  for (const ProtoParticle &protoParticle : protoParticleVector)
96  {
97  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
98  this->SetPfoParameters(protoParticle, pfoParameters);
99 
100  const ParticleFlowObject *pPfo(nullptr);
101  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pPfo));
102  particlesMade = true;
103  }
104 
105  if (!pPfoList->empty())
106  {
107  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_outputPfoListName));
108  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_outputPfoListName));
109  }
110 
111  return particlesMade;
112 }
virtual void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Set Pfo properties.
std::string m_outputPfoListName
The output pfo list name.
bool lar_content::TwoViewDeltaRayMatchingAlgorithm::DoesClusterPassTensorThreshold ( const pandora::Cluster *const  pCluster) const
privatevirtual
void lar_content::TwoViewDeltaRayMatchingAlgorithm::ExamineOverlapContainer ( )
privatevirtual

Examine contents of overlap container, collect together best-matching 2D particles and modify clusters as required.

Implements lar_content::MatchingBaseAlgorithm.

Definition at line 403 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References m_algorithmToolVector, m_nMaxMatrixToolRepeats, and lar_content::DeltaRayMatrixTool::Run().

404 {
405  // Apply tools sequentially restarting if a change is made and ending if the tools finish or the restart limit is reached
406  unsigned int repeatCounter(0);
407 
408  for (auto toolIter = m_algorithmToolVector.begin(); toolIter != m_algorithmToolVector.end();)
409  {
410  DeltaRayMatrixTool *const pTool(*toolIter);
411  const bool repeatTools(pTool->Run(this, this->GetMatchingControl().GetOverlapMatrix()));
412 
413  toolIter = repeatTools ? m_algorithmToolVector.begin() : toolIter + 1;
414  repeatCounter = repeatTools ? repeatCounter + 1 : repeatCounter;
415 
416  if (repeatCounter > m_nMaxMatrixToolRepeats)
417  break;
418  }
419 }
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::FillStrayClusterList ( const pandora::HitType  hitType)
protectedinherited

Fill the stray cluster list with clusters that do not pass the tensor threshold requirement.

Parameters
hitTypethe hit type of the list to fill
void lar_content::TwoViewDeltaRayMatchingAlgorithm::FindCommonMuonParents ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
pandora::PfoList &  commonMuonPfoList 
) const
private

Find the cosmic ray pfos that, in each view, lie close to the clusters of the matrix element.

Parameters
pCluster1the cluster from the first input view
pCluster2the cluster from the second input view
commonMuonPfoListthe output list of common cosmic ray pfos

Definition at line 143 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetNearbyMuonPfos().

Referenced by DoesClusterPassTensorThreshold().

144 {
145  ClusterList consideredClusters1, consideredClusters2;
146  PfoList nearbyMuonPfos1, nearbyMuonPfos2;
147 
148  this->GetNearbyMuonPfos(pCluster1, consideredClusters1, nearbyMuonPfos1);
149 
150  if (nearbyMuonPfos1.empty())
151  return;
152 
153  this->GetNearbyMuonPfos(pCluster2, consideredClusters2, nearbyMuonPfos2);
154 
155  if (nearbyMuonPfos2.empty())
156  return;
157 
158  for (const ParticleFlowObject *const pNearbyMuon1 : nearbyMuonPfos1)
159  {
160  for (const ParticleFlowObject *const pNearbyMuon2 : nearbyMuonPfos2)
161  {
162  if (pNearbyMuon1 == pNearbyMuon2)
163  commonMuonPfoList.push_back(pNearbyMuon1);
164  }
165  }
166 }
void GetNearbyMuonPfos(const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::PfoList &nearbyMuonPfos) const
Use the cluster proximity map to travel along paths of nearby clusters finding the cosmic ray cluster...
void lar_content::TwoViewDeltaRayMatchingAlgorithm::FormThirdViewCluster ( const MatrixType::Element &  element,
ProtoParticle protoParticle 
)
private

Form the third view cluster by removing hits from cosmic ray clusters and merging the matched clusters where appropriate.

Parameters
elementthe matrix element
protoParticlethe output proto particle

Definition at line 260 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::CollectHitsFromMuon(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArPfoHelper::GetClusters(), GetThirdViewClusterListName(), lar_content::ProtoParticle::m_clusterList, m_maxDistanceToCollected, m_minDistanceFromMuon, MergeThirdView(), lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::SplitMuonCluster(), and UpdateForThirdViewClusterModification().

Referenced by CreatePfo().

261 {
262  const PfoList &commonMuonPfoList(element.GetOverlapResult().GetCommonMuonPfoList());
263  const Cluster *const pBestMatchedCluster(element.GetOverlapResult().GetBestMatchedCluster());
264  const HitType thirdViewHitType(LArClusterHelper::GetClusterHitType(pBestMatchedCluster));
265  const ParticleFlowObject *pMatchedMuonPfo(nullptr);
266 
267  for (const ParticleFlowObject *const pMuonPfo : commonMuonPfoList)
268  {
269  ClusterList muonClusterList;
270  LArPfoHelper::GetClusters(pMuonPfo, thirdViewHitType, muonClusterList);
271 
272  if (std::find(muonClusterList.begin(), muonClusterList.end(), pBestMatchedCluster) != muonClusterList.end())
273  pMatchedMuonPfo = pMuonPfo;
274  }
275 
276  const Cluster *pThirdViewCluster(pMatchedMuonPfo ? nullptr : pBestMatchedCluster);
277 
278  if (pMatchedMuonPfo)
279  {
280  CaloHitList deltaRayHitList;
281 
282  if (this->CollectHitsFromMuon(element.GetCluster1(), element.GetCluster2(), nullptr, pMatchedMuonPfo, m_minDistanceFromMuon,
283  m_maxDistanceToCollected, deltaRayHitList) == STATUS_CODE_SUCCESS)
284  {
285  this->SplitMuonCluster(this->GetThirdViewClusterListName(), pBestMatchedCluster, deltaRayHitList, pThirdViewCluster);
286  this->UpdateForThirdViewClusterModification(pBestMatchedCluster, true);
287  }
288  else
289  {
290  pThirdViewCluster = element.GetOverlapResult().GetBestMatchedAvailableCluster();
291  }
292  }
293 
294  if (!pThirdViewCluster)
295  return;
296 
297  this->UpdateForThirdViewClusterModification(pThirdViewCluster, false);
298  this->MergeThirdView(element, pThirdViewCluster);
299 
300  protoParticle.m_clusterList.push_back(pThirdViewCluster);
301 }
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
pandora::StatusCode CollectHitsFromMuon(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pThirdViewCluster, const pandora::ParticleFlowObject *const pParentMuon, const float minDistanceFromMuon, const float maxDistanceToCollected, pandora::CaloHitList &collectedHits) const
In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster...
const std::string & GetThirdViewClusterListName() const
Get the name of the third view clusters.
float m_maxDistanceToCollected
The maximim distance of a hit from the projected delta ray hits required for removal.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
float m_minDistanceFromMuon
The minimum distance of a hit from the cosmic ray track required for removal.
void MergeThirdView(const MatrixType::Element &element, const pandora::Cluster *const pSeedCluster)
Starting with an input seed cluster, sequentially merge in matched clusters that retain a good reduce...
void SplitMuonCluster(const std::string &clusterListName, const pandora::Cluster *const pMuonCluster, const pandora::CaloHitList &collectedHits, const pandora::Cluster *&pDeltaRayCluster) const
Move a list of hits from a cosmic ray cluster into the given child delta ray cluster.
HitType
Definition: HitType.h:12
void UpdateForThirdViewClusterModification(const pandora::Cluster *const pModifiedCluster, const bool isMuon)
Update the matrix after a third view cluster modification - remove delta ray clusters and reassess th...
const Cluster * lar_content::TwoViewDeltaRayMatchingAlgorithm::GetBestMatchedCluster ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::PfoList &  commonMuonPfoList,
const pandora::ClusterList &  matchedClusters,
float &  reducedChiSquared 
) const
private

Determine the best matched third view cluster and calculate the reduced chi-squared value of the three cluster match.

Parameters
pCluster1the cluster from the first input view
pCluster2the cluster from the second input view
commonMuonPfoListthe list of common cosmic ray pfos
matchedClustersthe list of third view matched clusters
reducedChiSquaredto receive the calculated reduced chi-squared value
Returns
the address of the best matched third view cluster

Definition at line 199 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArPfoHelper::GetClusters(), and lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching().

Referenced by DoesClusterPassTensorThreshold(), and UpdateForThirdViewClusterModification().

201 {
202  const Cluster *pBestMatchedCluster(nullptr);
203 
204  if (matchedClusters.empty())
205  return pBestMatchedCluster;
206 
207  const HitType thirdViewHitType(LArClusterHelper::GetClusterHitType(matchedClusters.front()));
208  ClusterList muonClusterList;
209 
210  for (const ParticleFlowObject *const pMuonPfo : commonMuonPfoList)
211  LArPfoHelper::GetClusters(pMuonPfo, thirdViewHitType, muonClusterList);
212 
213  unsigned int highestNHits(0);
214 
215  for (const Cluster *const pMatchedCluster : matchedClusters)
216  {
217  if (!pMatchedCluster->IsAvailable())
218  {
219  if (std::find(muonClusterList.begin(), muonClusterList.end(), pMatchedCluster) == muonClusterList.end())
220  continue;
221  }
222 
223  if (pMatchedCluster->GetNCaloHits() > highestNHits)
224  {
225  highestNHits = pMatchedCluster->GetNCaloHits();
226  pBestMatchedCluster = pMatchedCluster;
227  }
228  }
229 
230  if (!pBestMatchedCluster)
231  return pBestMatchedCluster;
232 
233  if (this->PerformThreeViewMatching(pCluster1, pCluster2, pBestMatchedCluster, reducedChiSquared) == STATUS_CODE_NOT_FOUND)
234  throw StatusCodeException(STATUS_CODE_FAILURE);
235 
236  return pBestMatchedCluster;
237 }
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
pandora::StatusCode PerformThreeViewMatching(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
To determine how well three clusters (one in each view) map onto one another expressing this in terms...
HitType
Definition: HitType.h:12
const Cluster * lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster ( const MatrixType::Element &  element,
const pandora::HitType  hitType 
)

Get the address of the given hit type cluster.

Parameters
hitTypehit type of the required cluster
Returns
address of the required cluster

Definition at line 55 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetMatchingControl().

Referenced by lar_content::TwoViewCosmicRayRemovalTool::CreateSeed(), lar_content::TwoViewCosmicRayRemovalTool::GrowSeed(), lar_content::TwoViewCosmicRayRemovalTool::IsBestElement(), lar_content::TwoViewCosmicRayRemovalTool::IsContaminated(), lar_content::TwoViewCosmicRayRemovalTool::IsMuonEndpoint(), lar_content::TwoViewCosmicRayRemovalTool::PassElementChecks(), lar_content::TwoViewCosmicRayRemovalTool::ProjectDeltaRayPositions(), lar_content::TwoViewCosmicRayRemovalTool::RemoveCosmicRayHits(), and lar_content::TwoViewCosmicRayRemovalTool::SplitDeltaRayCluster().

56 {
57  const unsigned int hitTypeIndex(this->GetMatchingControl().GetHitTypeIndex(hitType));
58 
59  if ((hitTypeIndex != 1) && (hitTypeIndex != 2))
60  return element.GetOverlapResult().GetBestMatchedAvailableCluster();
61 
62  return hitTypeIndex == 1 ? element.GetCluster1() : element.GetCluster2();
63 }
const std::string & lar_content::TwoViewDeltaRayMatchingAlgorithm::GetClusteringAlgName ( ) const
inline

Get the name of the clustering algorithm to be used to recluster created delta ray remnants.

Returns
the clustering algorithm name

Definition at line 188 of file TwoViewDeltaRayMatchingAlgorithm.h.

References m_reclusteringAlgorithmName.

Referenced by lar_content::TwoViewCosmicRayRemovalTool::ReclusterRemnant().

189 {
191 }
std::string m_reclusteringAlgorithmName
The name of the clustering algorithm to be used to recluster created delta ray remnants.
const std::string& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetClusterListName ( const pandora::HitType  hitType) const
virtualinherited

Get the cluster list name corresponding to a specified hit type.

Parameters
hitTypethe hit type
Returns
the cluster list name

Implements lar_content::MatchingBaseAlgorithm.

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetClusterSpanX ( const pandora::CaloHitList &  caloHitList,
float &  xMin,
float &  xMax 
) const
protectedinherited

Calculate the xSpan of a list of CaloHits.

Parameters
caloHitListthe input list of CaloHits
xMinthe output minimum x coordinate
xMaxthe output maximum x coordinate
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetClusterSpanZ ( const pandora::CaloHitList &  caloHitList,
const float  xMin,
const float  xMax,
float &  zMin,
float &  zMax 
) const
protectedinherited

Calculate the zSpan of a list of CaloHits in a specified x range.

Parameters
caloHitListthe input list of CaloHits
xMinthe minimum x coordinate of the region of interest
xMaxthe maximum x coordinate of the region of interest
zMinthe output minimum z coordinate
zMaxthe output maximum z coordinate
TwoViewDeltaRayMatchingAlgorithm::HitTypeVector lar_content::TwoViewDeltaRayMatchingAlgorithm::GetHitTypeVector ( )

Obtain the HitTypeVector of input views.

Returns
the HitTypeVector of input views

Definition at line 36 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetMatchingControl().

Referenced by lar_content::TwoViewCosmicRayRemovalTool::IsMuonEndpoint(), and lar_content::TwoViewCosmicRayRemovalTool::RemoveCosmicRayHits().

37 {
38  HitTypeVector hitTypeVector;
39 
40  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
41  {
42  const unsigned int hitTypeIndex(this->GetMatchingControl().GetHitTypeIndex(hitType));
43 
44  if ((hitTypeIndex != 1) && (hitTypeIndex != 2))
45  continue;
46 
47  hitTypeVector.push_back(hitType);
48  }
49 
50  return hitTypeVector;
51 }
HitType
Definition: HitType.h:12
const pandora::ClusterList& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetInputClusterList ( const pandora::HitType  hitType) const
virtualinherited

Get the input cluster list corresponding to a specified hit type.

Parameters
hitTypethe hit type
Returns
the input cluster list

Implements lar_content::MatchingBaseAlgorithm.

pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetMuonCluster ( const pandora::PfoList &  commonMuonPfoList,
const pandora::HitType  hitType,
const pandora::Cluster *&  pMuonCluster 
) const
inherited

Return the cluster of the common cosmic ray pfo in a given view (function demands there to be only one common CR pfo)

Parameters
commonMuonPfoListthe element's list of common muon pfos
hitTypethe specified view
pMuonClusterthe output address of the cluster
Returns
a status code reflecting if one and only one cosmic ray cluster was found
void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetNearbyMuonPfos ( const pandora::Cluster *const  pCluster,
pandora::ClusterList &  consideredClusters,
pandora::PfoList &  nearbyMuonPfos 
) const
protectedinherited

Use the cluster proximity map to travel along paths of nearby clusters finding the cosmic ray clusters on which they terminate.

Parameters
pClusterthe address of the input cluster
consideredClustersthe list of investigated clusters
nearbyMuonPfosthe output list of the cosmic ray pfos to which the nearby cosmic ray clusters belong

Referenced by FindCommonMuonParents().

pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetProjectedPositions ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
pandora::CartesianPointVector &  projectedPositions 
) const
inherited

Use two clusters from different views to calculate projected positions in the remaining third view.

Parameters
pCluster1the address of the first cluster
pCluster2the address of the second cluster
projectedPositionsthe output projected positions
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good

Referenced by DoesClusterPassTensorThreshold().

const pandora::ClusterList& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetSelectedClusterList ( const pandora::HitType  hitType) const
virtualinherited

Get the selected cluster list corresponding to a specified hit type.

Parameters
hitTypethe hit type
Returns
the selected cluster list

Implements lar_content::MatchingBaseAlgorithm.

const std::string & lar_content::TwoViewDeltaRayMatchingAlgorithm::GetThirdViewClusterListName ( ) const
inline

Get the name of the third view clusters.

Returns
the third view cluster list name

Definition at line 181 of file TwoViewDeltaRayMatchingAlgorithm.h.

References m_inputClusterListName.

Referenced by FormThirdViewCluster(), and MergeThirdView().

182 {
183  return m_inputClusterListName;
184 }
std::string m_inputClusterListName
The name of the cluster list in the view in which to project into.
bool lar_content::MatchingBaseAlgorithm::MakeClusterMerges ( const ClusterMergeMap clusterMergeMap)
virtualinherited

Merge clusters together.

Parameters
clusterMergeMapthe cluster merge map
Returns
whether changes to the overlap container have been made

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().

49 {
50  ClusterSet deletedClusters;
51 
52  ClusterList parentClusters;
53  for (const auto &mapEntry : clusterMergeMap)
54  parentClusters.push_back(mapEntry.first);
55  parentClusters.sort(LArClusterHelper::SortByNHits);
56 
57  for (const Cluster *const pParentCluster : parentClusters)
58  {
59  const HitType hitType(LArClusterHelper::GetClusterHitType(pParentCluster));
60  const std::string &clusterListName(this->GetClusterListName(hitType));
61 
62  if (!((TPC_VIEW_U == hitType) || (TPC_VIEW_V == hitType) || (TPC_VIEW_W == hitType)))
63  throw StatusCodeException(STATUS_CODE_FAILURE);
64 
65  ClusterList daughterClusters(clusterMergeMap.at(pParentCluster));
66  daughterClusters.sort(LArClusterHelper::SortByNHits);
67 
68  for (const Cluster *const pDaughterCluster : daughterClusters)
69  {
70  if (deletedClusters.count(pParentCluster) || deletedClusters.count(pDaughterCluster))
71  throw StatusCodeException(STATUS_CODE_FAILURE);
72 
73  this->UpdateUponDeletion(pDaughterCluster);
74  this->UpdateUponDeletion(pParentCluster);
75  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=,
76  PandoraContentApi::MergeAndDeleteClusters(*this, pParentCluster, pDaughterCluster, clusterListName, clusterListName));
77 
78  this->UpdateForNewCluster(pParentCluster);
79  deletedClusters.insert(pDaughterCluster);
80  }
81  }
82 
83  return !(deletedClusters.empty());
84 }
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)=0
Update to reflect cluster deletion.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
virtual const std::string & GetClusterListName(const pandora::HitType hitType) const =0
Get the cluster list name corresponding to a specified hit type.
virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)=0
Update to reflect addition of a new cluster to the problem space.
HitType
Definition: HitType.h:12
void lar_content::TwoViewDeltaRayMatchingAlgorithm::MergeThirdView ( const MatrixType::Element &  element,
const pandora::Cluster *const  pSeedCluster 
)
private

Starting with an input seed cluster, sequentially merge in matched clusters that retain a good reduced chi-squared.

Parameters
elementthe matrix element
pSeedClusterthe address of the input seed cluster

Definition at line 305 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References GetThirdViewClusterListName(), m_maxGoodMatchReducedChiSquared, lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching(), and UpdateForThirdViewClusterModification().

Referenced by FormThirdViewCluster().

306 {
307  CaloHitList caloHitList1, caloHitList2;
308  element.GetCluster1()->GetOrderedCaloHitList().FillCaloHitList(caloHitList1);
309  element.GetCluster2()->GetOrderedCaloHitList().FillCaloHitList(caloHitList2);
310 
311  // ATTN: Need copy as original will change throughout function
312  ClusterList matchedClusters(element.GetOverlapResult().GetMatchedClusterList());
313 
314  ClusterSet checkedClusters;
315 
316  if (std::find(matchedClusters.begin(), matchedClusters.end(), pSeedCluster) != matchedClusters.end())
317  checkedClusters.insert(pSeedCluster);
318 
319  while (checkedClusters.size() != matchedClusters.size())
320  {
321  const Cluster *pClusterToDelete(nullptr);
322  unsigned int highestHit(0);
323 
324  for (const Cluster *const pMatchedCluster : matchedClusters)
325  {
326  if (checkedClusters.count(pMatchedCluster))
327  continue;
328 
329  if (pMatchedCluster->GetNCaloHits() > highestHit)
330  {
331  pClusterToDelete = pMatchedCluster;
332  highestHit = pMatchedCluster->GetNCaloHits();
333  }
334  }
335 
336  if (!pClusterToDelete)
337  return;
338 
339  checkedClusters.insert(pClusterToDelete);
340 
341  if (!pClusterToDelete->IsAvailable())
342  continue;
343 
344  CaloHitList caloHitList3;
345  pSeedCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList3);
346  pClusterToDelete->GetOrderedCaloHitList().FillCaloHitList(caloHitList3);
347 
348  float reducedChiSquared(std::numeric_limits<float>::max());
349  const StatusCode status(this->PerformThreeViewMatching(caloHitList1, caloHitList2, caloHitList3, reducedChiSquared));
350 
351  if (status == STATUS_CODE_NOT_FOUND)
352  continue;
353 
354  if (reducedChiSquared > m_maxGoodMatchReducedChiSquared)
355  continue;
356 
357  this->UpdateForThirdViewClusterModification(pClusterToDelete, false);
358 
359  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*this, this->GetThirdViewClusterListName()));
360 
361  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::MergeAndDeleteClusters(*this, pSeedCluster, pClusterToDelete));
362  }
363 }
const std::string & GetThirdViewClusterListName() const
Get the name of the third view clusters.
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
pandora::StatusCode PerformThreeViewMatching(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
To determine how well three clusters (one in each view) map onto one another expressing this in terms...
void UpdateForThirdViewClusterModification(const pandora::Cluster *const pModifiedCluster, const bool isMuon)
Update the matrix after a third view cluster modification - remove delta ray clusters and reassess th...
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ParameteriseMuon ( const pandora::ParticleFlowObject *const  pParentMuon,
const pandora::Cluster *const  pDeltaRayCluster,
pandora::CartesianVector &  positionOnMuon,
pandora::CartesianVector &  muonDirection 
) const
inherited

Parameterise the projection of a cosmic ray track in order to avoid poor/sparse projections.

Parameters
pParentMuonthe address of the cosmic ray pfo
pDeltaRayClusterthe address of the delta ray cluster in the projected view
positionOnMuonthe output position to localise the parameterisation in space
muonDirectionthe output cosmic ray direction
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ParameteriseMuon ( const pandora::ParticleFlowObject *const  pParentMuon,
const pandora::CartesianPointVector &  deltaRayProjectedPositions,
const pandora::HitType  hitType,
pandora::CartesianVector &  positionOnMuon,
pandora::CartesianVector &  muonDirection 
) const
inherited

Parameterise the projection of a cosmic ray track in order to avoid poor/sparse projections.

Parameters
pParentMuonthe address of the cosmic ray pfo
deltaRayProjectedPositionsthe projected positions of the delta ray
hitTypethe view in which the projection is made
positionOnMuonthe output position to localise the parameterisation in space
muonDirectionthe output cosmic ray direction
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good
virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformMainLoop ( )
protectedvirtualinherited

Main loop over cluster combinations in order to populate the overlap container. Responsible for calling CalculateOverlapResult.

Implements lar_content::MatchingBaseAlgorithm.

pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::Cluster *const  pCluster3,
float &  reducedChiSquared 
) const
inherited

To determine how well three clusters (one in each view) map onto one another expressing this in terms of a chi-squared like parameter.

Parameters
pCluster1the first cluster
pCluster2the second cluster
pCluster3the third cluster
reducedChiSquaredthe reduced chi squared
Returns
a status code reflecting whether the matching procedure ran smoothly and if the outcome is good

Referenced by CollectThirdViewClusters(), GetBestMatchedCluster(), MergeThirdView(), and UpdateForThirdViewClusterModification().

pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching ( const pandora::Cluster *const  pClusterU,
const pandora::Cluster *const  pClusterV,
const pandora::Cluster *const  pClusterW,
float &  chiSquaredSum,
unsigned int &  nSamplingPoints,
unsigned int &  nMatchedSamplingPoints,
XOverlap XOverlap 
) const
inherited

To determine how well three clusters (one in each view) map onto one another expressing this in terms of a chi-squared like parameter.

Parameters
pClusterUthe U cluster (if the xOverlap object is to be retained this must be the u cluster - for labels to make sense)
pClusterVthe V cluster
pClusterWthe W cluster
chiSquaredSumthe sum of the chi-squared values of the sampled points
nSamplingPointsthe number of sampled points
nMatchedSamplingPointsthe number of matched sampled points
xOverlapthe xOverlap object
Returns
a status code reflecting whether the matching procedure ran smoothly and if the outcome is good
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching ( const pandora::CaloHitList &  pCluster1,
const pandora::CaloHitList &  pCluster2,
const pandora::CaloHitList &  pCluster3,
float &  reducedChiSquared 
) const
inherited

To determine how well three CaloHitLists (one in each view) map onto one another expressing this in terms of a chi-squared like parameter.

Parameters
pCluster1the first CaloHitList
pCluster2the second CaloHitList
pCluster3the third CaloHitList
reducedChiSquaredthe reduced chi squared
Returns
a status code reflecting whether the matching procedure ran smoothly and if the outcome is good
pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching ( const pandora::CaloHitList &  clusterU,
const pandora::CaloHitList &  clusterV,
const pandora::CaloHitList &  clusterW,
float &  chiSquaredSum,
unsigned int &  nSamplingPoints,
unsigned int &  nMatchedSamplingPoints,
XOverlap XOverlap 
) const
inherited

To determine how well three CaloHitLists (one for each view) map onto one another expressing this in terms of a chi-squared like parameter.

Parameters
clusterUthe U CaloHitList (if the xOverlap object is to be retained this must be the u cluster - for labels to make sense)
clusterVthe V CaloHitList
clusterWthe W CaloHitList
chiSquaredSumthe sum of the chi-squared values of the sampled points
nSamplingPointsthe number of sampled points
nMatchedSamplingPointsthe number of matched sampled points
xOverlapthe xOverlap object
Returns
a status code reflecting whether the matching procedure ran smoothly and if the outcome is good
virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PrepareAllInputClusters ( )
protectedvirtualinherited

Perform any preparatory steps required, e.g. caching expensive fit results for clusters.

Implements lar_content::MatchingBaseAlgorithm.

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PrepareInputClusters ( pandora::ClusterList &  preparedClusterList)
virtualinherited

Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.

Parameters
preparedClusterListto receive the prepared cluster list, non const so as to be able to modify input selected list

Reimplemented from lar_content::MatchingBaseAlgorithm.

pandora::StatusCode lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ProjectMuonPositions ( const pandora::HitType &  thirdViewHitType,
const pandora::ParticleFlowObject *const  pParentMuon,
pandora::CartesianPointVector &  projectedPositions 
) const
inherited

Use two views of a cosmic ray pfo to calculate projected positions in a given the third view.

Parameters
thirdViewHitTypethe view to be projected into
pParentMuonthe input cosmic ray pfo
projectedPositionsthe output projected positions
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good
StatusCode lar_content::TwoViewDeltaRayMatchingAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >.

Definition at line 423 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References m_algorithmToolVector, m_inputClusterListName, m_maxDistanceFromPrediction, m_maxDistanceToCollected, m_maxGoodMatchReducedChiSquared, m_minClusterCaloHits, m_minDistanceFromMuon, m_nMaxMatrixToolRepeats, m_reclusteringAlgorithmName, and lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::ReadSettings().

424 {
425  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListName", m_inputClusterListName));
426 
427  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithm(*this, xmlHandle, "ClusterRebuilding", m_reclusteringAlgorithmName));
428 
429  AlgorithmToolVector algorithmToolVector;
430  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "DeltaRayTools", algorithmToolVector));
431 
432  for (auto algorithmTool : algorithmToolVector)
433  {
434  DeltaRayMatrixTool *const pDeltaRayMatrixTool(dynamic_cast<DeltaRayMatrixTool *>(algorithmTool));
435 
436  if (!pDeltaRayMatrixTool)
437  return STATUS_CODE_INVALID_PARAMETER;
438 
439  m_algorithmToolVector.push_back(pDeltaRayMatrixTool);
440  }
441 
442  PANDORA_RETURN_RESULT_IF_AND_IF(
443  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NMaxMatrixToolRepeats", m_nMaxMatrixToolRepeats));
444 
445  PANDORA_RETURN_RESULT_IF_AND_IF(
446  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterCaloHits", m_minClusterCaloHits));
447 
448  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
449  XmlHelper::ReadValue(xmlHandle, "MaxDistanceFromPrediction", m_maxDistanceFromPrediction));
450 
451  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
452  XmlHelper::ReadValue(xmlHandle, "MaxGoodMatchReducedChiSquared", m_maxGoodMatchReducedChiSquared));
453 
454  PANDORA_RETURN_RESULT_IF_AND_IF(
455  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinDistanceFromMuon", m_minDistanceFromMuon));
456 
457  PANDORA_RETURN_RESULT_IF_AND_IF(
458  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxDistanceToCollected", m_maxDistanceToCollected));
459 
460  return BaseAlgorithm::ReadSettings(xmlHandle);
461 }
unsigned int m_minClusterCaloHits
The threshold number of hits for a cluster to be considered.
std::string m_inputClusterListName
The name of the cluster list in the view in which to project into.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
float m_maxDistanceFromPrediction
The maximum distance of a matched cluster from the third view projection points.
float m_maxDistanceToCollected
The maximim distance of a hit from the projected delta ray hits required for removal.
float m_minDistanceFromMuon
The minimum distance of a hit from the cosmic ray track required for removal.
std::string m_reclusteringAlgorithmName
The name of the clustering algorithm to be used to recluster created delta ray remnants.
virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::SelectAllInputClusters ( )
protectedvirtualinherited

Select a subset of input clusters for processing in this algorithm.

Implements lar_content::MatchingBaseAlgorithm.

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::SelectInputClusters ( const pandora::ClusterList *const  pInputClusterList,
pandora::ClusterList &  selectedClusterList 
) const
virtualinherited

Select a subset of input clusters for processing in this algorithm.

Parameters
pInputClusterListaddress of an input cluster list
selectedClusterListto receive the selected cluster list

Reimplemented from lar_content::MatchingBaseAlgorithm.

void lar_content::MatchingBaseAlgorithm::SetPfoParameters ( const ProtoParticle protoParticle,
PandoraContentApi::ParticleFlowObject::Parameters &  pfoParameters 
) const
virtualinherited

Set Pfo properties.

Parameters
protoParticlethe input proto particle
pfoParametersthe output pfo parameters

Definition at line 116 of file MatchingBaseAlgorithm.cc.

References f, and lar_content::ProtoParticle::m_clusterList.

117 {
118  this->SetPfoParticleId(pfoParameters);
119  pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
120  pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
121  pfoParameters.m_energy = 0.f;
122  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
123  pfoParameters.m_clusterList = protoParticle.m_clusterList;
124 }
TFile f
Definition: plotHisto.C:6
virtual void SetPfoParticleId(PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Set pfo particle id.
void lar_content::MatchingBaseAlgorithm::SetPfoParticleId ( PandoraContentApi::ParticleFlowObject::Parameters &  pfoParameters) const
virtualinherited
void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::SplitMuonCluster ( const std::string &  clusterListName,
const pandora::Cluster *const  pMuonCluster,
const pandora::CaloHitList &  collectedHits,
const pandora::Cluster *&  pDeltaRayCluster 
) const
inherited

Move a list of hits from a cosmic ray cluster into the given child delta ray cluster.

Parameters
clusterListNamethe pandora list to which the cosmic ray and delta ray clusters belong
pMuonClusterthe address of the cosmic ray cluster
collectedHitsthe list of hits to reassign
pDeltaRayClusterthe address of the delta ray cluster (may be a nullptr if cluster is yet to be made)

Referenced by FormThirdViewCluster().

void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::UpdateForNewCluster ( const pandora::Cluster *const  pNewCluster)
virtualinherited

Update to reflect addition of a new cluster to the problem space.

Parameters
pNewClusteraddress of the new cluster

Implements lar_content::MatchingBaseAlgorithm.

void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::UpdateForNewClusters ( const pandora::ClusterVector &  newClusterVector,
const pandora::PfoVector &  pfoVector 
)
inherited

Add a new cluster to algorithm ownership maps and, if it a delta ray cluster, to the underlying matches container (tensor/matrix)

Parameters
newClusterVectorthe vector of clusters to add - the order must match the pfoVector
pfoVectorthe vector of cosmic ray pfos to which the new clusters belong (nullptr for delta ray cluster)
void lar_content::TwoViewDeltaRayMatchingAlgorithm::UpdateForThirdViewClusterModification ( const pandora::Cluster *const  pModifiedCluster,
const bool  isMuon 
)

Update the matrix after a third view cluster modification - remove delta ray clusters and reassess the matching of cosmic ray clusters.

Parameters
pModifiedClusterthe address of the modified cluster
isMuonwhether the modified cluster belongs to a cosmic ray pfo

Definition at line 367 of file TwoViewDeltaRayMatchingAlgorithm.cc.

References GetBestMatchedCluster(), lar_content::TwoViewDeltaRayOverlapResult::GetCommonMuonPfoList(), lar_content::TwoViewDeltaRayOverlapResult::GetMatchedClusterList(), lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::GetMatchingControl(), lar_content::TwoViewDeltaRayOverlapResult::GetXOverlap(), m_maxGoodMatchReducedChiSquared, and lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::PerformThreeViewMatching().

Referenced by FormThirdViewCluster(), and MergeThirdView().

368 {
369  auto &theMatrix(this->GetMatchingControl().GetOverlapMatrix());
370 
371  for (auto [pCluster1, overlapList] : theMatrix)
372  {
373  for (auto [pCluster2, overlapResult] : overlapList)
374  {
375  ClusterList matchedClusters(overlapResult.GetMatchedClusterList());
376 
377  auto matchedClustersIter(std::find(matchedClusters.begin(), matchedClusters.end(), pModifiedCluster));
378 
379  if (matchedClustersIter == matchedClusters.end())
380  continue;
381 
382  float tempReducedChiSquared(std::numeric_limits<float>::max());
383 
384  if (isMuon)
385  this->PerformThreeViewMatching(pCluster1, pCluster2, pModifiedCluster, tempReducedChiSquared);
386 
387  if (tempReducedChiSquared > m_maxGoodMatchReducedChiSquared)
388  matchedClusters.erase(matchedClustersIter);
389 
390  float reducedChiSquared(std::numeric_limits<float>::max());
391  const Cluster *const pBestMatchedCluster =
392  this->GetBestMatchedCluster(pCluster1, pCluster2, overlapResult.GetCommonMuonPfoList(), matchedClusters, reducedChiSquared);
393 
394  TwoViewDeltaRayOverlapResult newOverlapResult(
395  overlapResult.GetXOverlap(), overlapResult.GetCommonMuonPfoList(), pBestMatchedCluster, matchedClusters, reducedChiSquared);
396  theMatrix.ReplaceOverlapResult(pCluster1, pCluster2, newOverlapResult);
397  }
398  }
399 }
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
const pandora::Cluster * GetBestMatchedCluster(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::PfoList &commonMuonPfoList, const pandora::ClusterList &matchedClusters, float &reducedChiSquared) const
Determine the best matched third view cluster and calculate the reduced chi-squared value of the thre...
pandora::StatusCode PerformThreeViewMatching(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
To determine how well three clusters (one in each view) map onto one another expressing this in terms...
void lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::UpdateUponDeletion ( const pandora::Cluster *const  pDeletedCluster)
virtualinherited

Update to reflect cluster deletion.

Parameters
pDeletedClusteraddress of the deleted cluster

Implements lar_content::MatchingBaseAlgorithm.

Member Data Documentation

MatrixToolVector lar_content::TwoViewDeltaRayMatchingAlgorithm::m_algorithmToolVector
private

The algorithm tool vector.

Definition at line 170 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by ExamineOverlapContainer(), and ReadSettings().

The class of hit, cluster and pfo ownership and proximity maps.

Definition at line 300 of file NViewDeltaRayMatchingAlgorithm.h.

std::string lar_content::TwoViewDeltaRayMatchingAlgorithm::m_inputClusterListName
private

The name of the cluster list in the view in which to project into.

Definition at line 168 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by CollectThirdViewClusters(), GetThirdViewClusterListName(), and ReadSettings().

The matching control.

Definition at line 53 of file NViewMatchingAlgorithm.h.

float lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_maxCosmicRayHitFraction
protectedinherited

The maximum allowed fraction of hits to be removed from the cosmic ray track.

Definition at line 306 of file NViewDeltaRayMatchingAlgorithm.h.

float lar_content::TwoViewDeltaRayMatchingAlgorithm::m_maxDistanceFromPrediction
private

The maximum distance of a matched cluster from the third view projection points.

Definition at line 173 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by CollectThirdViewClusters(), and ReadSettings().

the maximum distance of a projected point to the cosmic ray cluster used when parameterising the cosmic ray cluster

Definition at line 307 of file NViewDeltaRayMatchingAlgorithm.h.

float lar_content::TwoViewDeltaRayMatchingAlgorithm::m_maxDistanceToCollected
private

The maximim distance of a hit from the projected delta ray hits required for removal.

Definition at line 176 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by FormThirdViewCluster(), and ReadSettings().

float lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_maxDistanceToReferencePoint
protectedinherited

the maximum distance of a projected point to the cosmic ray vertex used when parameterising the cosmic ray cluster

Definition at line 308 of file NViewDeltaRayMatchingAlgorithm.h.

float lar_content::TwoViewDeltaRayMatchingAlgorithm::m_maxGoodMatchReducedChiSquared
private

The maximum reduced chi squared value of a good 1:1:1 match.

Definition at line 174 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by CollectThirdViewClusters(), MergeThirdView(), ReadSettings(), and UpdateForThirdViewClusterModification().

unsigned int lar_content::TwoViewDeltaRayMatchingAlgorithm::m_minClusterCaloHits
private

The threshold number of hits for a cluster to be considered.

Definition at line 172 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by DoesClusterPassTensorThreshold(), and ReadSettings().

float lar_content::TwoViewDeltaRayMatchingAlgorithm::m_minDistanceFromMuon
private

The minimum distance of a hit from the cosmic ray track required for removal.

Definition at line 175 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by FormThirdViewCluster(), and ReadSettings().

The threshold matched fraction of sampling points for a good match.

Definition at line 303 of file NViewDeltaRayMatchingAlgorithm.h.

unsigned int lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_minMatchedPoints
protectedinherited

The threshold number of matched sampling points for a good match.

Definition at line 304 of file NViewDeltaRayMatchingAlgorithm.h.

unsigned int lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_minProjectedPositions
protectedinherited

The threshold number of projected points for a good projection.

Definition at line 305 of file NViewDeltaRayMatchingAlgorithm.h.

The list of reconstructed cosmic ray pfos.

Definition at line 296 of file NViewDeltaRayMatchingAlgorithm.h.

unsigned int lar_content::TwoViewDeltaRayMatchingAlgorithm::m_nMaxMatrixToolRepeats
private

The maximum number of repeat loops over matrix tools.

Definition at line 171 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by ExamineOverlapContainer(), and ReadSettings().

Pseudo chi2 cut for three view matching.

Definition at line 301 of file NViewDeltaRayMatchingAlgorithm.h.

std::string lar_content::TwoViewDeltaRayMatchingAlgorithm::m_reclusteringAlgorithmName
private

The name of the clustering algorithm to be used to recluster created delta ray remnants.

Definition at line 169 of file TwoViewDeltaRayMatchingAlgorithm.h.

Referenced by GetClusteringAlgName(), and ReadSettings().

pandora::ClusterList lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_strayClusterListU
protectedinherited

The list of U clusters that do not pass the tensor threshold requirement.

Definition at line 297 of file NViewDeltaRayMatchingAlgorithm.h.

pandora::ClusterList lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_strayClusterListV
protectedinherited

The list of V clusters that do not pass the tensor threshold requirement.

Definition at line 298 of file NViewDeltaRayMatchingAlgorithm.h.

pandora::ClusterList lar_content::NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > >::m_strayClusterListW
protectedinherited

The list of W clusters that do not pass the tensor threshold requirement.

Definition at line 299 of file NViewDeltaRayMatchingAlgorithm.h.

The maximum allowed separation of a stray cluster and a delta ray cluster for merge.

Definition at line 309 of file NViewDeltaRayMatchingAlgorithm.h.

The maximum allowed displacement in x position.

Definition at line 302 of file NViewDeltaRayMatchingAlgorithm.h.


The documentation for this class was generated from the following files: