16#include "CLHEP/Matrix/Vector.h"
17#include "CLHEP/Matrix/Matrix.h"
18#ifndef CLHEP_POINT3D_H
19#include "CLHEP/Geometry/Point3D.h"
22#ifdef TRGCDC_SHORT_NAMES
23#define TCLpar TRGCDCLpar
53 void circle(
double x1,
double y1,
double x2,
double y2,
54 double x3,
double y3);
61 CLHEP::HepVector
center()
const;
63 double s(
double x,
double y)
const;
65 inline double d(
double x,
double y)
const;
67 inline double dr(
double x,
double y)
const;
69 double s(
double r,
int dir = 0)
const;
71 double phi(
double r,
int dir = 0)
const;
73 inline int sd(
double r,
double x,
double y,
74 double limit,
double&
s,
double&
d)
const;
134 inline void rotate(
double c,
double s);
136 inline void move(
double x,
double y);
145 inline double check()
const;
147 CLHEP::HepMatrix
dldc()
const;
149 inline double d0(
double x,
double y)
const;
153 double x(
double r)
const;
155 double y(
double r)
const;
157 void xhyh(
double x,
double y,
double& xh,
double& yh)
const;
161 bool xy(
double,
double&,
double&,
int dir = 0)
const;
163 inline double r_max()
const;
169 double da()
const {
return 2 *
gamma() / (std::sqrt(
xi2()) + 1); }
171 inline double arcfun(
double xh,
double yh)
const;
257 double dd =
d0(
x,
y);
258 const double approx_limit = 0.2;
259 if (std::fabs(
m_kappa * dd) > approx_limit)
return -1;
260 return dd * (1 -
m_kappa * dd);
265 double dx =
xc() -
x;
266 double dy =
yc() -
y;
267 double r = 0.5 / std::fabs(
m_kappa);
268 return std::fabs(std::sqrt(dx * dx + dy * dy) - r);
273 if (
m_kappa == 0)
return 100000000.0;
284 double xi = std::sqrt(
xi2());
285 double xinv = 1.0 / xi;
286 double ar2kap = std::fabs(r2kap);
288 double a1 = ar2kap * cross * xinv;
289 double a2 = r2kap * (
m_alpha * xh +
m_beta * yh) * xinv + xi;
290 if (a1 >= 0 && a2 > 0 && a1 < 0.3) {
291 double arg2 = a1 * a1;
292 return cross * (1.0 + arg2 * (1. / 6. + arg2 * (3. / 40.))) * xinv;
294 double at2 = std::atan2(a1, a2);
295 if (at2 < 0) at2 += (2 * M_PI);
301 double limit,
double& s,
double& d)
const
304 double dd =
d0(
x,
y);
306 double d_cross_limit =
d * limit;
307 if (d_cross_limit < 0 || d_cross_limit > limit * limit)
return 0;
309 double rho = 1. / (-2 *
m_kappa);
310 double cosPhi = (rc * rc + rho * rho - r * r) / (-2 * rc * rho);
311 cosPhi = cosPhi > 1.0 ? 1.0 : cosPhi;
312 cosPhi = cosPhi < -1.0 ? -1.0 : cosPhi;
313 double phi = std::acos(cosPhi);
314 s = std::fabs(rho) *
phi;
315 if (0.0 ==
phi)
return 0;
316 d *= r / (std::fabs(rc) * std::sin(
phi));
318 if (fabs(
d) > fabs(limit))
return 0;
319 d_cross_limit =
d * limit;
320 if (d_cross_limit > limit * limit)
return 0;
326 CLHEP::HepVector a(5);
327 double dd =
d0(pivot.x(), pivot.y());
328 a(1) = dd * (
m_kappa * dd - 1);
329 a(2) = (
m_kappa > 0) ? std::atan2(
yc() - pivot.y(),
xc() - pivot.x()) + M_PI
330 : std::atan2(pivot.y() -
yc(), pivot.x() -
xc()) - M_PI;
double cu() const
returns parameter of Cpar class
double m_cfi
parameter of Cpar class
double m_fi
parameter of Cpar class
double cfi() const
returns parameter of Cpar class
double da() const
returns parameter of Cpar class
double fi() const
returns parameter of Cpar class
double m_sfi
parameter of Cpar class
double sfi() const
returns parameter of Cpar class
double m_cu
parameter of Cpar class
double m_da
parameter of Cpar class
double xi() const
returns parameter of Cpar class
double m_beta
data members
double m_kappa
data members
double xc() const
private const member functions
friend std::ostream & operator<<(std::ostream &o, const TRGCDCLpar &)
ostream operator
double radius() const
const member functions
double m_gamma
data members
double kappa() const
const member functions
bool operator!=(const TRGCDCLpar &) const
comparison operators
double gamma() const
private const member functions
double da() const
private const member functions
double kr2g(double r) const
private const member functions
double beta() const
private const member functions
friend int intersect(const TRGCDCLpar &, const TRGCDCLpar &, CLHEP::HepVector &, CLHEP::HepVector &)
intersection
void scale(double s)
private member functions
bool operator==(const TRGCDCLpar &) const
comparison operators
double m_alpha
data members
double yc() const
private const member functions
double alpha() const
private const member functions
double xi2() const
private const member functions
int sd(double r, double x, double y, double limit, double &s, double &d) const
const member functions
double r_max() const
private const member functions
void neg()
member functions
double d0(double x, double y) const
private const member functions
double arcfun(double xh, double yh) const
private const member functions
void circle(double x1, double y1, double x2, double y2, double x3, double y3)
circle
double s(double x, double y) const
const member functions
CLHEP::HepMatrix dldc() const
private const member functions
bool xy(double, double &, double &, int dir=0) const
private const member functions
double x(double r) const
private const member functions
void rotate(double c, double s)
private member functions
CLHEP::HepVector Hpar(const HepGeom::Point3D< double > &pivot) const
const member functions
void xhyh(double x, double y, double &xh, double &yh) const
private const member functions
double check() const
private const member functions
static const double BELLE_ALPHA
belle alpha
double d(double x, double y) const
const member functions
virtual ~TRGCDCLpar()
Destructor.
double y(double r) const
private const member functions
CLHEP::HepVector center() const
const member functions
double phi(double r, int dir=0) const
const member functions
TRGCDCLpar & operator=(const TRGCDCLpar &)
assignment operator(s)
void move(double x, double y)
private member functions
double dr(double x, double y) const
const member functions
Abstract base class for different kinds of events.