LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::TrackOverlapResult Class Reference

TrackOverlapResult class. More...

#include "LArTrackOverlapResult.h"

Inheritance diagram for lar_content::TrackOverlapResult:
lar_content::FragmentOverlapResult lar_content::LongitudinalOverlapResult lar_content::TransverseOverlapResult

Public Member Functions

 TrackOverlapResult ()
 Default constructor. More...
 
 TrackOverlapResult (const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2)
 Constructor. More...
 
 TrackOverlapResult (const TrackOverlapResult &rhs)
 Copy constructor. More...
 
virtual ~TrackOverlapResult ()
 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...
 
float GetChi2 () const
 Get the absolute chi2 value. More...
 
float GetReducedChi2 () const
 Get the chi2 per samping point value. More...
 
bool operator< (const TrackOverlapResult &rhs) const
 Track overlap result less than operator. More...
 
bool operator> (const TrackOverlapResult &rhs) const
 Track overlap result greater than operator. More...
 
TrackOverlapResultoperator= (const TrackOverlapResult &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...
 
float m_chi2
 The absolute chi2 value. More...
 
float m_reducedChi2
 The chi2 per samping point value. More...
 

Detailed Description

TrackOverlapResult class.

Definition at line 25 of file LArTrackOverlapResult.h.

Constructor & Destructor Documentation

lar_content::TrackOverlapResult::TrackOverlapResult ( )

Default constructor.

Definition at line 20 of file LArTrackOverlapResult.cc.

20  :
21  m_isInitialized(false),
25  m_chi2(0.f),
26  m_reducedChi2(0.f)
27 {
28 }
float m_chi2
The absolute chi2 value.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
TFile f
Definition: plotHisto.C:6
float m_reducedChi2
The chi2 per samping point value.
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
lar_content::TrackOverlapResult::TrackOverlapResult ( const unsigned int  nMatchedSamplingPoints,
const unsigned int  nSamplingPoints,
const float  chi2 
)

Constructor.

Parameters
nMatchedSamplingPoints
nSamplingPoints
chi2

Definition at line 32 of file LArTrackOverlapResult.cc.

References m_chi2, m_matchedFraction, m_nMatchedSamplingPoints, m_nSamplingPoints, and m_reducedChi2.

32  :
33  m_isInitialized(true),
34  m_nMatchedSamplingPoints(nMatchedSamplingPoints),
35  m_nSamplingPoints(nSamplingPoints),
37  m_chi2(chi2),
38  m_reducedChi2(0.f)
39 {
41  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
42 
43  m_matchedFraction = static_cast<float>(m_nMatchedSamplingPoints) / static_cast<float>(m_nSamplingPoints);
44  m_reducedChi2 = m_chi2 / static_cast<float>(m_nSamplingPoints);
45 }
float m_chi2
The absolute chi2 value.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
TFile f
Definition: plotHisto.C:6
float m_reducedChi2
The chi2 per samping point value.
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
lar_content::TrackOverlapResult::TrackOverlapResult ( const TrackOverlapResult rhs)

Copy constructor.

Parameters
rhs

Definition at line 49 of file LArTrackOverlapResult.cc.

49  :
50  m_isInitialized(rhs.m_isInitialized),
51  m_nMatchedSamplingPoints(rhs.m_nMatchedSamplingPoints),
52  m_nSamplingPoints(rhs.m_nSamplingPoints),
53  m_matchedFraction(rhs.m_matchedFraction),
54  m_chi2(rhs.m_chi2),
55  m_reducedChi2(rhs.m_reducedChi2)
56 {
57 }
float m_chi2
The absolute chi2 value.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_reducedChi2
The chi2 per samping point value.
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
lar_content::TrackOverlapResult::~TrackOverlapResult ( )
virtual

Destructor.

Definition at line 61 of file LArTrackOverlapResult.cc.

62 {
63 }

Member Function Documentation

float lar_content::TrackOverlapResult::GetChi2 ( ) const
inline

Get the absolute chi2 value.

Returns
the absolute chi2 value

Definition at line 386 of file LArTrackOverlapResult.h.

References m_chi2, and m_isInitialized.

Referenced by lar_content::operator+().

387 {
388  if (m_isInitialized)
389  return m_chi2;
390 
391  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
392 }
float m_chi2
The absolute chi2 value.
bool m_isInitialized
Whether the track overlap result has been initialized.
float lar_content::TrackOverlapResult::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 376 of file LArTrackOverlapResult.h.

References m_isInitialized, and m_matchedFraction.

Referenced by lar_content::ClearTrackFragmentsTool::CheckOverlapResult(), lar_content::ThreeDTrackFragmentsAlgorithm::CheckOverlapResult(), and lar_content::ThreeDTransverseTracksAlgorithm::ThreeDTransverseTracksAlgorithm().

377 {
378  if (m_isInitialized)
379  return m_matchedFraction;
380 
381  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
382 }
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_matchedFraction
The fraction of sampling points resulting in a match.
unsigned int lar_content::TrackOverlapResult::GetNMatchedSamplingPoints ( ) const
inline

Get the number of matched sampling points.

Returns
the number of matched sampling points

Definition at line 356 of file LArTrackOverlapResult.h.

References m_isInitialized, and m_nMatchedSamplingPoints.

Referenced by lar_content::operator+(), lar_content::ThreeDLongitudinalTracksAlgorithm::ThreeDLongitudinalTracksAlgorithm(), and lar_content::ThreeDTransverseTracksAlgorithm::ThreeDTransverseTracksAlgorithm().

357 {
358  if (m_isInitialized)
360 
361  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
362 }
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int lar_content::TrackOverlapResult::GetNSamplingPoints ( ) const
inline

Get the number of sampling points.

Returns
the number of sampling points

Definition at line 366 of file LArTrackOverlapResult.h.

References m_isInitialized, and m_nSamplingPoints.

Referenced by lar_content::operator+(), and lar_content::ThreeDTransverseTracksAlgorithm::ThreeDTransverseTracksAlgorithm().

367 {
368  if (m_isInitialized)
369  return m_nSamplingPoints;
370 
371  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
372 }
bool m_isInitialized
Whether the track overlap result has been initialized.
unsigned int m_nSamplingPoints
The number of sampling points.
float lar_content::TrackOverlapResult::GetReducedChi2 ( ) const
inline

Get the chi2 per samping point value.

Returns
the chi2 per samping point value

Definition at line 396 of file LArTrackOverlapResult.h.

References m_isInitialized, and m_reducedChi2.

397 {
398  if (m_isInitialized)
399  return m_reducedChi2;
400 
401  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
402 }
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_reducedChi2
The chi2 per samping point value.
bool lar_content::TrackOverlapResult::operator< ( const TrackOverlapResult rhs) const

Track overlap result less than operator.

Parameters
rhsthe track overlap result for comparison

Definition at line 67 of file LArTrackOverlapResult.cc.

References IsInitialized(), m_isInitialized, m_matchedFraction, m_nMatchedSamplingPoints, and m_reducedChi2.

68 {
69  if (this == &rhs)
70  return false;
71 
72  if (!m_isInitialized && !rhs.IsInitialized())
73  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
74 
75  if (!m_isInitialized)
76  return true;
77 
78  if (!rhs.IsInitialized())
79  return false;
80 
81  if (m_nMatchedSamplingPoints != rhs.m_nMatchedSamplingPoints)
82  return (m_nMatchedSamplingPoints < rhs.m_nMatchedSamplingPoints);
83 
84  if (std::fabs(m_reducedChi2 - rhs.m_reducedChi2) > std::numeric_limits<float>::epsilon())
85  return (m_reducedChi2 > rhs.m_reducedChi2);
86 
87  return (m_matchedFraction < rhs.m_matchedFraction);
88 }
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_reducedChi2
The chi2 per samping point value.
float m_matchedFraction
The fraction of sampling points resulting in a match.
TrackOverlapResult & lar_content::TrackOverlapResult::operator= ( const TrackOverlapResult rhs)

Track overlap result assigment operator.

Parameters
rhsthe track overlap result to assign

Definition at line 102 of file LArTrackOverlapResult.cc.

References m_chi2, m_isInitialized, m_matchedFraction, m_nMatchedSamplingPoints, m_nSamplingPoints, and m_reducedChi2.

Referenced by lar_content::TransverseOverlapResult::operator=(), lar_content::LongitudinalOverlapResult::operator=(), and lar_content::FragmentOverlapResult::operator=().

103 {
104  if (this == &rhs)
105  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
106 
107  m_isInitialized = rhs.m_isInitialized;
108  m_nMatchedSamplingPoints = rhs.m_nMatchedSamplingPoints;
109  m_nSamplingPoints = rhs.m_nSamplingPoints;
110  m_matchedFraction = rhs.m_matchedFraction;
111  m_chi2 = rhs.m_chi2;
112  m_reducedChi2 = rhs.m_reducedChi2;
113 
114  return *this;
115 }
float m_chi2
The absolute chi2 value.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_reducedChi2
The chi2 per samping point value.
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
bool lar_content::TrackOverlapResult::operator> ( const TrackOverlapResult rhs) const

Track overlap result greater than operator.

Parameters
rhsthe track overlap result for comparison

Definition at line 92 of file LArTrackOverlapResult.cc.

93 {
94  if (this == &rhs)
95  return false;
96 
97  return !(*this < rhs);
98 }

Member Data Documentation

float lar_content::TrackOverlapResult::m_chi2
protected

The absolute chi2 value.

Definition at line 122 of file LArTrackOverlapResult.h.

Referenced by GetChi2(), operator=(), and TrackOverlapResult().

bool lar_content::TrackOverlapResult::m_isInitialized
protected
float lar_content::TrackOverlapResult::m_matchedFraction
protected

The fraction of sampling points resulting in a match.

Definition at line 121 of file LArTrackOverlapResult.h.

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

unsigned int lar_content::TrackOverlapResult::m_nMatchedSamplingPoints
protected

The number of matched sampling points.

Definition at line 119 of file LArTrackOverlapResult.h.

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

unsigned int lar_content::TrackOverlapResult::m_nSamplingPoints
protected

The number of sampling points.

Definition at line 120 of file LArTrackOverlapResult.h.

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

float lar_content::TrackOverlapResult::m_reducedChi2
protected

The chi2 per samping point value.

Definition at line 123 of file LArTrackOverlapResult.h.

Referenced by GetReducedChi2(), operator<(), operator=(), and TrackOverlapResult().


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