TracksCrossingGapsTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArTransverseTrackMatching/TracksCrossingGapsTool.h
3  *
4  * @brief Header file for the long tracks tool class.
5  *
6  * $Log: $
7  */
8 #ifndef TRACKS_CROSSING_GAPS_TOOL_H
9 #define TRACKS_CROSSING_GAPS_TOOL_H 1
10 
13 
14 namespace lar_content
15 {
16 
17 /**
18  * @brief TracksCrossingGapsTool class
19  */
21 {
22 public:
23  /**
24  * @brief Default constructor
25  */
27 
28  bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor);
29 
30 private:
31  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
32 
33  /**
34  * @brief Find tracks crossing gaps, with unambiguous connection but poor overlap due to gaps
35  *
36  * @param pAlgorithm address of the calling algorithm
37  * @param overlapTensor the overlap tensor
38  * @param protoParticleVector to receive the list of proto particles
39  */
40  void FindTracks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const;
41 
42  /**
43  * @brief Select a list of track-like elements crossing a gap in one or more views from a set of connected tensor elements
44  *
45  * @param pAlgorithm address of the calling algorithm
46  * @param elementList the full list of connected tensor elements
47  * @param usedClusters the set of clusters already marked as to be added to a pfo
48  * @param iteratorList to receive a list of iterators to long track-like elements
49  */
50  void SelectElements(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList,
51  const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const;
52 
53  /**
54  * @brief Calculate the effective overlap fractions given a set of clusters, taking gaps into account
55  *
56  * @param pAlgorithm address of the calling algorithm
57  * @param element the connected tensor element
58  * @param xOverlapFractionU to receive the effective overlap fraction in the u view
59  * @param xOverlapFractionV to receive the effective overlap fraction in the v view
60  * @param xOverlapFractionW to receive the effective overlap fraction in the w view
61  */
62  void CalculateEffectiveOverlapFractions(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element,
63  float &xOverlapFractionU, float &xOverlapFractionV, float &xOverlapFractionW) const;
64 
65  /**
66  * @brief Calculate the effective overlap span given a set of clusters, taking gaps into account
67  *
68  * @param pAlgorithm address of the calling algorithm
69  * @param element the connected tensor element
70  * @param xMinEffU to receive the effective min u coordinate
71  * @param xMaxEffU to receive the effective max u coordinate
72  * @param xMinEffV to receive the effective min v coordinate
73  * @param xMaxEffV to receive the effective max v coordinate
74  * @param xMinEffW to receive the effective min w coordinate
75  * @param xMaxEffW to receive the effective max w coordinate
76  */
77  void CalculateEffectiveOverlapSpan(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element,
78  float &xMinEffU, float &xMaxEffU, float &xMinEffV, float &xMaxEffV, float &xMinEffW, float &xMaxEffW) const;
79 
80  /**
81  * @brief Check whether there is any gap in the three U-V-W clusters combination
82  *
83  * @param pAlgorithm address of the calling algorithm
84  * @param element the connected tensor element
85  * @param xSample the x sampling position
86  * @param gapInU to receive whether there is a gap in the u view
87  * @param gapInV to receive whether there is a gap in the v view
88  * @param gapInW to receive whether there is a gap in the w view
89  *
90  * @return boolean
91  */
92  bool PassesGapChecks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, const float xSample,
93  bool &gapInU, bool &gapInV, bool &gapInW) const;
94 
95  /**
96  * @brief Check individually each cluster where a gap might be present
97  *
98  * @param xSample, the x coordinate we are checking
99  * @param slidingFitResult1 the sliding fit result for the cluster in view 1
100  * @param slidingFitResult2 the sliding fit result for the cluster in view 2
101  * @param slidingFitResult3 the sliding fit result for the cluster in view 3
102  * @param gapIn1 whether there is a gap in view 1
103  * @param gapIn2 whether there is a gap in view 2
104  * @param gapIn3 whether there is a gap in view 3
105  *
106  * @return boolean
107  */
108  bool CheckXPositionInGap(const float xSample, const TwoDSlidingFitResult &slidingFitResult1, const TwoDSlidingFitResult &slidingFitResult2,
109  const TwoDSlidingFitResult &slidingFitResult3, bool &gapIn1, bool &gapIn2, bool &gapIn3) const;
110 
111  /**
112  * @brief Check whether a x position is at the end of the cluster
113  *
114  * @param xSample, the x coordinate of the point tested
115  * @param pCluster the cluster we are interrogating for its extreme coordinates
116  *
117  * @return boolean
118  */
119  bool IsEndOfCluster(const float xSample, const TwoDSlidingFitResult &slidingFitResult) const;
120 
121  float m_minMatchedFraction; ///< The min matched sampling point fraction for particle creation
122  unsigned int m_minMatchedSamplingPoints; ///< The min number of matched sampling points for particle creation
123  float m_minXOverlapFraction; ///< The min x overlap fraction (in each view) for particle creation
124  unsigned int m_minMatchedSamplingPointRatio; ///< The min ratio between 1st and 2nd highest msps for simple ambiguity resolution
125  float m_maxGapTolerance; ///< The max gap tolerance
126  float m_sampleStepSize; ///< The sampling step size used in association checks, units cm
127  unsigned int m_maxAngleRatio; ///< The max ratio allowed in the angle
128 };
129 
130 } // namespace lar_content
131 
132 #endif // #ifndef LONG_TRACKS_TOOL_H
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
std::vector< ProtoParticle > ProtoParticleVector
void CalculateEffectiveOverlapSpan(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, float &xMinEffU, float &xMaxEffU, float &xMinEffV, float &xMaxEffV, float &xMinEffW, float &xMaxEffW) const
Calculate the effective overlap span given a set of clusters, taking gaps into account.
void CalculateEffectiveOverlapFractions(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, float &xOverlapFractionU, float &xOverlapFractionV, float &xOverlapFractionW) const
Calculate the effective overlap fractions given a set of clusters, taking gaps into account...
float m_maxGapTolerance
The max gap tolerance.
std::vector< TensorType::ElementList::const_iterator > IteratorList
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
void FindTracks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find tracks crossing gaps, with unambiguous connection but poor overlap due to gaps.
void SelectElements(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select a list of track-like elements crossing a gap in one or more views from a set of connected tens...
unsigned int m_minMatchedSamplingPointRatio
The min ratio between 1st and 2nd highest msps for simple ambiguity resolution.
bool CheckXPositionInGap(const float xSample, const TwoDSlidingFitResult &slidingFitResult1, const TwoDSlidingFitResult &slidingFitResult2, const TwoDSlidingFitResult &slidingFitResult3, bool &gapIn1, bool &gapIn2, bool &gapIn3) const
Check individually each cluster where a gap might be present.
bool IsEndOfCluster(const float xSample, const TwoDSlidingFitResult &slidingFitResult) const
Check whether a x position is at the end of the cluster.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
TracksCrossingGapsTool class.
Header file for the three view transverse tracks algorithm class.
bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
bool PassesGapChecks(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, const float xSample, bool &gapInU, bool &gapInV, bool &gapInW) const
Check whether there is any gap in the three U-V-W clusters combination.
unsigned int m_maxAngleRatio
The max ratio allowed in the angle.
Header file for the lar track overlap result class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_sampleStepSize
The sampling step size used in association checks, units cm.