LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::ShowerOverlapResult Class Reference

ShowerOverlapResult class. More...

#include "LArShowerOverlapResult.h"

Public Member Functions

 ShowerOverlapResult ()
 Default constructor. More...
 
 ShowerOverlapResult (const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const XOverlap &xOverlap)
 Constructor. More...
 
 ShowerOverlapResult (const ShowerOverlapResult &rhs)
 Copy constructor. More...
 
 ~ShowerOverlapResult ()
 Destructor. More...
 
bool IsInitialized () const
 Whether the track overlap result has been initialized. More...
 
unsigned int GetNMatchedSamplingPoints () const
 Get the number of matched sampling points. More...
 
unsigned int GetNSamplingPoints () const
 Get the number of sampling points. More...
 
float GetMatchedFraction () const
 Get the fraction of sampling points resulting in a match. More...
 
const XOverlapGetXOverlap () const
 Get the x overlap object. More...
 
bool operator< (const ShowerOverlapResult &rhs) const
 Track overlap result less than operator. More...
 
bool operator> (const ShowerOverlapResult &rhs) const
 Track overlap result greater than operator. More...
 
ShowerOverlapResultoperator= (const ShowerOverlapResult &rhs)
 Track overlap result assigment operator. More...
 

Protected Attributes

bool m_isInitialized
 Whether the track overlap result has been initialized. More...
 
unsigned int m_nMatchedSamplingPoints
 The number of matched sampling points. More...
 
unsigned int m_nSamplingPoints
 The number of sampling points. More...
 
float m_matchedFraction
 The fraction of sampling points resulting in a match. More...
 
XOverlap m_xOverlap
 The x overlap object. More...
 

Detailed Description

ShowerOverlapResult class.

Definition at line 25 of file LArShowerOverlapResult.h.

Constructor & Destructor Documentation

lar_content::ShowerOverlapResult::ShowerOverlapResult ( )

Default constructor.

Definition at line 20 of file LArShowerOverlapResult.cc.

20  :
21  m_isInitialized(false),
25  m_xOverlap(XOverlap(0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f))
26 {
27 }
unsigned int m_nSamplingPoints
The number of sampling points.
TFile f
Definition: plotHisto.C:6
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.
lar_content::ShowerOverlapResult::ShowerOverlapResult ( const unsigned int  nMatchedSamplingPoints,
const unsigned int  nSamplingPoints,
const XOverlap xOverlap 
)

Constructor.

Parameters
nMatchedSamplingPoints
nSamplingPoints

Definition at line 31 of file LArShowerOverlapResult.cc.

References m_matchedFraction, m_nMatchedSamplingPoints, and m_nSamplingPoints.

31  :
32  m_isInitialized(true),
33  m_nMatchedSamplingPoints(nMatchedSamplingPoints),
34  m_nSamplingPoints(nSamplingPoints),
36  m_xOverlap(xOverlap)
37 {
39  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
40 
41  m_matchedFraction = static_cast<float>(m_nMatchedSamplingPoints) / static_cast<float>(m_nSamplingPoints);
42 }
unsigned int m_nSamplingPoints
The number of sampling points.
TFile f
Definition: plotHisto.C:6
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.
lar_content::ShowerOverlapResult::ShowerOverlapResult ( const ShowerOverlapResult rhs)

Copy constructor.

Parameters
rhs

Definition at line 46 of file LArShowerOverlapResult.cc.

46  :
47  m_isInitialized(rhs.m_isInitialized),
48  m_nMatchedSamplingPoints(rhs.m_nMatchedSamplingPoints),
49  m_nSamplingPoints(rhs.m_nSamplingPoints),
50  m_matchedFraction(rhs.m_matchedFraction),
51  m_xOverlap(rhs.IsInitialized() ? rhs.GetXOverlap() : XOverlap(0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f))
52 {
53 }
unsigned int m_nSamplingPoints
The number of sampling points.
TFile f
Definition: plotHisto.C:6
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.
lar_content::ShowerOverlapResult::~ShowerOverlapResult ( )

Destructor.

Definition at line 57 of file LArShowerOverlapResult.cc.

58 {
59 }

Member Function Documentation

float lar_content::ShowerOverlapResult::GetMatchedFraction ( ) const
inline

Get the fraction of sampling points resulting in a match.

Returns
the fraction of sampling points resulting in a match

Definition at line 146 of file LArShowerOverlapResult.h.

References m_isInitialized, and m_matchedFraction.

Referenced by lar_content::ThreeViewShowersAlgorithm::RemoveFromSlidingFitCache().

147 {
148  if (m_isInitialized)
149  return m_matchedFraction;
150 
151  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
152 }
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int lar_content::ShowerOverlapResult::GetNMatchedSamplingPoints ( ) const
inline

Get the number of matched sampling points.

Returns
the number of matched sampling points

Definition at line 126 of file LArShowerOverlapResult.h.

References m_isInitialized, and m_nMatchedSamplingPoints.

Referenced by lar_content::ThreeViewShowersAlgorithm::RemoveFromSlidingFitCache().

127 {
128  if (m_isInitialized)
130 
131  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
132 }
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
unsigned int lar_content::ShowerOverlapResult::GetNSamplingPoints ( ) const
inline

Get the number of sampling points.

Returns
the number of sampling points

Definition at line 136 of file LArShowerOverlapResult.h.

References m_isInitialized, and m_nSamplingPoints.

137 {
138  if (m_isInitialized)
139  return m_nSamplingPoints;
140 
141  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
142 }
unsigned int m_nSamplingPoints
The number of sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
const XOverlap & lar_content::ShowerOverlapResult::GetXOverlap ( ) const
inline

Get the x overlap object.

Returns
the x overlap object

Definition at line 156 of file LArShowerOverlapResult.h.

References m_isInitialized, and m_xOverlap.

Referenced by operator=().

157 {
158  if (m_isInitialized)
159  return m_xOverlap;
160 
161  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
162 }
bool m_isInitialized
Whether the track overlap result has been initialized.
XOverlap m_xOverlap
The x overlap object.
bool lar_content::ShowerOverlapResult::IsInitialized ( ) const
inline

Whether the track overlap result has been initialized.

Returns
boolean

Definition at line 119 of file LArShowerOverlapResult.h.

References m_isInitialized.

Referenced by operator<(), operator=(), and lar_content::ThreeViewShowersAlgorithm::RemoveFromSlidingFitCache().

120 {
121  return m_isInitialized;
122 }
bool m_isInitialized
Whether the track overlap result has been initialized.
bool lar_content::ShowerOverlapResult::operator< ( const ShowerOverlapResult rhs) const

Track overlap result less than operator.

Parameters
rhsthe track overlap result for comparison

Definition at line 63 of file LArShowerOverlapResult.cc.

References lar_content::XOverlap::GetXOverlapSpan(), lar_content::XOverlap::GetXSpanU(), lar_content::XOverlap::GetXSpanV(), lar_content::XOverlap::GetXSpanW(), IsInitialized(), m_isInitialized, m_matchedFraction, m_nMatchedSamplingPoints, and m_xOverlap.

64 {
65  if (this == &rhs)
66  return false;
67 
68  if (!m_isInitialized && !rhs.IsInitialized())
69  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
70 
71  if (!m_isInitialized)
72  return true;
73 
74  if (!rhs.IsInitialized())
75  return false;
76 
77  if (m_nMatchedSamplingPoints != rhs.m_nMatchedSamplingPoints)
78  return (m_nMatchedSamplingPoints < rhs.m_nMatchedSamplingPoints);
79 
80  if (std::fabs(m_xOverlap.GetXOverlapSpan() - rhs.m_xOverlap.GetXOverlapSpan()) > std::numeric_limits<float>::epsilon())
81  return (m_xOverlap.GetXOverlapSpan() < rhs.m_xOverlap.GetXOverlapSpan());
82 
83  if (std::fabs(m_matchedFraction - rhs.m_matchedFraction) > std::numeric_limits<float>::epsilon())
84  return (m_matchedFraction < rhs.m_matchedFraction);
85 
86  if (std::fabs(m_xOverlap.GetXSpanW() - rhs.m_xOverlap.GetXSpanW()) > std::numeric_limits<float>::epsilon())
87  return (m_xOverlap.GetXSpanW() < rhs.m_xOverlap.GetXSpanW());
88 
89  if (std::fabs(m_xOverlap.GetXSpanU() - rhs.m_xOverlap.GetXSpanU()) > std::numeric_limits<float>::epsilon())
90  return (m_xOverlap.GetXSpanU() < rhs.m_xOverlap.GetXSpanU());
91 
92  return (m_xOverlap.GetXSpanV() < rhs.m_xOverlap.GetXSpanV());
93 }
float GetXSpanV() const
Get the x span in the v view.
Definition: LArXOverlap.h:186
float GetXSpanW() const
Get the x span in the w view.
Definition: LArXOverlap.h:193
float m_matchedFraction
The fraction of sampling points resulting in a match.
float GetXOverlapSpan() const
Get the x overlap span.
Definition: LArXOverlap.h:200
bool m_isInitialized
Whether the track overlap result has been initialized.
float GetXSpanU() const
Get the x span in the u view.
Definition: LArXOverlap.h:179
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.
ShowerOverlapResult & lar_content::ShowerOverlapResult::operator= ( const ShowerOverlapResult rhs)

Track overlap result assigment operator.

Parameters
rhsthe track overlap result to assign

Definition at line 107 of file LArShowerOverlapResult.cc.

References f, GetXOverlap(), IsInitialized(), m_isInitialized, m_matchedFraction, m_nMatchedSamplingPoints, m_nSamplingPoints, and m_xOverlap.

108 {
109  if (this == &rhs)
110  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
111 
112  m_isInitialized = rhs.m_isInitialized;
113  m_nMatchedSamplingPoints = rhs.m_nMatchedSamplingPoints;
114  m_nSamplingPoints = rhs.m_nSamplingPoints;
115  m_matchedFraction = rhs.m_matchedFraction;
116 
117  if (rhs.IsInitialized())
118  {
119  m_xOverlap = rhs.GetXOverlap();
120  }
121  else
122  {
123  m_xOverlap = XOverlap(0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f);
124  }
125 
126  return *this;
127 }
unsigned int m_nSamplingPoints
The number of sampling points.
TFile f
Definition: plotHisto.C:6
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
XOverlap m_xOverlap
The x overlap object.
bool lar_content::ShowerOverlapResult::operator> ( const ShowerOverlapResult rhs) const

Track overlap result greater than operator.

Parameters
rhsthe track overlap result for comparison

Definition at line 97 of file LArShowerOverlapResult.cc.

98 {
99  if (this == &rhs)
100  return false;
101 
102  return !(*this < rhs);
103 }

Member Data Documentation

bool lar_content::ShowerOverlapResult::m_isInitialized
protected

Whether the track overlap result has been initialized.

Definition at line 110 of file LArShowerOverlapResult.h.

Referenced by GetMatchedFraction(), GetNMatchedSamplingPoints(), GetNSamplingPoints(), GetXOverlap(), IsInitialized(), operator<(), and operator=().

float lar_content::ShowerOverlapResult::m_matchedFraction
protected

The fraction of sampling points resulting in a match.

Definition at line 113 of file LArShowerOverlapResult.h.

Referenced by GetMatchedFraction(), operator<(), operator=(), and ShowerOverlapResult().

unsigned int lar_content::ShowerOverlapResult::m_nMatchedSamplingPoints
protected

The number of matched sampling points.

Definition at line 111 of file LArShowerOverlapResult.h.

Referenced by GetNMatchedSamplingPoints(), operator<(), operator=(), and ShowerOverlapResult().

unsigned int lar_content::ShowerOverlapResult::m_nSamplingPoints
protected

The number of sampling points.

Definition at line 112 of file LArShowerOverlapResult.h.

Referenced by GetNSamplingPoints(), operator=(), and ShowerOverlapResult().

XOverlap lar_content::ShowerOverlapResult::m_xOverlap
protected

The x overlap object.

Definition at line 114 of file LArShowerOverlapResult.h.

Referenced by GetXOverlap(), operator<(), and operator=().


The documentation for this class was generated from the following files: