Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ThreeViewShowersAlgorithm.h
Go to the documentation of this file.
1
8#ifndef LAR_THREE_VIEW_SHOWERS_ALGORITHM_H
9#define LAR_THREE_VIEW_SHOWERS_ALGORITHM_H 1
10
11#include "Pandora/Algorithm.h"
12
15
18
19namespace lar_content
20{
21
22class ShowerTensorTool;
23
24//------------------------------------------------------------------------------------------------------------------------------------------
25
29class ThreeViewShowersAlgorithm : public NViewMatchingAlgorithm<ThreeViewMatchingControl<ShowerOverlapResult>>
30{
31public:
33
38
45
46 void UpdateForNewCluster(const pandora::Cluster *const pNewCluster);
47 void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster);
48 void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const;
49 void PrepareInputClusters(pandora::ClusterList &preparedClusterList);
50
51private:
56 {
57 public:
65 XSampling(const TwoDSlidingFitResult &fitResultU, const TwoDSlidingFitResult &fitResultV, const TwoDSlidingFitResult &fitResultW);
66
75 pandora::StatusCode GetBin(const float x, int &xBin) const;
76
77 float m_uMinX;
78 float m_uMaxX;
79 float m_vMinX;
80 float m_vMaxX;
81 float m_wMinX;
82 float m_wMaxX;
83 float m_minX;
84 float m_maxX;
86 float m_nPoints;
87 };
88
89 void TidyUp();
90
96 void AddToSlidingFitCache(const pandora::Cluster *const pCluster);
97
103 void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster);
104
105 void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW);
106
115 pandora::StatusCode CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV,
116 const pandora::Cluster *const pClusterW, ShowerOverlapResult &overlapResult);
117
118 typedef std::pair<ShowerPositionMap, ShowerPositionMap> ShowerPositionMapPair;
119
131 void GetShowerPositionMaps(const TwoDSlidingShowerFitResult &fitResultU, const TwoDSlidingShowerFitResult &fitResultV,
132 const TwoDSlidingShowerFitResult &fitResultW, const XSampling &xSampling, ShowerPositionMapPair &positionMapsU,
133 ShowerPositionMapPair &positionMapsV, ShowerPositionMapPair &positionMapsW) const;
134
144 void GetBestHitOverlapFraction(const pandora::Cluster *const pCluster, const XSampling &xSampling,
145 const ShowerPositionMapPair &positionMaps, unsigned int &nSampledHits, unsigned int &nMatchedHits) const;
146
149
150 typedef std::vector<ShowerTensorTool *> TensorToolVector;
153
154 unsigned int m_slidingFitWindow;
156
158 unsigned int m_minClusterCaloHits;
160
164};
165
166//------------------------------------------------------------------------------------------------------------------------------------------
167
172{
173public:
175 typedef std::vector<TensorType::ElementList::const_iterator> IteratorList;
176
185 virtual bool Run(ThreeViewShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor) = 0;
186};
187
188} // namespace lar_content
189
190#endif // #ifndef LAR_THREE_VIEW_SHOWERS_ALGORITHM_H
Header file for the algorithm class.
Header file for the lar shower overlap result class.
Header file for the lar two dimensional sliding shower fit result class.
Header file for the n view matching algorithm class.
Header file for the three view matching control class.
std::vector< TensorType::ElementList::const_iterator > IteratorList
virtual bool Run(ThreeViewShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor)=0
Run the algorithm tool.
ThreeViewShowersAlgorithm::MatchingType::TensorType TensorType
float m_minX
The min x value of the common x-overlap range.
float m_nPoints
The number of sampling points to be used.
float m_maxX
The max x value of the common x-overlap range.
pandora::StatusCode GetBin(const float x, int &xBin) const
Convert an x position into a sampling bin.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
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.
void PrepareInputClusters(pandora::ClusterList &preparedClusterList)
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.
void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster)
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache.
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
std::pair< ShowerPositionMap, ShowerPositionMap > ShowerPositionMapPair
std::vector< ShowerTensorTool * > TensorToolVector
TensorToolVector m_algorithmToolVector
The algorithm tool vector.
float m_minShowerMatchedFraction
The minimum shower matched sampling fraction to allow shower grouping.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
void GetShowerPositionMaps(const TwoDSlidingShowerFitResult &fitResultU, const TwoDSlidingShowerFitResult &fitResultV, const TwoDSlidingShowerFitResult &fitResultW, const XSampling &xSampling, ShowerPositionMapPair &positionMapsU, ShowerPositionMapPair &positionMapsV, ShowerPositionMapPair &positionMapsW) const
Get the shower position maps.
void TidyUp()
Tidy member variables in derived class.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
bool m_ignoreUnavailableClusters
Whether to ignore (skip-over) unavailable clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void AddToSlidingFitCache(const pandora::Cluster *const pCluster)
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
const TwoDSlidingShowerFitResult & GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const
Get a sliding shower fit result from the algorithm cache.
void GetBestHitOverlapFraction(const pandora::Cluster *const pCluster, const XSampling &xSampling, const ShowerPositionMapPair &positionMaps, unsigned int &nSampledHits, unsigned int &nMatchedHits) const
Get the best fraction of hits, in the common x-overlap range, contained within the provided pair of s...
unsigned int m_minShowerMatchedPoints
The minimum number of matched shower sampling points to allow shower grouping.
NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > > BaseAlgorithm
void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
bool m_visualize
Visualize cluster matching procedure.
AlgorithmTool class. Algorithm tools will tend to be tailored for specific parent algorithms,...
Cluster class.
Definition Cluster.h:31
std::unordered_map< const pandora::Cluster *, TwoDSlidingShowerFitResult > TwoDSlidingShowerFitResultMap
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.