Belle II Software development
TRGCDCLpar Class Reference

TRGCDCLpar class. More...

#include <Lpar.h>

Inheritance diagram for TRGCDCLpar:
TRGCDCLpav

Classes

class  Cpar
 Private class cpar. More...
 

Public Member Functions

 TRGCDCLpar ()
 Constructor.
 
virtual ~TRGCDCLpar ()
 Destructor.
 
TRGCDCLparoperator= (const TRGCDCLpar &)
 assignment operator(s)
 
void neg ()
 member functions
 
void circle (double x1, double y1, double x2, double y2, double x3, double y3)
 circle
 
double kappa () const
 const member functions
 
double radius () const
 const member functions
 
CLHEP::HepVector center () const
 const member functions
 
double s (double x, double y) const
 const member functions
 
double d (double x, double y) const
 const member functions
 
double dr (double x, double y) const
 const member functions
 
double s (double r, int dir=0) const
 const member functions
 
double phi (double r, int dir=0) const
 const member functions
 
int sd (double r, double x, double y, double limit, double &s, double &d) const
 const member functions
 
CLHEP::HepVector Hpar (const HepGeom::Point3D< double > &pivot) const
 const member functions
 

Private Member Functions

 TRGCDCLpar (const TRGCDCLpar &)
 Constructors and destructor.
 
bool operator== (const TRGCDCLpar &) const
 comparison operators
 
bool operator!= (const TRGCDCLpar &) const
 comparison operators
 
void scale (double s)
 private member functions
 
void rotate (double c, double s)
 private member functions
 
void move (double x, double y)
 private member functions
 
double alpha () const
 private const member functions
 
double beta () const
 private const member functions
 
double gamma () const
 private const member functions
 
double check () const
 private const member functions
 
CLHEP::HepMatrix dldc () const
 private const member functions
 
double d0 (double x, double y) const
 private const member functions
 
double kr2g (double r) const
 private const member functions
 
double x (double r) const
 private const member functions
 
double y (double r) const
 private const member functions
 
void xhyh (double x, double y, double &xh, double &yh) const
 private const member functions
 
double xi2 () const
 private const member functions
 
bool xy (double, double &, double &, int dir=0) const
 private const member functions
 
double r_max () const
 private const member functions
 
double xc () const
 private const member functions
 
double yc () const
 private const member functions
 
double da () const
 private const member functions
 
double arcfun (double xh, double yh) const
 private const member functions
 

Private Attributes

double m_alpha
 data members
 
double m_beta
 data members
 
double m_gamma
 data members
 
double m_kappa
 data members
 

Static Private Attributes

static const double BELLE_ALPHA
 belle alpha
 

Friends

class TRGCDCLpav
 friend functions and classes
 
class TRGCDCLpar::Cpar
 
std::ostream & operator<< (std::ostream &o, const TRGCDCLpar &)
 ostream operator
 
int intersect (const TRGCDCLpar &, const TRGCDCLpar &, CLHEP::HepVector &, CLHEP::HepVector &)
 intersection
 

Detailed Description

TRGCDCLpar class.

Definition at line 35 of file Lpar.h.

Member Function Documentation

◆ alpha()

double alpha ( ) const
inlineprivate

private const member functions

Definition at line 139 of file Lpar.h.

139{ return m_alpha; }
double m_alpha
data members
Definition: Lpar.h:174

◆ beta()

double beta ( ) const
inlineprivate

private const member functions

Definition at line 141 of file Lpar.h.

141{ return m_beta; }
double m_beta
data members
Definition: Lpar.h:176

◆ da()

double da ( ) const
inlineprivate

private const member functions

Definition at line 169 of file Lpar.h.

169{ return 2 * gamma() / (std::sqrt(xi2()) + 1); }
double gamma() const
private const member functions
Definition: Lpar.h:143
double xi2() const
private const member functions
Definition: Lpar.h:159

◆ gamma()

double gamma ( ) const
inlineprivate

private const member functions

Definition at line 143 of file Lpar.h.

143{ return m_gamma; }
double m_gamma
data members
Definition: Lpar.h:178

◆ kappa()

double kappa ( ) const
inline

const member functions

Definition at line 57 of file Lpar.h.

57{ return m_kappa; }
double m_kappa
data members
Definition: Lpar.h:180

◆ kr2g()

double kr2g ( double  r) const
inlineprivate

private const member functions

Definition at line 151 of file Lpar.h.

151{ return m_kappa * r * r + m_gamma; }

◆ radius()

double radius ( ) const
inline

const member functions

Definition at line 59 of file Lpar.h.

59{ return 0.5 / std::fabs(m_kappa);}

◆ scale()

void scale ( double  s)
inlineprivate

private member functions

Definition at line 132 of file Lpar.h.

132{ m_kappa /= s; m_gamma *= s; }
double s(double x, double y) const
const member functions
Definition: Lpar.cc:210

◆ xc()

double xc ( ) const
inlineprivate

private const member functions

Definition at line 165 of file Lpar.h.

165{ return - m_alpha / 2 / m_kappa; }

◆ xi2()

double xi2 ( ) const
inlineprivate

private const member functions

Definition at line 159 of file Lpar.h.

159{ return 1 + 4 * m_kappa * m_gamma; }

◆ yc()

double yc ( ) const
inlineprivate

private const member functions

Definition at line 167 of file Lpar.h.

167{ return - m_beta / 2 / m_kappa; }

Friends And Related Function Documentation

◆ intersect

int intersect ( const TRGCDCLpar lp1,
const TRGCDCLpar lp2,
CLHEP::HepVector &  v1,
CLHEP::HepVector &  v2 
)
friend

intersection

Definition at line 249 of file Lpar.cc.

250 {
251 CLHEP::HepVector cen1(lp1.center());
252 CLHEP::HepVector cen2(lp2.center());
253 double dx = cen1(1) - cen2(1);
254 double dy = cen1(2) - cen2(2);
255 double dc = sqrt(dx * dx + dy * dy);
256 if (dc < fabs(0.5 / lp1.kappa()) + fabs(0.5 / lp2.kappa())) {
257 double a1 = sqr(lp1.alpha()) + sqr(lp1.beta());
258 double a2 = sqr(lp2.alpha()) + sqr(lp2.beta());
259 double a3 = lp1.alpha() * lp2.alpha() + lp1.beta() * lp2.beta();
260 double det = lp1.alpha() * lp2.beta() - lp1.beta() * lp2.alpha();
261 if (fabs(det) > 1e-12) {
262 double c1 = a2 * sqr(lp1.kappa()) + a1 * sqr(lp2.kappa()) -
263 2.0 * a3 * lp1.kappa() * lp2.kappa();
264 if (c1 != 0) {
265 double cinv = 1.0 / c1;
266 double c2 = sqr(a3) - 0.5 * (a1 + a2) - 2.0 * a3 *
267 (lp1.gamma() * lp2.kappa() + lp2.gamma() * lp1.kappa());
268 double c3 = a2 * sqr(lp1.gamma()) + a1 * sqr(lp2.gamma()) -
269 2.0 * a3 * lp1.gamma() * lp2.gamma();
270 double root = sqr(c2) - 4.0 * c1 * c3;
271 if (root >= 0) {
272 root = sqrt(root);
273 double rad2[2];
274 rad2[0] = 0.5 * cinv * (-c2 - root);
275 rad2[1] = 0.5 * cinv * (-c2 + root);
276 double ab1 = -(lp2.beta() * lp1.gamma() - lp1.beta() * lp2.gamma());
277 double ab2 = (lp2.alpha() * lp1.gamma() - lp1.alpha() * lp2.gamma());
278 double ac1 = -(lp2.beta() * lp1.kappa() - lp1.beta() * lp2.kappa());
279 double ac2 = (lp2.alpha() * lp1.kappa() - lp1.alpha() * lp2.kappa());
280 double dinv = 1.0 / det;
281 v1(1) = dinv * (ab1 + ac1 * rad2[0]);
282 v1(2) = dinv * (ab2 + ac2 * rad2[0]);
283 v1(3) = 0;
284 v2(1) = dinv * (ab1 + ac1 * rad2[1]);
285 v2(2) = dinv * (ab2 + ac2 * rad2[1]);
286 v2(3) = 0;
287//cnv double d1 = lp1.d(v1(1),v1(2));
288//cnv double d2 = lp2.d(v1(1),v1(2));
289//cnv double d3 = lp1.d(v2(1),v2(2));
290//cnv double d4 = lp2.d(v2(1),v2(2));
291//cnv double r = sqrt(rad2[0]);
292 TRGCDCLpar::Cpar cp1(lp1);
293 TRGCDCLpar::Cpar cp2(lp2);
294// for(int j=0;j<2;j++) {
295//jb double s1,s2;
296//jb if(j==0) {
297//jb s1 = lp1.s(v1(1),v1(2));
298//jb s2 = lp2.s(v1(1),v1(2));
299//jb } else {
300//jb s1 = lp1.s(v2(1),v2(2));
301//jb s2 = lp2.s(v2(1),v2(2));
302//jb }
303//cnv double phi1 = cp1.fi() + 2 * cp1.cu() * s1;
304//cnv double phi2 = cp2.fi() + 2 * cp2.cu() * s2;
305// double f = (1 + 2 * cp1.cu() * cp1.da()) *
306// (1 + 2 * cp2.cu() * cp2.da()) * cos(cp1.fi()-cp2.fi());
307// f -= 2 * (lp1.gamma() * lp2.kappa() + lp2.gamma() * lp1.kappa());
308//cnv double cosphi12 = f;
309// }
310 return 2;
311 }
312 }
313 }
314 }
315 return 0;
316 }
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
const std::vector< double > v2
MATLAB generated random vector.
const std::vector< double > v1
MATLAB generated random vector.

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const TRGCDCLpar s 
)
friend

ostream operator

Definition at line 327 of file Lpar.cc.

328 {
329 return o << " al=" << s.m_alpha << " be=" << s.m_beta
330 << " ka=" << s.m_kappa << " ga=" << s.m_gamma;
331 }

◆ TRGCDCLpar::Cpar

friend class TRGCDCLpar::Cpar
friend

Definition at line 122 of file Lpar.h.

◆ TRGCDCLpav

friend class TRGCDCLpav
friend

friend functions and classes

Definition at line 81 of file Lpar.h.

Member Data Documentation

◆ m_alpha

double m_alpha
private

data members

Definition at line 174 of file Lpar.h.

◆ m_beta

double m_beta
private

data members

Definition at line 176 of file Lpar.h.

◆ m_gamma

double m_gamma
private

data members

Definition at line 178 of file Lpar.h.

◆ m_kappa

double m_kappa
private

data members

Definition at line 180 of file Lpar.h.


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