LArTrackOverlapResult.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArTrackOverlapResult.h
3  *
4  * @brief Header file for the lar track overlap result class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_TRACK_OVERLAP_RESULT_H
9 #define LAR_TRACK_OVERLAP_RESULT_H 1
10 
11 #include "Pandora/PandoraInputTypes.h"
12 #include "Pandora/StatusCodes.h"
13 
15 
16 #include <cmath>
17 #include <vector>
18 
19 namespace lar_content
20 {
21 
22 /**
23  * @brief TrackOverlapResult class
24  */
26 {
27 public:
28  /**
29  * @brief Default constructor
30  */
32 
33  /**
34  * @brief Constructor
35  *
36  * @param nMatchedSamplingPoints
37  * @param nSamplingPoints
38  * @param chi2
39  */
40  TrackOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2);
41 
42  /**
43  * @brief Copy constructor
44  *
45  * @param rhs
46  */
48 
49  /**
50  * @brief Destructor
51  */
52  virtual ~TrackOverlapResult();
53 
54  /**
55  * @brief Whether the track overlap result has been initialized
56  *
57  * @return boolean
58  */
59  bool IsInitialized() const;
60 
61  /**
62  * @brief Get the number of matched sampling points
63  *
64  * @return the number of matched sampling points
65  */
66  unsigned int GetNMatchedSamplingPoints() const;
67 
68  /**
69  * @brief Get the number of sampling points
70  *
71  * @return the number of sampling points
72  */
73  unsigned int GetNSamplingPoints() const;
74 
75  /**
76  * @brief Get the fraction of sampling points resulting in a match
77  *
78  * @return the fraction of sampling points resulting in a match
79  */
80  float GetMatchedFraction() const;
81 
82  /**
83  * @brief Get the absolute chi2 value
84  *
85  * @return the absolute chi2 value
86  */
87  float GetChi2() const;
88 
89  /**
90  * @brief Get the chi2 per samping point value
91  *
92  * @return the chi2 per samping point value
93  */
94  float GetReducedChi2() const;
95 
96  /**
97  * @brief Track overlap result less than operator
98  *
99  * @param rhs the track overlap result for comparison
100  */
101  bool operator<(const TrackOverlapResult &rhs) const;
102 
103  /**
104  * @brief Track overlap result greater than operator
105  *
106  * @param rhs the track overlap result for comparison
107  */
108  bool operator>(const TrackOverlapResult &rhs) const;
109 
110  /**
111  * @brief Track overlap result assigment operator
112  *
113  * @param rhs the track overlap result to assign
114  */
116 
117 protected:
118  bool m_isInitialized; ///< Whether the track overlap result has been initialized
119  unsigned int m_nMatchedSamplingPoints; ///< The number of matched sampling points
120  unsigned int m_nSamplingPoints; ///< The number of sampling points
121  float m_matchedFraction; ///< The fraction of sampling points resulting in a match
122  float m_chi2; ///< The absolute chi2 value
123  float m_reducedChi2; ///< The chi2 per samping point value
124 };
125 
126 //------------------------------------------------------------------------------------------------------------------------------------------
127 
128 /**
129  * @brief TransverseOverlapResult class
130  */
132 {
133 public:
134  /**
135  * @brief Default constructor
136  */
138 
139  /**
140  * @brief Constructor
141  *
142  * @param nMatchedSamplingPoints
143  * @param nSamplingPoints
144  * @param chi2
145  * @param xOverlap
146  */
147  TransverseOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2, const XOverlap &xOverlap);
148 
149  /**
150  * @brief Copy constructor
151  *
152  * @param rhs
153  */
155 
156  /**
157  * @brief Destructor
158  */
160 
161  /**
162  * @brief Get the x overlap object
163  *
164  * @return the x overlap object
165  */
166  const XOverlap &GetXOverlap() const;
167 
168  /**
169  * @brief Track overlap result assigment operator
170  *
171  * @param rhs the track overlap result to assign
172  */
174 
175 private:
176  XOverlap m_xOverlap; ///< The x overlap object
177 };
178 
179 typedef std::vector<TransverseOverlapResult> TransverseOverlapResultVector;
180 
181 /**
182  * @brief Transverse overlap result + operator
183  *
184  * @param lhs the first transverse overlap result to add
185  * @param rhs the second transverse overlap result to add
186  */
188 
189 //------------------------------------------------------------------------------------------------------------------------------------------
190 
191 /**
192  * @brief LongitudinalOverlapResult class
193  */
195 {
196 public:
197  /**
198  * @brief Default constructor
199  */
201 
202  /**
203  * @brief Constructor
204  *
205  * @param trackOverlapResult
206  * @param innerChi2
207  * @param outerChi2
208  */
209  LongitudinalOverlapResult(const TrackOverlapResult trackOverlapResult, const float innerChi2, const float outerChi2);
210 
211  /**
212  * @brief Constructor
213  *
214  * @param nMatchedSamplingPoints
215  * @param nSamplingPoints
216  * @param chi2
217  * @param innerChi2
218  * @param outerChi2
219  */
220  LongitudinalOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
221  const float innerChi2, const float outerChi2);
222 
223  /**
224  * @brief Copy constructor
225  *
226  * @param rhs
227  */
229 
230  /**
231  * @brief Destructor
232  */
234 
235  /**
236  * @brief
237  *
238  * @return
239  */
240  float GetInnerChi2() const;
241 
242  /**
243  * @brief
244  *
245  * @return
246  */
247  float GetOuterChi2() const;
248 
249  /**
250  * @brief Track overlap result assigment operator
251  *
252  * @param rhs the track overlap result to assign
253  */
255 
256 private:
257  float m_innerChi2; ///< The inner chi squared
258  float m_outerChi2; ///< The outer chi squared
259 };
260 
261 typedef std::vector<LongitudinalOverlapResult> LongitudinalOverlapResultVector;
262 
263 //------------------------------------------------------------------------------------------------------------------------------------------
264 
265 /**
266  * @brief FragmentOverlapResult class
267  */
269 {
270 public:
271  /**
272  * @brief Default constructor
273  */
275 
276  /**
277  * @brief Constructor
278  *
279  * @param trackOverlapResult
280  * @param caloHitList
281  * @param clusterList
282  */
283  FragmentOverlapResult(const TrackOverlapResult trackOverlapResult, const pandora::CaloHitList &caloHitList, const pandora::ClusterList &clusterList);
284 
285  /**
286  * @brief Constructor
287  *
288  * @param nMatchedSamplingPoints
289  * @param nSamplingPoints
290  * @param chi2
291  * @param caloHitList
292  * @param clusterList
293  */
294  FragmentOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
295  const pandora::CaloHitList &caloHitList, const pandora::ClusterList &clusterList);
296 
297  /**
298  * @brief Copy constructor
299  *
300  * @param rhs
301  */
303 
304  /**
305  * @brief Destructor
306  */
308 
309  /**
310  * @brief Get the list of fragment-associated hits
311  *
312  * @return the list of fragment-associated hits
313  */
314  const pandora::CaloHitList &GetFragmentCaloHitList() const;
315 
316  /**
317  * @brief Get the list of fragment-associated clusters
318  *
319  * @return the list of fragment-associated clusters
320  */
321  const pandora::ClusterList &GetFragmentClusterList() const;
322 
323  /**
324  * @brief Get the fragment hit type
325  *
326  * @return the fragment hit type
327  */
328  pandora::HitType GetFragmentHitType() const;
329 
330  /**
331  * @brief Fragments overlap result assigment operator
332  *
333  * @param rhs the track overlap result to assign
334  */
336 
337 private:
338  pandora::CaloHitList m_caloHitList; ///< The list of fragment-associated hits
339  pandora::ClusterList m_clusterList; ///< The list of fragment-associated clusters
340 };
341 
342 typedef std::vector<FragmentOverlapResult> FragmentOverlapResultVector;
343 
344 //------------------------------------------------------------------------------------------------------------------------------------------
345 
346 /**
347  * @brief DeltaRayOverlapResult class
348  */
350 {
351 public:
352  /**
353  * @brief Default constructor
354  */
356 
357  /**
358  * @brief Constructor
359  *
360  * @param nMatchedSamplingPoints
361  * @param nSamplingPoints
362  * @param chi2
363  * @param xOverlap
364  * @param commonMuonPfoList the list of cosmic ray pfos that, in each view, lie close to the clusters of the tensor element
365  */
366  DeltaRayOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
367  const XOverlap &xOverlap, const pandora::PfoList &commonMuonPfoList);
368 
369  /**
370  * @brief Copy constructor
371  *
372  * @param rhs
373  */
375 
376  /**
377  * @brief Destructor
378  */
379  virtual ~DeltaRayOverlapResult();
380 
381  /**
382  * @brief Get the common muon pfo list
383  *
384  * @return the common muon pfo list
385  */
386  const pandora::PfoList &GetCommonMuonPfoList() const;
387 
388  /**
389  * @brief Track overlap result assigment operator
390  *
391  * @param rhs the track overlap result to assign
392  */
394 
395 private:
396  pandora::PfoList m_commonMuonPfoList; ///< The list of cosmic ray pfos that, in each view, lie close to the clusters of the tensor element
397 };
398 
399 typedef std::vector<DeltaRayOverlapResult> DeltaRayOverlapResultVector;
400 
401 //------------------------------------------------------------------------------------------------------------------------------------------
402 //------------------------------------------------------------------------------------------------------------------------------------------
403 
405 {
406  return m_isInitialized;
407 }
408 
409 //------------------------------------------------------------------------------------------------------------------------------------------
410 
412 {
413  if (m_isInitialized)
415 
416  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
417 }
418 
419 //------------------------------------------------------------------------------------------------------------------------------------------
420 
421 inline unsigned int TrackOverlapResult::GetNSamplingPoints() const
422 {
423  if (m_isInitialized)
424  return m_nSamplingPoints;
425 
426  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
427 }
428 
429 //------------------------------------------------------------------------------------------------------------------------------------------
430 
432 {
433  if (m_isInitialized)
434  return m_matchedFraction;
435 
436  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
437 }
438 
439 //------------------------------------------------------------------------------------------------------------------------------------------
440 
441 inline float TrackOverlapResult::GetChi2() const
442 {
443  if (m_isInitialized)
444  return m_chi2;
445 
446  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
447 }
448 
449 //------------------------------------------------------------------------------------------------------------------------------------------
450 
452 {
453  if (m_isInitialized)
454  return m_reducedChi2;
455 
456  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
457 }
458 
459 //------------------------------------------------------------------------------------------------------------------------------------------
460 //------------------------------------------------------------------------------------------------------------------------------------------
461 
463 {
464  if (m_isInitialized)
465  return m_xOverlap;
466 
467  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
468 }
469 
470 //------------------------------------------------------------------------------------------------------------------------------------------
471 //------------------------------------------------------------------------------------------------------------------------------------------
472 
474 {
475  return m_innerChi2;
476 }
477 
478 //------------------------------------------------------------------------------------------------------------------------------------------
479 
481 {
482  return m_outerChi2;
483 }
484 
485 //------------------------------------------------------------------------------------------------------------------------------------------
486 //------------------------------------------------------------------------------------------------------------------------------------------
487 
488 inline const pandora::CaloHitList &FragmentOverlapResult::GetFragmentCaloHitList() const
489 {
490  return m_caloHitList;
491 }
492 
493 //------------------------------------------------------------------------------------------------------------------------------------------
494 
495 inline const pandora::ClusterList &FragmentOverlapResult::GetFragmentClusterList() const
496 {
497  return m_clusterList;
498 }
499 
500 //------------------------------------------------------------------------------------------------------------------------------------------
501 //------------------------------------------------------------------------------------------------------------------------------------------
502 
503 inline const pandora::PfoList &DeltaRayOverlapResult::GetCommonMuonPfoList() const
504 {
505  return m_commonMuonPfoList;
506 }
507 
508 } // namespace lar_content
509 
510 #endif // #ifndef LAR_TRACK_OVERLAP_RESULT_H
LongitudinalOverlapResult class.
pandora::ClusterList m_clusterList
The list of fragment-associated clusters.
float m_chi2
The absolute chi2 value.
FragmentOverlapResult class.
unsigned int GetNMatchedSamplingPoints() const
Get the number of matched sampling points.
enum cvn::HType HitType
bool IsInitialized() const
Whether the track overlap result has been initialized.
std::vector< FragmentOverlapResult > FragmentOverlapResultVector
virtual ~TrackOverlapResult()
Destructor.
TrackOverlapResult()
Default constructor.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_outerChi2
The outer chi squared.
std::vector< TransverseOverlapResult > TransverseOverlapResultVector
float m_innerChi2
The inner chi squared.
bool operator<(const TrackOverlapResult &rhs) const
Track overlap result less than operator.
const XOverlap & GetXOverlap() const
Get the x overlap object.
TransverseOverlapResult operator+(const TransverseOverlapResult &lhs, const TransverseOverlapResult &rhs)
Transverse overlap result + operator.
const pandora::CaloHitList & GetFragmentCaloHitList() const
Get the list of fragment-associated hits.
unsigned int GetNSamplingPoints() const
Get the number of sampling points.
float GetMatchedFraction() const
Get the fraction of sampling points resulting in a match.
const pandora::PfoList & GetCommonMuonPfoList() const
Get the common muon pfo list.
DeltaRayOverlapResult class.
TransverseOverlapResult class.
float GetReducedChi2() const
Get the chi2 per samping point value.
TrackOverlapResult class.
TrackOverlapResult & operator=(const TrackOverlapResult &rhs)
Track overlap result assigment operator.
std::vector< DeltaRayOverlapResult > DeltaRayOverlapResultVector
std::vector< LongitudinalOverlapResult > LongitudinalOverlapResultVector
Header file for the lar x overlap class.
bool operator>(const TrackOverlapResult &rhs) const
Track overlap result greater than operator.
float m_reducedChi2
The chi2 per samping point value.
pandora::PfoList m_commonMuonPfoList
The list of cosmic ray pfos that, in each view, lie close to the clusters of the tensor element...
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
XOverlap class.
Definition: LArXOverlap.h:17
const pandora::ClusterList & GetFragmentClusterList() const
Get the list of fragment-associated clusters.
float GetChi2() const
Get the absolute chi2 value.
pandora::CaloHitList m_caloHitList
The list of fragment-associated hits.
XOverlap m_xOverlap
The x overlap object.