LArTrackTwoViewOverlapResult.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArTrackTwoViewOverlapResult.h
3  *
4  * @brief Header file for the lar track two view overlap result class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_TRACK_TWO_VIEW_OVERLAP_RESULT_H
9 #define LAR_TRACK_TWO_VIEW_OVERLAP_RESULT_H 1
10 
11 #include "Pandora/StatusCodes.h"
12 
15 
16 #include <vector>
17 
18 namespace lar_content
19 {
20 /**
21  * @brief TwoViewDeltaRayOverlapResult class
22  */
24 {
25 public:
26  /**
27  * @brief Default constructor
28  */
30 
31  /**
32  * @brief Constructor
33  *
34  * @param xOverlap the xOverlap of the two clusters
35  * @param commonMuonPfoList the list of muon pfos whose clusters lie close to delta ray clusters in all views
36  * @param pBestMatchedCluster the largest cluster that lies on the projected hits
37  * @param matchedClusterList the list of clusters that lie on the projected hits
38  * @param reducedChiSquared the reduced chi squared
39  */
40  TwoViewDeltaRayOverlapResult(const TwoViewXOverlap &xOverlap, const pandora::PfoList &commonMuonPfoList,
41  const pandora::Cluster *const pBestMatchedCluster, const pandora::ClusterList &matchedClusterList, const float reducedChiSquared);
42 
43  /**
44  * @brief Copy constructor
45  *
46  * @param rhs
47  */
49 
50  /**
51  * @brief Destructor
52  */
54 
55  /**
56  * @brief Whether the track overlap result has been initialized
57  *
58  * @return boolean
59  */
60  bool IsInitialized() const;
61 
62  /**
63  * @brief Get the x overlap object
64  *
65  * @return the x overlap object
66  */
67  const TwoViewXOverlap &GetXOverlap() const;
68 
69  /**
70  * @brief Get the best matched cluster
71  *
72  * @return the best matched cluster
73  */
74  const pandora::Cluster *GetBestMatchedCluster() const;
75 
76  /**
77  * @brief Get the common muon pfo list
78  *
79  * @return the common muon pfo list
80  */
81  const pandora::PfoList &GetCommonMuonPfoList() const;
82 
83  /**
84  * @brief Get the matched cluster list
85  *
86  * @return the matched cluster list
87  */
88  const pandora::ClusterList &GetMatchedClusterList() const;
89 
90  /**
91  * @brief Get the reduced chi squared value
92  *
93  * @return the reduced chi squared value
94  */
95  float GetReducedChiSquared() const;
96 
97  /**
98  * @brief Get the best matched available cluster
99  *
100  * @return the best matched available cluster
101  */
102  const pandora::Cluster *GetBestMatchedAvailableCluster() const;
103 
104  /**
105  * @brief Track overlap result assigment operator
106  *
107  * @param rhs the track overlap result to assign
108  */
110 
111  /**
112  * @brief Track two view overlap result less than operator
113  *
114  * @param rhs the track two view overlap result for comparison
115  */
116  bool operator<(const TwoViewDeltaRayOverlapResult &rhs) const;
117 
118 private:
119  bool m_isInitialized; ///< Whether the two view delta ray overlap result has been initialized
120  TwoViewXOverlap m_xOverlap; ///< The x overlap object
121  pandora::PfoList m_commonMuonPfoList; ///< The list of muon pfos whose clusters lie close to delta ray clusters in all views
122  const pandora::Cluster *m_pBestMatchedCluster; ///< The largest cluster that lies on the projected hits
123  pandora::ClusterList m_matchedClusterList; ///< The list of clusters that lie on the projected hits
124  float m_reducedChiSquared; ///< The reduced chi squared of the best matched cluster
125 };
126 
127 //------------------------------------------------------------------------------------------------------------------------------------------
128 
129 /**
130  * @brief TrackTwoViewOverlapResult class
131  */
133 {
134 public:
135  /**
136  * @brief Default constructor
137  */
139 
140  /**
141  * @brief constructor
142  *
143  * @param matchingScore
144  */
145  TrackTwoViewOverlapResult(const float matchingScore);
146 
147  /**
148  * @brief Copy constructor
149  *
150  * @param rhs
151  */
153 
154  /**
155  * @brief Destructor
156  */
157  virtual ~TrackTwoViewOverlapResult();
158 
159  /**
160  * @brief Whether the track overlap result has been initialized
161  *
162  * @return boolean
163  */
164  bool IsInitialized() const;
165 
166  /**
167  * @brief Get the matching score of the overlap result
168  *
169  * @return matching score
170  */
171  float GetMatchingScore() const;
172 
173  /**
174  * @brief Track two view overlap result less than operator
175  *
176  * @param rhs the track two view overlap result for comparison
177  */
178  bool operator<(const TrackTwoViewOverlapResult &rhs) const;
179 
180  /**
181  * @brief Track two view overlap result greater than operator
182  *
183  * @param rhs the track two view overlap result for comparison
184  */
185  bool operator>(const TrackTwoViewOverlapResult &rhs) const;
186 
187  /**
188  * @brief Track overlap result assigment operator
189  *
190  * @param rhs the track overlap result to assign
191  */
193 
194 protected:
195  bool m_isInitialized; ///< Whether the track overlap result has been initialized
196  float m_matchingScore; ///< The compatability score for the two objects associated with the overlap result
197 };
198 
199 //------------------------------------------------------------------------------------------------------------------------------------------
200 
201 /**
202  * @brief TwoViewTransverseOverlapResult class
203  */
205 {
206 public:
207  /**
208  * @brief Default constructor
209  */
211 
212  /**
213  * @brief Constructor
214  *
215  * @param matchingScore the matching candidate matching score
216  * @param downsamplingFactor the downsampling factor
217  * @param nSamplingPoints the number of sampling points used in the matching
218  * @param nMatchedSamplingPoints the number of matched sampling points
219  * @param correlationCoefficient the corerlation coefficient for the matching candidate
220  * @param twoViewXOverlap the description of the geometrical overlap for the matching candidate
221  */
222  TwoViewTransverseOverlapResult(const float matchingScore, const float downsamplingFactor, const unsigned int nSamplingPoints,
223  const unsigned int nMatchedSamplingPoints, const float correlationCoefficient, const TwoViewXOverlap &twoViewXOverlap);
224 
225  /**
226  * @brief Copy constructor
227  *
228  * @param rhs the rhs
229  */
231 
232  /**
233  * @brief Destructor
234  */
236 
237  /**
238  * @brief Get the number of sampling points
239  *
240  * @return the number of sampling points
241  */
242  unsigned int GetNSamplingPoints() const;
243 
244  /**
245  * @brief Get the number of matched sampling points
246  *
247  * @return the number of matched sampling points
248  */
249  unsigned int GetNMatchedSamplingPoints() const;
250 
251  /**
252  * @brief Get the number of re-upsampled sampling points
253  *
254  * @return the number of re-upsampled sampling points
255  */
256  unsigned int GetNReUpsampledSamplingPoints() const;
257 
258  /**
259  * @brief Get the number of matched re-upsampled sampling points
260  *
261  * @return the number of matched re-upsampled sampling points
262  */
263  unsigned int GetNMatchedReUpsampledSamplingPoints() const;
264 
265  /**
266  * @brief Get the correlation coefficient
267  *
268  * @return the correlation coefficient
269  */
270  float GetCorrelationCoefficient() const;
271 
272  /**
273  * @brief Get the locally matched fraction
274  *
275  * @return the locally matched fraction
276  */
277  float GetLocallyMatchedFraction() const;
278 
279  /**
280  * @brief Get the two view x overlap object
281  *
282  * @return the two view x overlap object
283  */
284  const TwoViewXOverlap &GetTwoViewXOverlap() const;
285 
286  /**
287  * @brief Track two view overlap result less than operator
288  *
289  * @param rhs the track two view overlap result for comparison
290  */
291  bool operator<(const TwoViewTransverseOverlapResult &rhs) const;
292 
293  /**
294  * @brief Track overlap result assigment operator
295  *
296  * @param rhs the track overlap result to assign
297  */
299 
300 private:
301  float m_downsamplingFactor; ///< The downsampling factor
302  unsigned int m_nSamplingPoints; ///< The number of sampling points
303  unsigned int m_nMatchedSamplingPoints; ///< The number of matched sampling points
304  float m_correlationCoefficient; ///< The correlation coefficient
305  TwoViewXOverlap m_twoViewXOverlap; ///< The two view x overlap object
306 };
307 
308 typedef std::vector<TwoViewTransverseOverlapResult> TwoViewTransverseOverlapResultVector;
309 
310 //------------------------------------------------------------------------------------------------------------------------------------------
311 //------------------------------------------------------------------------------------------------------------------------------------------
312 
314 {
315  return m_isInitialized;
316 }
317 
318 //------------------------------------------------------------------------------------------------------------------------------------------
319 
321 {
322  return m_xOverlap;
323 }
324 
325 //------------------------------------------------------------------------------------------------------------------------------------------
326 
327 inline const pandora::Cluster *TwoViewDeltaRayOverlapResult::GetBestMatchedCluster() const
328 {
329  return m_pBestMatchedCluster;
330 }
331 
332 //------------------------------------------------------------------------------------------------------------------------------------------
333 
334 inline const pandora::PfoList &TwoViewDeltaRayOverlapResult::GetCommonMuonPfoList() const
335 {
336  return m_commonMuonPfoList;
337 }
338 
339 //------------------------------------------------------------------------------------------------------------------------------------------
340 
341 inline const pandora::ClusterList &TwoViewDeltaRayOverlapResult::GetMatchedClusterList() const
342 {
343  return m_matchedClusterList;
344 }
345 
346 //------------------------------------------------------------------------------------------------------------------------------------------
347 
349 {
350  return m_reducedChiSquared;
351 }
352 
353 //------------------------------------------------------------------------------------------------------------------------------------------
354 //------------------------------------------------------------------------------------------------------------------------------------------
355 
357 {
358  return m_isInitialized;
359 }
360 
361 //------------------------------------------------------------------------------------------------------------------------------------------
362 
364 {
365  if (m_isInitialized)
366  return m_matchingScore;
367 
368  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
369 }
370 
371 //------------------------------------------------------------------------------------------------------------------------------------------
372 //------------------------------------------------------------------------------------------------------------------------------------------
373 
375 {
376  if (m_isInitialized)
377  return m_nSamplingPoints;
378 
379  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
380 }
381 
382 //------------------------------------------------------------------------------------------------------------------------------------------
383 
385 {
386  if (m_isInitialized)
387  return m_nMatchedSamplingPoints;
388 
389  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
390 }
391 
392 //------------------------------------------------------------------------------------------------------------------------------------------
393 
395 {
396  if (m_isInitialized)
397  return static_cast<unsigned int>(m_downsamplingFactor * static_cast<float>(m_nSamplingPoints));
398 
399  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
400 }
401 
402 //------------------------------------------------------------------------------------------------------------------------------------------
403 
405 {
406  if (m_isInitialized)
407  return static_cast<unsigned int>(m_downsamplingFactor * static_cast<float>(m_nMatchedSamplingPoints));
408 
409  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
410 }
411 
412 //------------------------------------------------------------------------------------------------------------------------------------------
413 
415 {
416  if (m_isInitialized)
417  return m_correlationCoefficient;
418 
419  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
420 }
421 
422 //------------------------------------------------------------------------------------------------------------------------------------------
423 
425 {
426  if (m_isInitialized)
427  return (m_nSamplingPoints > 0 ? static_cast<float>(m_nMatchedSamplingPoints) / static_cast<float>(m_nSamplingPoints) : 0.f);
428 
429  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
430 }
431 
432 //------------------------------------------------------------------------------------------------------------------------------------------
433 
435 {
436  if (m_isInitialized)
437  return m_twoViewXOverlap;
438 
439  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
440 }
441 
442 } // namespace lar_content
443 
444 #endif // #ifndef LAR_TRACK_TWO_VIEW_OVERLAP_RESULT_H
const TwoViewXOverlap & GetTwoViewXOverlap() const
Get the two view x overlap object.
bool IsInitialized() const
Whether the track overlap result has been initialized.
bool IsInitialized() const
Whether the track overlap result has been initialized.
float GetMatchingScore() const
Get the matching score of the overlap result.
unsigned int GetNMatchedSamplingPoints() const
Get the number of matched sampling points.
bool operator>(ScheduleID const left, ScheduleID const right) noexcept
Definition: ScheduleID.cc:53
float GetReducedChiSquared() const
Get the reduced chi squared value.
pandora::ClusterList m_matchedClusterList
The list of clusters that lie on the projected hits.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_reducedChiSquared
The reduced chi squared of the best matched cluster.
unsigned int GetNMatchedReUpsampledSamplingPoints() const
Get the number of matched re-upsampled sampling points.
float GetLocallyMatchedFraction() const
Get the locally matched fraction.
pandora::PfoList m_commonMuonPfoList
The list of muon pfos whose clusters lie close to delta ray clusters in all views.
const pandora::Cluster * GetBestMatchedAvailableCluster() const
Get the best matched available cluster.
TwoViewXOverlap m_xOverlap
The x overlap object.
const pandora::Cluster * GetBestMatchedCluster() const
Get the best matched cluster.
Header file for the lar x two view overlap class.
float GetCorrelationCoefficient() const
Get the correlation coefficient.
unsigned int GetNReUpsampledSamplingPoints() const
Get the number of re-upsampled sampling points.
float m_correlationCoefficient
The correlation coefficient.
bool operator<(const TwoViewDeltaRayOverlapResult &rhs) const
Track two view overlap result less than operator.
float m_matchingScore
The compatability score for the two objects associated with the overlap result.
TwoViewDeltaRayOverlapResult & operator=(const TwoViewDeltaRayOverlapResult &rhs)
Track overlap result assigment operator.
unsigned int GetNSamplingPoints() const
Get the number of sampling points.
Header file for the lar track overlap result class.
const pandora::Cluster * m_pBestMatchedCluster
The largest cluster that lies on the projected hits.
TwoViewXOverlap class.
unsigned int m_nSamplingPoints
The number of sampling points.
const pandora::ClusterList & GetMatchedClusterList() const
Get the matched cluster list.
std::vector< TwoViewTransverseOverlapResult > TwoViewTransverseOverlapResultVector
TwoViewXOverlap m_twoViewXOverlap
The two view x overlap object.
const pandora::PfoList & GetCommonMuonPfoList() const
Get the common muon pfo list.
bool m_isInitialized
Whether the two view delta ray overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
const TwoViewXOverlap & GetXOverlap() const
Get the x overlap object.