LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
AcceptEllipse Struct Reference

Public Member Functions

 AcceptEllipse (const BoundingBox &b, double r1, double r2)
 
bool operator() (const RTree::Node *const node) const
 
bool operator() (const RTree::Leaf *const leaf) const
 

Public Attributes

const BoundingBoxm_bound
 
double r [2]
 
double c [2]
 center of the bounding box More...
 
double d [2]
 half More...
 

Private Member Functions

 AcceptEllipse ()
 

Static Private Attributes

static const BoundingBox EmptyBoundingBox
 

Detailed Description

Definition at line 71 of file DBScanAlg.cxx.

Constructor & Destructor Documentation

AcceptEllipse::AcceptEllipse ( const BoundingBox b,
double  r1,
double  r2 
)
inlineexplicit

Definition at line 76 of file DBScanAlg.cxx.

76  : m_bound(b), r(), c()
77  {
78  r[0] = r1;
79  r[1] = r2;
80  c[0] = (m_bound.edges[0].second + m_bound.edges[0].first) / 2.0;
81  c[1] = (m_bound.edges[1].second + m_bound.edges[1].first) / 2.0;
82  d[0] = (m_bound.edges[0].second - m_bound.edges[0].first) / 2.0;
83  d[1] = (m_bound.edges[1].second - m_bound.edges[1].first) / 2.0;
84  }
double d[2]
half
Definition: DBScanAlg.cxx:75
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:74
double r[2]
Definition: DBScanAlg.cxx:73
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:72
AcceptEllipse::AcceptEllipse ( )
inlineprivate

Definition at line 110 of file DBScanAlg.cxx.

References EmptyBoundingBox.

110  : m_bound(EmptyBoundingBox), r(), c()
111  {
112  r[0] = r[1] = 1.0;
113  c[0] = (m_bound.edges[0].second - m_bound.edges[0].first) / 2.0;
114  c[1] = (m_bound.edges[1].second - m_bound.edges[1].first) / 2.0;
115  }
static const BoundingBox EmptyBoundingBox
Definition: DBScanAlg.cxx:108
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:74
double r[2]
Definition: DBScanAlg.cxx:73
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:72

Member Function Documentation

bool AcceptEllipse::operator() ( const RTree::Node *const  node) const
inline

Definition at line 85 of file DBScanAlg.cxx.

86  {
87  // At the node level we use a rectangualr overlap condition
88  return m_bound.overlaps(node->bound);
89  }
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:72
bool AcceptEllipse::operator() ( const RTree::Leaf *const  leaf) const
inline

Definition at line 90 of file DBScanAlg.cxx.

91  {
92  // At the leaf level we have to more careful
93  double C[2], D[2];
94  C[0] = (leaf->bound.edges[0].second + leaf->bound.edges[0].first) / 2.0;
95  C[1] = (leaf->bound.edges[1].second + leaf->bound.edges[1].first) / 2.0;
96  D[0] = (leaf->bound.edges[0].second - leaf->bound.edges[0].first) / 2.0;
97  D[1] = (leaf->bound.edges[1].second - leaf->bound.edges[1].first) / 2.0;
98  double t = 0;
99  for (int i = 0; i < 2; ++i) {
100  // This is only approximate, it will accept a few classes of
101  // non-overlapping ellipses
102  t += ((c[i] - C[i]) * (c[i] - C[i])) / ((d[i] + D[i]) * (d[i] + D[i]));
103  }
104  return (t < 1);
105  }
double d[2]
half
Definition: DBScanAlg.cxx:75
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:74

Member Data Documentation

double AcceptEllipse::c[2]

center of the bounding box

Definition at line 74 of file DBScanAlg.cxx.

double AcceptEllipse::d[2]

half

Definition at line 75 of file DBScanAlg.cxx.

const BoundingBox AcceptEllipse::EmptyBoundingBox
staticprivate

Definition at line 108 of file DBScanAlg.cxx.

Referenced by AcceptEllipse().

const BoundingBox& AcceptEllipse::m_bound

Definition at line 72 of file DBScanAlg.cxx.

double AcceptEllipse::r[2]

Definition at line 73 of file DBScanAlg.cxx.


The documentation for this struct was generated from the following file: