LArShowerOverlapResult.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArShowerOverlapResult.h
3  *
4  * @brief Header file for the lar shower overlap result class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_SHOWER_OVERLAP_RESULT_H
9 #define LAR_SHOWER_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 ShowerOverlapResult class
24  */
26 {
27 public:
28  /**
29  * @brief Default constructor
30  */
32 
33  /**
34  * @brief Constructor
35  *
36  * @param nMatchedSamplingPoints
37  * @param nSamplingPoints
38  */
39  ShowerOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const XOverlap &xOverlap);
40 
41  /**
42  * @brief Copy constructor
43  *
44  * @param rhs
45  */
47 
48  /**
49  * @brief Destructor
50  */
52 
53  /**
54  * @brief Whether the track overlap result has been initialized
55  *
56  * @return boolean
57  */
58  bool IsInitialized() const;
59 
60  /**
61  * @brief Get the number of matched sampling points
62  *
63  * @return the number of matched sampling points
64  */
65  unsigned int GetNMatchedSamplingPoints() const;
66 
67  /**
68  * @brief Get the number of sampling points
69  *
70  * @return the number of sampling points
71  */
72  unsigned int GetNSamplingPoints() const;
73 
74  /**
75  * @brief Get the fraction of sampling points resulting in a match
76  *
77  * @return the fraction of sampling points resulting in a match
78  */
79  float GetMatchedFraction() const;
80 
81  /**
82  * @brief Get the x overlap object
83  *
84  * @return the x overlap object
85  */
86  const XOverlap &GetXOverlap() const;
87 
88  /**
89  * @brief Track overlap result less than operator
90  *
91  * @param rhs the track overlap result for comparison
92  */
93  bool operator<(const ShowerOverlapResult &rhs) const;
94 
95  /**
96  * @brief Track overlap result greater than operator
97  *
98  * @param rhs the track overlap result for comparison
99  */
100  bool operator>(const ShowerOverlapResult &rhs) const;
101 
102  /**
103  * @brief Track overlap result assigment operator
104  *
105  * @param rhs the track overlap result to assign
106  */
108 
109 protected:
110  bool m_isInitialized; ///< Whether the track overlap result has been initialized
111  unsigned int m_nMatchedSamplingPoints; ///< The number of matched sampling points
112  unsigned int m_nSamplingPoints; ///< The number of sampling points
113  float m_matchedFraction; ///< The fraction of sampling points resulting in a match
114  XOverlap m_xOverlap; ///< The x overlap object
115 };
116 
117 //------------------------------------------------------------------------------------------------------------------------------------------
118 
120 {
121  return m_isInitialized;
122 }
123 
124 //------------------------------------------------------------------------------------------------------------------------------------------
125 
127 {
128  if (m_isInitialized)
130 
131  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
132 }
133 
134 //------------------------------------------------------------------------------------------------------------------------------------------
135 
136 inline unsigned int ShowerOverlapResult::GetNSamplingPoints() const
137 {
138  if (m_isInitialized)
139  return m_nSamplingPoints;
140 
141  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
142 }
143 
144 //------------------------------------------------------------------------------------------------------------------------------------------
145 
147 {
148  if (m_isInitialized)
149  return m_matchedFraction;
150 
151  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
152 }
153 
154 //------------------------------------------------------------------------------------------------------------------------------------------
155 
157 {
158  if (m_isInitialized)
159  return m_xOverlap;
160 
161  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
162 }
163 
164 } // namespace lar_content
165 
166 #endif // #ifndef LAR_SHOWER_OVERLAP_RESULT_H
bool IsInitialized() const
Whether the track overlap result has been initialized.
ShowerOverlapResult()
Default constructor.
const XOverlap & GetXOverlap() const
Get the x overlap object.
bool operator<(const ShowerOverlapResult &rhs) const
Track overlap result less than operator.
unsigned int m_nSamplingPoints
The number of sampling points.
bool operator>(const ShowerOverlapResult &rhs) const
Track overlap result greater than operator.
float m_matchedFraction
The fraction of sampling points resulting in a match.
unsigned int GetNMatchedSamplingPoints() const
Get the number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int GetNSamplingPoints() const
Get the number of sampling points.
Header file for the lar x overlap class.
ShowerOverlapResult & operator=(const ShowerOverlapResult &rhs)
Track overlap result assigment operator.
float GetMatchedFraction() const
Get the fraction of sampling points resulting in a match.
XOverlap class.
Definition: LArXOverlap.h:17
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.