CrossedTrackSplittingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArTwoDReco/LArClusterSplitting/CrossedTrackSplittingAlgorithm.h
3  *
4  * @brief Header file for the crossed track splitting algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CROSSED_TRACK_SPLITTING_ALGORITHM_H
9 #define LAR_CROSSED_TRACK_SPLITTING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
15 namespace lar_content
16 {
17 
18 template <typename, unsigned int>
19 class KDTreeLinkerAlgo;
20 template <typename, unsigned int>
21 class KDTreeNodeInfoT;
22 
23 //------------------------------------------------------------------------------------------------------------------------------------------
24 
25 /**
26  * @brief CrossedTrackSplittingAlgorithm class
27  */
29 {
30 public:
31  /**
32  * @brief Default constructor
33  */
35 
36 private:
39  typedef std::vector<HitKDNode2D> HitKDNode2DList;
40 
41  typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterSet> ClusterToClustersMap;
42  typedef std::unordered_map<const pandora::CaloHit *, const pandora::Cluster *> HitToClusterMap;
43 
44  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
45  pandora::StatusCode PreparationStep(const pandora::ClusterVector &clusterVector);
46  pandora::StatusCode TidyUpStep();
47  pandora::StatusCode FindBestSplitPosition(const TwoDSlidingFitResult &slidingFit1, const TwoDSlidingFitResult &slidingFit2,
48  pandora::CartesianVector &splitPosition, pandora::CartesianVector &direction1, pandora::CartesianVector &direction2) const;
49 
50  /**
51  * @brief Find average positions of pairs of hits within a maximum separation
52  *
53  * @param pCluster1 the first cluster
54  * @param pCluster2 the second cluster
55  * @param candidateVector to receive the average positions
56  */
57  void FindCandidateSplitPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
58  pandora::CartesianPointVector &candidateVector) const;
59 
60  float m_maxClusterSeparation; ///< maximum separation of two clusters
61  float m_maxClusterSeparationSquared; ///< maximum separation of two clusters (squared)
62  float m_minCosRelativeAngle; ///< maximum relative angle between tracks after un-crossing
63 
64  float m_searchRegion1D; ///< Search region, applied to each dimension, for look-up from kd-trees
65  ClusterToClustersMap m_nearbyClusters; ///< The nearby clusters map
66 };
67 
68 } // namespace lar_content
69 
70 #endif // #ifndef LAR_CROSSED_TRACK_SPLITTING_ALGORITHM_H
pandora::StatusCode FindBestSplitPosition(const TwoDSlidingFitResult &slidingFit1, const TwoDSlidingFitResult &slidingFit2, pandora::CartesianVector &splitPosition, pandora::CartesianVector &direction1, pandora::CartesianVector &direction2) const
Find the best split position and direction for a pair of clusters.
float m_minCosRelativeAngle
maximum relative angle between tracks after un-crossing
float m_maxClusterSeparationSquared
maximum separation of two clusters (squared)
Data stored in each KDTree node. The dim1/dim2 fields are usually the duplication of some PFRecHit va...
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
pandora::StatusCode TidyUpStep()
Tidy up any information cached in e.g. the preparation step.
void FindCandidateSplitPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::CartesianPointVector &candidateVector) const
Find average positions of pairs of hits within a maximum separation.
pandora::StatusCode PreparationStep(const pandora::ClusterVector &clusterVector)
Perform any preparatory actions, such as caching information for subsequent expensive calculations...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_maxClusterSeparation
maximum separation of two clusters
std::unordered_map< const pandora::Cluster *, pandora::ClusterSet > ClusterToClustersMap
ClusterToClustersMap m_nearbyClusters
The nearby clusters map.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-trees.
Header file for the two dimensional sliding fit splitting and switching algorithm class...