LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 85 of file DBScanAlg.cxx.

Constructor & Destructor Documentation

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

Definition at line 90 of file DBScanAlg.cxx.

References RStarBoundingBox< dimensions >::edges.

91  :m_bound(b),r(),c(){
92  r[0] = r1;
93  r[1] = r2;
94  c[0] = (m_bound.edges[0].second+m_bound.edges[0].first)/2.0;
95  c[1] = (m_bound.edges[1].second+m_bound.edges[1].first)/2.0;
96  d[0] = (m_bound.edges[0].second-m_bound.edges[0].first)/2.0;
97  d[1] = (m_bound.edges[1].second-m_bound.edges[1].first)/2.0;
98  }
double d[2]
half
Definition: DBScanAlg.cxx:89
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:88
double r[2]
Definition: DBScanAlg.cxx:87
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:86
std::pair< double, double > edges[dimensions]
AcceptEllipse::AcceptEllipse ( )
inlineprivate

Definition at line 121 of file DBScanAlg.cxx.

References RStarBoundingBox< dimensions >::edges, and EmptyBoundingBox.

122  :m_bound(EmptyBoundingBox),r(),c(){
123  r[0] = r[1] = 1.0;
124  c[0] = (m_bound.edges[0].second-m_bound.edges[0].first)/2.0;
125  c[1] = (m_bound.edges[1].second-m_bound.edges[1].first)/2.0;
126  }
static const BoundingBox EmptyBoundingBox
Definition: DBScanAlg.cxx:119
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:88
double r[2]
Definition: DBScanAlg.cxx:87
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:86
std::pair< double, double > edges[dimensions]

Member Function Documentation

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

Definition at line 99 of file DBScanAlg.cxx.

References RStarBoundingBox< dimensions >::overlaps().

99  {
100  // At the node level we use a rectangualr overlap condition
101  return m_bound.overlaps(node->bound);
102  }
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:86
bool overlaps(const RStarBoundingBox< dimensions > &bb) const
bool AcceptEllipse::operator() ( const RTree::Leaf *const  leaf) const
inline

Definition at line 103 of file DBScanAlg.cxx.

103  {
104  // At the leaf level we have to more careful
105  double C[2], D[2];
106  C[0] = (leaf->bound.edges[0].second + leaf->bound.edges[0].first)/2.0;
107  C[1] = (leaf->bound.edges[1].second + leaf->bound.edges[1].first)/2.0;
108  D[0] = (leaf->bound.edges[0].second - leaf->bound.edges[0].first)/2.0;
109  D[1] = (leaf->bound.edges[1].second - leaf->bound.edges[1].first)/2.0;
110  double t=0;
111  for (int i=0; i<2; ++i){
112  // This is only approximate, it will accept a few classes of
113  // non-overlapping ellipses
114  t += ((c[i]-C[i])*(c[i]-C[i]))/((d[i]+D[i])*(d[i]+D[i]));
115  }
116  return (t < 1);
117  }
double d[2]
half
Definition: DBScanAlg.cxx:89
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:88

Member Data Documentation

double AcceptEllipse::c[2]

center of the bounding box

Definition at line 88 of file DBScanAlg.cxx.

double AcceptEllipse::d[2]

half

Definition at line 89 of file DBScanAlg.cxx.

const BoundingBox AcceptEllipse::EmptyBoundingBox
staticprivate

Definition at line 119 of file DBScanAlg.cxx.

Referenced by AcceptEllipse().

const BoundingBox& AcceptEllipse::m_bound

Definition at line 86 of file DBScanAlg.cxx.

double AcceptEllipse::r[2]

Definition at line 87 of file DBScanAlg.cxx.


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