14 double r = -0.5 * (dp.
x()*dp.
x() + dp.
y()*dp.
y()) /
15 (dp.
x()*n2.
x() + dp.
y()*n2.
y());
18 double dphi =
sqrt(2 * 0.1 / fabs(r));
20 double phi = acos(( (p1-c).
x()*(p2-c).
x() +
21 (p1-c).
y()*(p2-c).
y() )/(r*r));
23 if(dp.
x()*v2.
x() + dp.
y()*v2.
y() < 0) phi = 2*
M_PI - phi;
25 int nstep = (int)(phi/dphi) + 1;
30 double dz = (p2 -
p1).
z() / nstep;
36 charge = ((p1 -
c).
x() * (p2 -
c).
y() - (p1 -
c).
y() * (p2 -
c).
x() > 0 ?
38 if(dp.
x()*v2.
x() + dp.
y()*v2.
y() < 0) charge = -charge;
40 outFile <<
", Line[{{"<<P0.
x()<<
","<<P0.
y()<<
",("<<P0.
z()<<
"-zs)*mz}" ;
42 for(
int i = 0;
i - nstep < 0;
i++)
44 double a = -charge * (
i+1)*dphi;
45 double z = p1.z() + (
i+1)*dz;
47 double x = c.
x() +
cos(a)*(p1 -
c).
x() -
sin(a)*(p1 -
c).
y();
48 double y = c.
y() +
sin(a)*(p1 -
c).
x() +
cos(a)*(p1 -
c).
y();
52 outFile <<
", {"<<P1.
x()<<
","<<P1.
y()<<
",("<<P1.
z()<<
"-zs)*mz}";
55 outFile <<
"}]" << std::endl;
62 outFile <<
", Line[{{"<<P0.
x()<<
","<<P0.
y()<<
",("<<P0.
z()<<
"-zs)*mz}"
63 <<
", {"<<P1.
x()<<
","<<P1.
y()<<
",("<<P1.
z()<<
"-zs)*mz}}]" << std::endl;
void printHelix(const GlobalPoint &p1, const GlobalPoint &p2, const GlobalVector &n2, std::ofstream &outFile, int charge)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
Cos< T >::type cos(const T &t)
Vector3DBase unit() const