TrackSplittingTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArTransverseTrackMatching/TrackSplittingTool.h
3  *
4  * @brief Header file for the track splitting tool class.
5  *
6  * $Log: $
7  */
8 #ifndef TRACK_SPLITTING_TOOL_H
9 #define TRACK_SPLITTING_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief TrackSplittingTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor);
28 
29 private:
30  /**
31  * @brief Particle class
32  */
33  class Particle
34  {
35  public:
36  /**
37  * @brief Constructor
38  *
39  * @param element the tensor element
40  */
41  Particle(const TensorType::Element &element);
42 
43  const pandora::Cluster *m_pLongCluster; ///< Address of the long cluster
44  const pandora::Cluster *m_pCluster1; ///< Address of short cluster in view 1
45  const pandora::Cluster *m_pCluster2; ///< Address of short cluster in view 2
46  float m_longMinX; ///< The min x coordinate of the long cluster
47  float m_longMaxX; ///< The max x coordinate of the long cluster
48  float m_short1MinX; ///< The min x coordinate of short cluster 1
49  float m_short1MaxX; ///< The max x coordinate of short cluster 1
50  float m_short2MinX; ///< The min x coordinate of short cluster 2
51  float m_short2MaxX; ///< The max x coordinate of short cluster 2
52  };
53 
54  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
55 
56  /**
57  * @brief Find remaining tracks, hidden by spurious track segments (and maybe other ambiguities) in the tensor
58  *
59  * @param pAlgorithm address of the calling algorithm
60  * @param overlapTensor the overlap tensor
61  * @param splitPositionMap to receive the split position map
62  */
63  void FindTracks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, SplitPositionMap &splitPositionMap) const;
64 
65  /**
66  * @brief Select a list of the relevant elements from a set of connected tensor elements
67  *
68  * @param elementList the full list of connected tensor elements
69  * @param usedClusters the list of clusters already marked as to be added to a pfo
70  * @param iteratorList to receive a list of iterators to long track-like elements
71  */
72  void SelectElements(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const;
73 
74  /**
75  * @brief Whether a provided tensor element can be used to construct a pfo
76  *
77  * @param pAlgorithm address of the calling algorithm
78  * @param element the tensor element
79  * @param isMinX whether to look for track splits at min or max x coordinate
80  * @param usedClusters the list of used clusters
81  * @param splitPositionMap to receive the split position map
82  */
83  bool PassesChecks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, const bool isMinX,
84  pandora::ClusterSet &usedClusters, SplitPositionMap &splitPositionMap) const;
85 
86  /**
87  * @brief Check a candidate split position for consistency with the associated track cluster sliding linear fit
88  *
89  * @param splitPosition the candidate split position
90  * @param splitX the split x coordinate
91  * @param longFitResult the sliding linear fit for the long cluster
92  */
93  bool CheckSplitPosition(const pandora::CartesianVector &splitPosition, const float splitX, const TwoDSlidingFitResult &longFitResult) const;
94 
95  float m_minMatchedFraction; ///< The min matched sampling point fraction for particle creation
96  unsigned int m_minMatchedSamplingPoints; ///< The min number of matched sampling points for particle creation
97  float m_minXOverlapFraction; ///< The min x overlap fraction (between long clusters and short cluster vs. shared overlap)
98  unsigned int m_minMatchedSamplingPointRatio; ///< The min ratio between 1st and 2nd highest msps for simple ambiguity resolution
99 
100  float m_maxShortDeltaXFraction; ///< Max x distance between ends of two short clusters (measured as fraction of long cluster x length)
101  float m_maxAbsoluteShortDeltaX; ///< Max x distance between ends of two short clusters (measured as an absolute distance)
102  float m_minLongDeltaXFraction; ///< Min x distance between ends of short and long clusters (measured as fraction of long cluster x length)
103  float m_minAbsoluteLongDeltaX; ///< Min x distance between ends of short and long clusters (measured as an absolute distance)
104  float m_minSplitToVertexProjection; ///< Min projected distance between split position and either inner or outer vertex of long cluster
105  float m_maxSplitVsFitPositionDistance; ///< Max allowed distance between split position and sliding linear fit position at the split x coordinate
106 };
107 
108 } // namespace lar_content
109 
110 #endif // #ifndef TRACK_SPLITTING_TOOL_H
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
bool CheckSplitPosition(const pandora::CartesianVector &splitPosition, const float splitX, const TwoDSlidingFitResult &longFitResult) const
Check a candidate split position for consistency with the associated track cluster sliding linear fit...
std::vector< TensorType::ElementList::const_iterator > IteratorList
float m_minSplitToVertexProjection
Min projected distance between split position and either inner or outer vertex of long cluster...
const pandora::Cluster * m_pCluster2
Address of short cluster in view 2.
bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
void FindTracks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, SplitPositionMap &splitPositionMap) const
Find remaining tracks, hidden by spurious track segments (and maybe other ambiguities) in the tensor...
float m_short2MinX
The min x coordinate of short cluster 2.
void SelectElements(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select a list of the relevant elements from a set of connected tensor elements.
float m_maxAbsoluteShortDeltaX
Max x distance between ends of two short clusters (measured as an absolute distance) ...
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
float m_longMinX
The min x coordinate of the long cluster.
float m_minAbsoluteLongDeltaX
Min x distance between ends of short and long clusters (measured as an absolute distance) ...
float m_maxShortDeltaXFraction
Max x distance between ends of two short clusters (measured as fraction of long cluster x length) ...
float m_minLongDeltaXFraction
Min x distance between ends of short and long clusters (measured as fraction of long cluster x length...
std::unordered_map< const pandora::Cluster *, pandora::CartesianPointVector > SplitPositionMap
Header file for the three view transverse tracks algorithm class.
TrackSplittingTool class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_longMaxX
The max x coordinate of the long cluster.
bool PassesChecks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, const bool isMinX, pandora::ClusterSet &usedClusters, SplitPositionMap &splitPositionMap) const
Whether a provided tensor element can be used to construct a pfo.
TrackSplittingTool()
Default constructor.
float m_short2MaxX
The max x coordinate of short cluster 2.
const pandora::Cluster * m_pCluster1
Address of short cluster in view 1.
float m_short1MaxX
The max x coordinate of short cluster 1.
float m_minXOverlapFraction
The min x overlap fraction (between long clusters and short cluster vs. shared overlap) ...
unsigned int m_minMatchedSamplingPointRatio
The min ratio between 1st and 2nd highest msps for simple ambiguity resolution.
float m_short1MinX
The min x coordinate of short cluster 1.
float m_maxSplitVsFitPositionDistance
Max allowed distance between split position and sliding linear fit position at the split x coordinate...
const pandora::Cluster * m_pLongCluster
Address of the long cluster.
Particle(const TensorType::Element &element)
Constructor.