Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ThreeViewTrackFragmentsAlgorithm.h
Go to the documentation of this file.
1
8#ifndef LAR_THREE_VIEW_TRACK_FRAGMENTS_ALGORITHM_H
9#define LAR_THREE_VIEW_TRACK_FRAGMENTS_ALGORITHM_H 1
10
11#include "Pandora/Algorithm.h"
13
15
18
19#include <unordered_map>
20
21namespace lar_content
22{
23
24class FragmentTensorTool;
25
26//------------------------------------------------------------------------------------------------------------------------------------------
27
31class ThreeViewTrackFragmentsAlgorithm : public NViewTrackMatchingAlgorithm<ThreeViewMatchingControl<FragmentOverlapResult>>
32{
33public:
35
40
41 void UpdateForNewCluster(const pandora::Cluster *const pNewCluster);
42
49 void RebuildClusters(const pandora::ClusterList &rebuildList, pandora::ClusterList &newClusters) const;
50
51protected:
52 void PerformMainLoop();
53 void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW);
54
67 const pandora::ClusterList &inputClusterList, const pandora::Cluster *&pBestMatchedCluster, FragmentOverlapResult &fragmentOverlapResult) const;
68
69 typedef std::unordered_map<const pandora::CaloHit *, const pandora::Cluster *> HitToClusterMap;
70
81 pandora::CartesianPointVector &projectedPositions) const;
82
93 pandora::StatusCode GetMatchedHits(const pandora::ClusterList &inputClusterList, const pandora::CartesianPointVector &projectedPositions,
94 HitToClusterMap &hitToClusterMap, pandora::CaloHitList &matchedCaloHits) const;
95
106 pandora::StatusCode GetMatchedClusters(const pandora::CaloHitList &matchedHits, const HitToClusterMap &hitToClusterMap,
107 pandora::ClusterList &matchedClusters, const pandora::Cluster *&pBestMatchedCluster) const;
108
117 void GetFragmentOverlapResult(const pandora::CartesianPointVector &projectedPositions, const pandora::CaloHitList &matchedHits,
118 const pandora::ClusterList &matchedClusters, FragmentOverlapResult &fragmentOverlapResult) const;
119
128 bool CheckMatchedClusters(const pandora::CartesianPointVector &projectedPositions, const pandora::ClusterList &matchedClusters) const;
129
137 bool CheckOverlapResult(const FragmentOverlapResult &overlapResult) const;
138
141
142 typedef std::unordered_map<const pandora::Cluster *, unsigned int> ClusterToMatchedHitsMap;
143
145
146 typedef std::vector<FragmentTensorTool *> TensorToolVector;
148
150
155 unsigned int m_minMatchedHits;
156};
157
158//------------------------------------------------------------------------------------------------------------------------------------------
159
164{
165public:
166 typedef ThreeViewTrackFragmentsAlgorithm::MatchingType::TensorType TensorType;
167 typedef std::vector<TensorType::ElementList::const_iterator> IteratorList;
168
177 virtual bool Run(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, TensorType &overlapTensor) = 0;
178};
179
180} // namespace lar_content
181
182#endif // #ifndef LAR_THREE_VIEW_TRACK_FRAGMENTS_ALGORITHM_H
Header file for the algorithm class.
Header file for the algorithm tool class.
Header file for the lar track overlap result class.
Header file for the n view track matching algorithm class.
Header file for the three view matching control class.
ThreeViewTrackFragmentsAlgorithm::MatchingType::TensorType TensorType
virtual bool Run(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, TensorType &overlapTensor)=0
Run the algorithm tool.
std::vector< TensorType::ElementList::const_iterator > IteratorList
void PerformMainLoop()
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
TensorToolVector m_algorithmToolVector
The algorithm tool list.
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
void GetFragmentOverlapResult(const pandora::CartesianPointVector &projectedPositions, const pandora::CaloHitList &matchedHits, const pandora::ClusterList &matchedClusters, FragmentOverlapResult &fragmentOverlapResult) const
Get the populated fragment overlap result.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
void RebuildClusters(const pandora::ClusterList &rebuildList, pandora::ClusterList &newClusters) const
Rebuild clusters after fragmentation.
float m_maxPointDisplacementSquared
maximum allowed distance (squared) between projected points and associated hits
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::StatusCode GetMatchedClusters(const pandora::CaloHitList &matchedHits, const HitToClusterMap &hitToClusterMap, pandora::ClusterList &matchedClusters, const pandora::Cluster *&pBestMatchedCluster) const
Get the list of the relevant clusters and the address of the single best matched cluster.
void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Calculate cluster overlap result and store in container.
bool CheckMatchedClusters(const pandora::CartesianPointVector &projectedPositions, const pandora::ClusterList &matchedClusters) const
Whether the matched clusters are consistent with the projected positions.
NViewTrackMatchingAlgorithm< ThreeViewMatchingControl< FragmentOverlapResult > > BaseAlgorithm
float m_minMatchedSamplingPointFraction
minimum fraction of matched sampling points
float m_minXOverlap
requirement on minimum X overlap for associated clusters
bool CheckOverlapResult(const FragmentOverlapResult &overlapResult) const
Whether the matched clusters and hits pass the algorithm quality cuts.
std::string m_reclusteringAlgorithmName
Name of daughter algorithm to use for cluster re-building.
unsigned int m_minMatchedHits
minimum number of matched calo hits
float m_minXOverlapFraction
requirement on minimum X overlap fraction for associated clusters
std::unordered_map< const pandora::Cluster *, unsigned int > ClusterToMatchedHitsMap
pandora::StatusCode GetMatchedHits(const pandora::ClusterList &inputClusterList, const pandora::CartesianPointVector &projectedPositions, HitToClusterMap &hitToClusterMap, pandora::CaloHitList &matchedCaloHits) const
Get the list of hits associated with the projected positions and a useful hit to cluster map.
pandora::StatusCode GetProjectedPositions(const TwoDSlidingFitResult &fitResult1, const TwoDSlidingFitResult &fitResult2, pandora::CartesianPointVector &projectedPositions) const
Get the list of projected positions, in the third view, corresponding to a pair of sliding fit result...
AlgorithmTool class. Algorithm tools will tend to be tailored for specific parent algorithms,...
Cluster class.
Definition Cluster.h:31
MANAGED_CONTAINER< const Cluster * > ClusterList
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.