LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TwoViewTransverseTracksAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TWO_VIEW_TRANSVERSE_TRACKS_ALGORITHM_H
9 #define LAR_TWO_VIEW_TRANSVERSE_TRACKS_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmTool.h"
13 
16 
19 
20 #include <random>
21 
22 namespace lar_content
23 {
24 
25 class TransverseMatrixTool;
26 
27 //------------------------------------------------------------------------------------------------------------------------------------------
28 
32 class TwoViewTransverseTracksAlgorithm : public NViewTrackMatchingAlgorithm<TwoViewMatchingControl<TwoViewTransverseOverlapResult>>
33 {
34 public:
36  typedef std::set<unsigned int> UIntSet;
37 
42 
43 private:
44  void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const);
45 
53  pandora::StatusCode CalculateOverlapResult(
54  const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, TwoViewTransverseOverlapResult &overlapResult);
55 
65  unsigned int CalculateNumberOfLocallyMatchingSamplingPoints(const DiscreteProbabilityVector &discreteProbabilityVector1,
66  const DiscreteProbabilityVector &discreteProbabilityVector2, std::mt19937 &randomNumberGenerator);
67 
75  float GetPrimaryAxisDotDriftAxis(const pandora::Cluster *const pCluster);
76 
78  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
79 
80  typedef std::vector<TransverseMatrixTool *> MatrixToolVector;
81  MatrixToolVector m_algorithmToolVector;
82 
83  unsigned int m_nMaxMatrixToolRepeats;
84  unsigned int m_downsampleFactor;
85  unsigned int m_minSamples;
86  unsigned int m_nPermutations;
91  std::mt19937 m_randomNumberGenerator;
92 };
93 
94 //------------------------------------------------------------------------------------------------------------------------------------------
95 
99 class TransverseMatrixTool : public pandora::AlgorithmTool
100 {
101 public:
103  typedef std::vector<MatrixType::ElementList::const_iterator> IteratorList;
104 
113  virtual bool Run(TwoViewTransverseTracksAlgorithm *const pAlgorithm, MatrixType &overlapMatrix) = 0;
114 };
115 
116 } // namespace lar_content
117 
118 #endif // #ifndef LAR_TWO_VIEW_TRANSVERSE_TRACKS_ALGORITHM_H
Header file for the n view track matching algorithm class.
std::mt19937 m_randomNumberGenerator
The random number generator.
float m_localMatchingScoreThreshold
The minimum score to classify a local region as matching.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
NViewTrackMatchingAlgorithm< TwoViewMatchingControl< TwoViewTransverseOverlapResult > > BaseAlgorithm
TwoViewTransverseTracksAlgorithm::MatchingType::MatrixType MatrixType
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float GetPrimaryAxisDotDriftAxis(const pandora::Cluster *const pCluster)
Get the dot product between the cluster&#39;s primary axis and the drift axis.
Header file for the lar discrete probability vector class.
unsigned int m_nPermutations
The number of permutations for calculating p-values.
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...
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.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
unsigned int m_downsampleFactor
The downsampling (hit merging) applied to hits in the overlap region.
std::vector< MatrixType::ElementList::const_iterator > IteratorList
Header file for the two view matching control class.
void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const)
Calculate cluster overlap result and store in container.
Header file for the lar track two view overlap result class.
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.