CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
_MdcGeomSvc_impl Namespace Reference

Functions

void tangents (CLHEP::Hep2Vector c, double r1, double r2, vector< MdcGeomSvc::AdjCandiTgtLine2D > &ans)
 find tangent. should have returned optional<line>, but ok..
 
vector< MdcGeomSvc::AdjCandiTgtLine2Dtangents (CLHEP::Hep2Vector a, CLHEP::Hep2Vector b, double ra, double rb)
 find all tangents of 2 circles given as point and radius. may return 0,1,2,3,4 lines
 

Variables

const double EPS = 1E-9
 

Function Documentation

◆ tangents() [1/2]

vector< MdcGeomSvc::AdjCandiTgtLine2D > _MdcGeomSvc_impl::tangents ( CLHEP::Hep2Vector a,
CLHEP::Hep2Vector b,
double ra,
double rb )

find all tangents of 2 circles given as point and radius. may return 0,1,2,3,4 lines

Parameters
a
b
ra
rb
Returns
vector<MdcGeomSvc::AdjCandiTgtLine2D>

Definition at line 1562 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1562 {
1563 vector<MdcGeomSvc::AdjCandiTgtLine2D> ans;
1564 for (int i=-1; i<=1; i+=2)
1565 for (int j=-1; j<=1; j+=2)
1566 tangents (b-a, ra*i, rb*j, ans);
1567 for (size_t i=0; i<ans.size(); ++i)
1568 ans[i].c -= ans[i].a * a.x() + ans[i].b * a.y();
1569 return ans;
1570 }
Definition TConstant.h:3

◆ tangents() [2/2]

void _MdcGeomSvc_impl::tangents ( CLHEP::Hep2Vector c,
double r1,
double r2,
vector< MdcGeomSvc::AdjCandiTgtLine2D > & ans )

find tangent. should have returned optional<line>, but ok..

Parameters
c
r1
r2
ans

Definition at line 1540 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1540 {
1541 double r = r2 - r1;
1542 double z = squared(c.x()) + squared(c.y());
1543 double d = z - squared(r);
1544 if (d < -EPS) return;
1545 d = sqrt (abs (d));
1547 l.a = (c.x() * r + c.y() * d) / z;
1548 l.b = (c.y() * r - c.x() * d) / z;
1549 l.c = r1;
1550 ans.push_back (l);
1551 }
const double EPS
Definition TRunge.cxx:43
forms a line in x-y space, ax + by + c = 0

Referenced by MdcGeomSvc::getAdjacentCandidateWithDriftCircle(), and tangents().

Variable Documentation

◆ EPS

const double _MdcGeomSvc_impl::EPS = 1E-9

Definition at line 1531 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

Referenced by tangents().