CrossGapsAssociationAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArTwoDReco/LArClusterAssociation/CrossGapsAssociationAlgorithm.h
3  *
4  * @brief Header file for the cross gaps association algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CROSS_GAPS_ASSOCIATION_ALGORITHM_H
9 #define LAR_CROSS_GAPS_ASSOCIATION_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
16 
17 namespace lar_content
18 {
19 
20 /**
21  * @brief CrossGapsAssociationAlgorithm class
22  */
24 {
25 public:
26  /**
27  * @brief Default constructor
28  */
30 
31 private:
32  void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const;
33  void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const;
34  bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const;
35 
36  /**
37  * @brief Determine whether two clusters are associated
38  *
39  * @param innerFitResult two dimensional sliding fit result for the inner cluster
40  * @param outerFitResult two dimensional sliding fit result for the outer cluster
41  *
42  * @return boolean
43  */
44  bool AreClustersAssociated(const TwoDSlidingFitResult &innerFitResult, const TwoDSlidingFitResult &outerFitResult) const;
45 
46  /**
47  * @brief Sample points along the extrapolation from a starting position to a target fit result to declare cluster association
48  *
49  * @param startPosition the start position
50  * @param startDirection the start direction
51  * @param targetFitResult the target fit result
52  *
53  * @return boolean
54  */
55  bool IsAssociated(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection,
56  const TwoDSlidingFitResult &targetFitResult) const;
57 
58  /**
59  * @brief Whether a sampling point lies near a target 2d sliding fit result
60  *
61  * @param samplingPoint the sampling point
62  * @param targetFitResult the target fit result
63  *
64  * @return boolean
65  */
66  bool IsNearCluster(const pandora::CartesianVector &samplingPoint, const TwoDSlidingFitResult &targetFitResult) const;
67 
68  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
69 
70  unsigned int m_minClusterHits; ///< The minimum allowed number of hits in a clean cluster
71  unsigned int m_minClusterLayers; ///< The minimum allowed number of layers for a clean cluster
72  unsigned int m_slidingFitWindow; ///< The layer window for the sliding linear fits
73  unsigned int m_maxSamplingPoints; ///< The maximum number of extension sampling points considered per association check
74  float m_sampleStepSize; ///< The sampling step size used in association checks, units cm
75  unsigned int m_maxUnmatchedSampleRun; ///< The maximum run of unmatched (and non-gap) samples to consider before stopping
76  float m_maxOnClusterDistance; ///< The maximum distance between a sampling point and sliding fit to target cluster
77  unsigned int m_minMatchedSamplingPoints; ///< Minimum number of matched sampling points to declare association
78  float m_minMatchedSamplingFraction; ///< Minimum ratio between matched sampling points and expectation to declare association
79  float m_gapTolerance; ///< The tolerance to use when querying whether a sampling point is in a gap, units cm
80 };
81 
82 } // namespace lar_content
83 
84 #endif // #ifndef LAR_CROSS_GAPS_ASSOCIATION_ALGORITHM_H
float m_minMatchedSamplingFraction
Minimum ratio between matched sampling points and expectation to declare association.
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
Populate cluster vector with subset of cluster list, containing clusters judged to be clean...
void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Populate the cluster association map.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
unsigned int m_minClusterLayers
The minimum allowed number of layers for a clean cluster.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
unsigned int m_minClusterHits
The minimum allowed number of hits in a clean cluster.
unsigned int m_maxSamplingPoints
The maximum number of extension sampling points considered per association check. ...
bool IsAssociated(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection, const TwoDSlidingFitResult &targetFitResult) const
Sample points along the extrapolation from a starting position to a target fit result to declare clus...
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
float m_gapTolerance
The tolerance to use when querying whether a sampling point is in a gap, units cm.
unsigned int m_maxUnmatchedSampleRun
The maximum run of unmatched (and non-gap) samples to consider before stopping.
Header file for the lar two dimensional sliding fit result class.
Header file for the cluster association algorithm class.
float m_maxOnClusterDistance
The maximum distance between a sampling point and sliding fit to target cluster.
unsigned int m_minMatchedSamplingPoints
Minimum number of matched sampling points to declare association.
bool AreClustersAssociated(const TwoDSlidingFitResult &innerFitResult, const TwoDSlidingFitResult &outerFitResult) const
Determine whether two clusters are associated.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
bool IsNearCluster(const pandora::CartesianVector &samplingPoint, const TwoDSlidingFitResult &targetFitResult) const
Whether a sampling point lies near a target 2d sliding fit result.
bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const
Determine which of two clusters is extremal.
float m_sampleStepSize
The sampling step size used in association checks, units cm.