LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TwoViewDeltaRayMatchingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TWO_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
9 #define LAR_TWO_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmTool.h"
13 
15 
18 
20 
21 namespace lar_content
22 {
23 
24 class DeltaRayMatrixTool;
25 
26 //------------------------------------------------------------------------------------------------------------------------------------------
27 
31 class TwoViewDeltaRayMatchingAlgorithm : public NViewDeltaRayMatchingAlgorithm<TwoViewMatchingControl<TwoViewDeltaRayOverlapResult>>
32 {
33 public:
36 
41 
47  const std::string &GetThirdViewClusterListName() const;
48 
54  const std::string &GetClusteringAlgName() const;
55 
62 
70  const pandora::Cluster *GetCluster(const MatrixType::Element &element, const pandora::HitType hitType);
71 
79  bool CreatePfo(const MatrixType::Element &element);
80 
87  void UpdateForThirdViewClusterModification(const pandora::Cluster *const pModifiedCluster, const bool isMuon);
88 
89 private:
90  void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3);
91 
99  virtual bool DoesClusterPassTensorThreshold(const pandora::Cluster *const pCluster) const;
100 
110  pandora::StatusCode CalculateOverlapResult(
111  const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, TwoViewDeltaRayOverlapResult &overlapResult) const;
112 
120  void FindCommonMuonParents(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::PfoList &commonMuonPfoList) const;
121 
130  void CollectThirdViewClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
131  const pandora::CartesianPointVector &projectedPositions, pandora::ClusterList &matchedClusters) const;
132 
144  const pandora::Cluster *GetBestMatchedCluster(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
145  const pandora::PfoList &commonMuonPfoList, const pandora::ClusterList &matchedClusters, float &reducedChiSquared) const;
146 
153  void FormThirdViewCluster(const MatrixType::Element &element, ProtoParticle &protoParticle);
154 
161  void MergeThirdView(const MatrixType::Element &element, const pandora::Cluster *const pSeedCluster);
162 
164  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
165 
166  typedef std::vector<DeltaRayMatrixTool *> MatrixToolVector;
167 
170  MatrixToolVector m_algorithmToolVector;
171  unsigned int m_nMaxMatrixToolRepeats;
172  unsigned int m_minClusterCaloHits;
177 };
178 
179 //------------------------------------------------------------------------------------------------------------------------------------------
180 
182 {
183  return m_inputClusterListName;
184 }
185 
186 //------------------------------------------------------------------------------------------------------------------------------------------
187 
189 {
191 }
192 
193 //------------------------------------------------------------------------------------------------------------------------------------------
194 //------------------------------------------------------------------------------------------------------------------------------------------
195 
199 class DeltaRayMatrixTool : public pandora::AlgorithmTool
200 {
201 public:
203  typedef std::vector<MatrixType::ElementList::const_iterator> IteratorList;
204 
213  virtual bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &matrixTensor) = 0;
214 
216 };
217 
218 } // namespace lar_content
219 
220 #endif // #ifndef LAR_TWO_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
Header file for the kd tree linker algo template class.
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.
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...
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
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.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
float m_maxDistanceFromPrediction
The maximum distance of a matched cluster from the third view projection points.
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.
float m_maxDistanceToCollected
The maximim distance of a hit from the projected delta ray hits required for removal.
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 (tens...
const pandora::Cluster * GetCluster(const MatrixType::Element &element, const pandora::HitType hitType)
Get the address of the given hit type cluster.
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...
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...
HitTypeVector GetHitTypeVector()
Obtain the HitTypeVector of input views.
std::vector< MatrixType::ElementList::const_iterator > IteratorList
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 h...
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.
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...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
TwoViewDeltaRayMatchingAlgorithm * m_pParentAlgorithm
Address of the parent matching algorithm.
bool CreatePfo(const MatrixType::Element &element)
Create delta ray pfos out of a given element, merging the third view clusters together and adding in ...
TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType MatrixType
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...
TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType MatrixType
Header file for the two view matching control class.
Header file for the lar track two view overlap result class.
const std::string & GetClusteringAlgName() const
Get the name of the clustering algorithm to be used to recluster created delta ray remnants...
NViewDeltaRayMatchingAlgorithm< TwoViewMatchingControl< TwoViewDeltaRayOverlapResult > > BaseAlgorithm