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

TwoViewTransverseTracksAlgorithm class. More...

#include "TwoViewTransverseTracksAlgorithm.h"

Inheritance diagram for lar_content::TwoViewTransverseTracksAlgorithm:
lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > > lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > > lar_content::MatchingBaseAlgorithm

Public Types

typedef NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > > BaseAlgorithm
 
typedef std::set< unsigned int > UIntSet
 
typedef TwoViewMatchingControl< TwoViewTransverseOverlapResultMatchingType
 

Public Member Functions

 TwoViewTransverseTracksAlgorithm ()
 Default constructor. More...
 
const TwoDSlidingFitResultGetCachedSlidingFitResult (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 UpdateForNewCluster (const pandora::Cluster *const pNewCluster)
 Update to reflect addition of a new cluster to the problem space. 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 Member Functions

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

MatchingType m_matchingControl
 The matching control. More...
 

Private Types

typedef std::vector< TransverseMatrixTool * > MatrixToolVector
 

Private Member Functions

void CalculateOverlapResult (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const)
 Calculate cluster overlap result and store in container. More...
 
pandora::StatusCode CalculateOverlapResult (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, TwoViewTransverseOverlapResult &overlapResult)
 Calculates the two view overlap result. More...
 
unsigned int CalculateNumberOfLocallyMatchingSamplingPoints (const DiscreteProbabilityVector &discreteProbabilityVector1, const DiscreteProbabilityVector &discreteProbabilityVector2, std::mt19937 &randomNumberGenerator)
 Calculates the number of the sliding windows that contains charge bins that locally match. More...
 
float GetPrimaryAxisDotDriftAxis (const pandora::Cluster *const pCluster)
 Get the dot product between the cluster's primary axis and the drift axis. 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

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_downsampleFactor
 The downsampling (hit merging) applied to hits in the overlap region. More...
 
unsigned int m_minSamples
 The minimum number of samples needed for comparing charges. More...
 
unsigned int m_nPermutations
 The number of permutations for calculating p-values. More...
 
float m_localMatchingScoreThreshold
 The minimum score to classify a local region as matching. More...
 
float m_maxDotProduct
 
float m_minOverallMatchingScore
 M The maximum allowed cluster primary qxis Dot drift axis to fill the overlap result. More...
 
float m_minOverallLocallyMatchedFraction
 The minimum required lcoally matched fraction to fill the overlap result. More...
 
std::mt19937 m_randomNumberGenerator
 The random number generator. More...
 

Detailed Description

Member Typedef Documentation

Definition at line 36 of file TwoViewTransverseTracksAlgorithm.h.

Constructor & Destructor Documentation

lar_content::TwoViewTransverseTracksAlgorithm::TwoViewTransverseTracksAlgorithm ( )

Default constructor.

Definition at line 23 of file TwoViewTransverseTracksAlgorithm.cc.

References lar_content::LArDiscreteProbabilityHelper::CalculateCorrelationCoefficient(), lar_content::LArDiscreteProbabilityHelper::CalculateCorrelationCoefficientPValueFromPermutationTest(), CalculateNumberOfLocallyMatchingSamplingPoints(), CalculateOverlapResult(), f, lar_content::LArClusterHelper::GetCaloHitListInBoundingBox(), lar_content::LArGeometryHelper::GetCommonDaughterVolumes(), lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::GetMatchingControl(), lar_content::TwoViewMatchingControl< T >::GetOverlapMatrix(), GetPrimaryAxisDotDriftAxis(), lar_content::DiscreteProbabilityVector::GetSize(), lar_content::TwoViewXOverlap::GetTwoViewXOverlapMax(), lar_content::TwoViewXOverlap::GetTwoViewXOverlapMin(), lar_content::TwoViewXOverlap::GetTwoViewXOverlapSpan(), lar_content::TwoViewXOverlap::GetXSpan0(), lar_content::TwoViewXOverlap::GetXSpan1(), lar_content::TrackTwoViewOverlapResult::IsInitialized(), m_downsampleFactor, m_maxDotProduct, m_minOverallLocallyMatchedFraction, m_minOverallMatchingScore, m_minSamples, m_nPermutations, m_randomNumberGenerator, and lar_content::OverlapMatrix< T >::SetOverlapResult().

23  :
26  m_minSamples(11),
27  m_nPermutations(1000),
29  m_maxDotProduct(0.998f),
32  m_randomNumberGenerator(static_cast<std::mt19937::result_type>(0))
33 {
34 }
std::mt19937 m_randomNumberGenerator
The random number generator.
float m_localMatchingScoreThreshold
The minimum score to classify a local region as matching.
TFile f
Definition: plotHisto.C:6
unsigned int m_nPermutations
The number of permutations for calculating p-values.
unsigned int m_minSamples
The minimum number of samples needed for comparing charges.
float m_minOverallMatchingScore
M The maximum allowed cluster primary qxis Dot drift axis to fill the overlap result.
float m_minOverallLocallyMatchedFraction
The minimum required lcoally matched fraction to fill the overlap result.
unsigned int m_downsampleFactor
The downsampling (hit merging) applied to hits in the overlap region.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.

Member Function Documentation

void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::AddToSlidingFitCache ( const pandora::Cluster *const  pCluster)
protectedinherited

Add a new sliding fit result, for the specified cluster, to the algorithm cache.

Parameters
pClusteraddress of the relevant cluster
unsigned int lar_content::TwoViewTransverseTracksAlgorithm::CalculateNumberOfLocallyMatchingSamplingPoints ( const DiscreteProbabilityVector discreteProbabilityVector1,
const DiscreteProbabilityVector discreteProbabilityVector2,
std::mt19937 &  randomNumberGenerator 
)
private

Calculates the number of the sliding windows that contains charge bins that locally match.

Parameters
discreteProbabilityVector1the view 0 discrete probability vector containing the charge information
pCluster2the view 1 discrete probability vector containing the charge information
randomNumberGeneratora seeded random number generator
Returns
the number of locally matching sampling points

Definition at line 145 of file TwoViewTransverseTracksAlgorithm.cc.

References lar_content::LArDiscreteProbabilityHelper::CalculateCorrelationCoefficientPValueFromPermutationTest(), f, lar_content::DiscreteProbabilityVector::GetProbability(), lar_content::DiscreteProbabilityVector::GetSize(), m_localMatchingScoreThreshold, m_minSamples, and m_nPermutations.

Referenced by TwoViewTransverseTracksAlgorithm().

147 {
148  if (discreteProbabilityVector1.GetSize() != discreteProbabilityVector2.GetSize() ||
149  0 == discreteProbabilityVector1.GetSize() * discreteProbabilityVector2.GetSize())
150  throw STATUS_CODE_INVALID_PARAMETER;
151 
152  if (m_minSamples > discreteProbabilityVector1.GetSize())
153  throw STATUS_CODE_INVALID_PARAMETER;
154 
155  pandora::FloatVector localValues1, localValues2;
156  unsigned int nMatchedComparisons(0);
157 
158  for (unsigned int iValue = 0; iValue < discreteProbabilityVector1.GetSize(); ++iValue)
159  {
160  localValues1.emplace_back(discreteProbabilityVector1.GetProbability(iValue));
161  localValues2.emplace_back(discreteProbabilityVector2.GetProbability(iValue));
162  if (localValues1.size() == m_minSamples)
163  {
164  float localPValue(0);
165  try
166  {
168  localValues1, localValues2, randomNumberGenerator, m_nPermutations);
169  }
170  catch (const StatusCodeException &)
171  {
172  std::cout << "TwoViewTransverseTracksAlgorithm: failed to calculate correlation coefficient p-value for these numbers" << std::endl;
173  ;
174  std::cout << "----view 0: ";
175  for (unsigned int iElement = 0; iElement < localValues1.size(); ++iElement)
176  std::cout << localValues1.at(iElement) << " ";
177  std::cout << std::endl;
178  std::cout << "----view 1: ";
179  for (unsigned int iElement = 0; iElement < localValues2.size(); ++iElement)
180  std::cout << localValues2.at(iElement) << " ";
181  std::cout << std::endl;
182  }
183 
184  if ((1.f - localPValue) - m_localMatchingScoreThreshold > std::numeric_limits<float>::epsilon())
185  nMatchedComparisons++;
186 
187  localValues1.erase(localValues1.begin());
188  localValues2.erase(localValues2.begin());
189  }
190  }
191  return nMatchedComparisons;
192 }
static float CalculateCorrelationCoefficientPValueFromPermutationTest(const T &t1, const T &t2, std::mt19937 &randomNumberGenerator, const unsigned int nPermutations)
Calculate P value for measured correlation coefficient between two datasets via a permutation test...
float m_localMatchingScoreThreshold
The minimum score to classify a local region as matching.
TFile f
Definition: plotHisto.C:6
unsigned int m_nPermutations
The number of permutations for calculating p-values.
unsigned int m_minSamples
The minimum number of samples needed for comparing charges.
void lar_content::TwoViewTransverseTracksAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::Cluster *  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 TwoViewTransverseTracksAlgorithm().

pandora::StatusCode lar_content::TwoViewTransverseTracksAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
TwoViewTransverseOverlapResult overlapResult 
)
private

Calculates the two view overlap result.

Parameters
pCluster1the view 0 cluster
pCluster2the view 1 cluster
overlapResultthe two view overlap result
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::TwoViewClearTracksTool::CreateThreeDParticles(), lar_content::ClearLongitudinalTracksTool::CreateThreeDParticles(), lar_content::ClearTracksTool::CreateThreeDParticles(), lar_content::ClearTrackFragmentsTool::FindTrackFragments(), lar_content::MatchedEndPointsTool::Run(), lar_content::SimpleShowersTool::Run(), lar_content::ConnectedRemnantsTool::Run(), lar_content::MopUpRemnantsTool::Run(), lar_content::TwoViewSimpleTracksTool::Run(), lar_content::MissingTrackTool::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.
void lar_content::TwoViewTransverseTracksAlgorithm::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 213 of file TwoViewTransverseTracksAlgorithm.cc.

References m_algorithmToolVector, and m_nMaxMatrixToolRepeats.

214 {
215  unsigned int repeatCounter(0);
216  for (MatrixToolVector::const_iterator iter = m_algorithmToolVector.begin(), iterEnd = m_algorithmToolVector.end(); iter != iterEnd;)
217  {
218  if ((*iter)->Run(this, this->GetMatchingControl().GetOverlapMatrix()))
219  {
220  iter = m_algorithmToolVector.begin();
221 
222  if (++repeatCounter > m_nMaxMatrixToolRepeats)
223  break;
224  }
225  else
226  {
227  ++iter;
228  }
229  }
230 }
intermediate_table::const_iterator const_iterator
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
const TwoDSlidingFitResult& lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::GetCachedSlidingFitResult ( const pandora::Cluster *const  pCluster) const
inherited

Get a sliding fit result from the algorithm cache.

Parameters
pClusteraddress of the relevant cluster
const std::string& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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.

const pandora::ClusterList& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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.

Get the matching control.

Referenced by TwoViewTransverseTracksAlgorithm().

float lar_content::TwoViewTransverseTracksAlgorithm::GetPrimaryAxisDotDriftAxis ( const pandora::Cluster *const  pCluster)
private

Get the dot product between the cluster's primary axis and the drift axis.

Parameters
pClusterthe cluster
Returns
dot product

Definition at line 196 of file TwoViewTransverseTracksAlgorithm.cc.

References f, lar_content::LArClusterHelper::GetCoordinateVector(), and lar_content::LArPcaHelper::RunPca().

Referenced by TwoViewTransverseTracksAlgorithm().

197 {
198  pandora::CartesianPointVector pointVector;
199  LArClusterHelper::GetCoordinateVector(pCluster, pointVector);
200 
201  pandora::CartesianVector centroid(0.f, 0.f, 0.f);
202  LArPcaHelper::EigenVectors eigenVecs;
203  LArPcaHelper::EigenValues eigenValues(0.f, 0.f, 0.f);
204  LArPcaHelper::RunPca(pointVector, centroid, eigenValues, eigenVecs);
205 
206  const pandora::CartesianVector primaryAxis(eigenVecs.at(0));
207  const pandora::CartesianVector driftAxis(1.f, 0.f, 0.f);
208  return primaryAxis.GetDotProduct(driftAxis);
209 }
pandora::CartesianVector EigenValues
Definition: LArPcaHelper.h:24
TFile f
Definition: plotHisto.C:6
static void RunPca(const T &t, pandora::CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D p...
std::vector< pandora::CartesianVector > EigenVectors
Definition: LArPcaHelper.h:25
static void GetCoordinateVector(const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector)
Get vector of hit coordinates from an input cluster.
const pandora::ClusterList& lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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.

unsigned int lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::GetSlidingFitWindow ( ) const
inherited

Get the layer window for the sliding linear fits.

Returns
the layer window for the sliding linear fits
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
virtual bool lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::MakeClusterSplit ( const pandora::CartesianVector &  splitPosition,
const pandora::Cluster *&  pCurrentCluster,
const pandora::Cluster *&  pLowXCluster,
const pandora::Cluster *&  pHighXCluster 
) const
virtualinherited

Make a cluster split.

Parameters
splitPositionthe split position
pCurrentClusterthe cluster to split
pLowXClusterto receive the low x cluster
pHighXClusterto receive the high x cluster
Returns
whether a cluster split occurred
virtual bool lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::MakeClusterSplits ( const SplitPositionMap splitPositionMap)
virtualinherited

Make cluster splits.

Parameters
splitPositionMapthe split position map
Returns
whether changes to the overlap container have been made
virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::PerformMainLoop ( )
protectedvirtualinherited

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

Implements lar_content::MatchingBaseAlgorithm.

virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::PrepareAllInputClusters ( )
protectedvirtualinherited

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

Implements lar_content::MatchingBaseAlgorithm.

virtual void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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.

StatusCode lar_content::TwoViewTransverseTracksAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >.

Definition at line 234 of file TwoViewTransverseTracksAlgorithm.cc.

References m_algorithmToolVector, m_downsampleFactor, m_localMatchingScoreThreshold, m_maxDotProduct, m_minOverallLocallyMatchedFraction, m_minOverallMatchingScore, m_minSamples, m_nMaxMatrixToolRepeats, m_nPermutations, and lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::ReadSettings().

235 {
236  AlgorithmToolVector algorithmToolVector;
237  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "TrackTools", algorithmToolVector));
238 
239  for (AlgorithmToolVector::const_iterator iter = algorithmToolVector.begin(), iterEnd = algorithmToolVector.end(); iter != iterEnd; ++iter)
240  {
241  TransverseMatrixTool *const pTransverseMatrixTool(dynamic_cast<TransverseMatrixTool *>(*iter));
242 
243  if (!pTransverseMatrixTool)
244  return STATUS_CODE_INVALID_PARAMETER;
245 
246  m_algorithmToolVector.push_back(pTransverseMatrixTool);
247  }
248 
249  PANDORA_RETURN_RESULT_IF_AND_IF(
250  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NMaxMatrixToolRepeats", m_nMaxMatrixToolRepeats));
251 
252  PANDORA_RETURN_RESULT_IF_AND_IF(
253  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DownsampleFactor", m_downsampleFactor));
254 
255  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinSamples", m_minSamples));
256 
257  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NPermutations", m_nPermutations));
258 
259  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
260  XmlHelper::ReadValue(xmlHandle, "LocalMatchingScoreThreshold", m_localMatchingScoreThreshold));
261 
262  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxDotProduct", m_maxDotProduct));
263 
264  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
265  XmlHelper::ReadValue(xmlHandle, "MinOverallMatchingScore", m_minOverallMatchingScore));
266 
267  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
268  XmlHelper::ReadValue(xmlHandle, "MinOverallLocallyMatchedFraction", m_minOverallLocallyMatchedFraction));
269 
270  return BaseAlgorithm::ReadSettings(xmlHandle);
271 }
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
intermediate_table::const_iterator const_iterator
float m_localMatchingScoreThreshold
The minimum score to classify a local region as matching.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
unsigned int m_nPermutations
The number of permutations for calculating p-values.
unsigned int m_minSamples
The minimum number of samples needed for comparing charges.
float m_minOverallMatchingScore
M The maximum allowed cluster primary qxis Dot drift axis to fill the overlap result.
float m_minOverallLocallyMatchedFraction
The minimum required lcoally matched fraction to fill the overlap result.
unsigned int m_downsampleFactor
The downsampling (hit merging) applied to hits in the overlap region.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::RemoveFromSlidingFitCache ( const pandora::Cluster *const  pCluster)
protectedinherited

Remova an existing sliding fit result, for the specified cluster, from the algorithm cache.

Parameters
pClusteraddress of the relevant cluster
virtual void lar_content::NViewMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::SelectAllInputClusters ( )
protectedvirtualinherited

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

Implements lar_content::MatchingBaseAlgorithm.

virtual void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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.
virtual void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::SetPfoParticleId ( PandoraContentApi::ParticleFlowObject::Parameters &  pfoParameters) const
virtualinherited

Set pfo particle id.

Parameters
pfoParametersthe output pfo parameters

Reimplemented from lar_content::MatchingBaseAlgorithm.

static bool lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::SortSplitPositions ( const pandora::CartesianVector &  lhs,
const pandora::CartesianVector &  rhs 
)
staticinherited

Sort split position cartesian vectors by increasing x coordinate.

Parameters
lhsthe first cartesian vector
rhsthe second cartesian vector
virtual void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::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

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

virtual void lar_content::NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > >::UpdateUponDeletion ( const pandora::Cluster *const  pDeletedCluster)
virtualinherited

Update to reflect cluster deletion.

Parameters
pDeletedClusteraddress of the deleted cluster

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

Member Data Documentation

MatrixToolVector lar_content::TwoViewTransverseTracksAlgorithm::m_algorithmToolVector
private

The algorithm tool vector.

Definition at line 81 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by ExamineOverlapContainer(), and ReadSettings().

unsigned int lar_content::TwoViewTransverseTracksAlgorithm::m_downsampleFactor
private

The downsampling (hit merging) applied to hits in the overlap region.

Definition at line 84 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by ReadSettings(), and TwoViewTransverseTracksAlgorithm().

float lar_content::TwoViewTransverseTracksAlgorithm::m_localMatchingScoreThreshold
private

The minimum score to classify a local region as matching.

Definition at line 87 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by CalculateNumberOfLocallyMatchingSamplingPoints(), and ReadSettings().

The matching control.

Definition at line 53 of file NViewMatchingAlgorithm.h.

float lar_content::TwoViewTransverseTracksAlgorithm::m_maxDotProduct
private
float lar_content::TwoViewTransverseTracksAlgorithm::m_minOverallLocallyMatchedFraction
private

The minimum required lcoally matched fraction to fill the overlap result.

Definition at line 90 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by ReadSettings(), and TwoViewTransverseTracksAlgorithm().

float lar_content::TwoViewTransverseTracksAlgorithm::m_minOverallMatchingScore
private

M The maximum allowed cluster primary qxis Dot drift axis to fill the overlap result.

The minimum required global matching score to fill the overlap result

Definition at line 89 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by ReadSettings(), and TwoViewTransverseTracksAlgorithm().

unsigned int lar_content::TwoViewTransverseTracksAlgorithm::m_minSamples
private

The minimum number of samples needed for comparing charges.

Definition at line 85 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by CalculateNumberOfLocallyMatchingSamplingPoints(), ReadSettings(), and TwoViewTransverseTracksAlgorithm().

unsigned int lar_content::TwoViewTransverseTracksAlgorithm::m_nMaxMatrixToolRepeats
private

The maximum number of repeat loops over matrix tools.

Definition at line 83 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by ExamineOverlapContainer(), and ReadSettings().

unsigned int lar_content::TwoViewTransverseTracksAlgorithm::m_nPermutations
private

The number of permutations for calculating p-values.

Definition at line 86 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by CalculateNumberOfLocallyMatchingSamplingPoints(), ReadSettings(), and TwoViewTransverseTracksAlgorithm().

std::mt19937 lar_content::TwoViewTransverseTracksAlgorithm::m_randomNumberGenerator
private

The random number generator.

Definition at line 91 of file TwoViewTransverseTracksAlgorithm.h.

Referenced by TwoViewTransverseTracksAlgorithm().


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