37 ceq[3] = 2 * helix2.
mag2();
63 ceq[3] = 2 * helix2.
dot(helix2p);
66 ceq[2] = 3 *
theDirection.
dot(lineDirection) * helix2.dot(lineDirection);
68 ceq[0] = deltaPos.
dot(helix1p);
86 for (
unsigned int i = 0;
i < nRaw;
i++) {
92 return std::make_pair(
false, 0.);
97 for (
unsigned int i = 0;
i < nDir;
i++) {
99 double deri2 = (3 * ceq[3] * st + 2 * ceq[2]) * st + ceq[1];
104 return std::make_pair(
false, 0.);
109 for (
unsigned int i = 1;
i <
nMin;
i++) {
121 if (fabs(ceq[3]) > FLT_MIN) {
123 double q = (ceq[2] * ceq[2] - 3 * ceq[3] * ceq[1]) / (ceq[3] * ceq[3]) / 9.;
124 double r = (2 * ceq[2] * ceq[2] * ceq[2] - 9 * ceq[3] * ceq[2] * ceq[1] + 27 * ceq[3] * ceq[3] * ceq[0]) /
125 (ceq[3] * ceq[3] * ceq[3]) / 54.;
126 double q3 =
q *
q *
q;
128 double phi = acos(
r /
sqrt(q3)) / 3.;
129 double rootq =
sqrt(
q);
130 for (
int i = 0;
i < 3;
i++) {
136 double a =
pow(fabs(
r) +
sqrt(
r *
r - q3), 1. / 3.);
139 double b = fabs(
a) > FLT_MIN ?
q /
a : 0.;
148 else if (fabs(ceq[2]) > FLT_MIN) {
161 double deq1 = coeff[1] * coeff[1];
162 double deq2 = coeff[2] * coeff[0];
163 if (fabs(deq1) < FLT_MIN || fabs(deq2 / deq1) > 1.
e-6) {
167 double deq = deq1 + 2 * deq2;
170 double ceq = -0.5 * (coeff[1] + (coeff[1] > 0 ? 1 : -1) *
sqrt(deq));
178 double ceq = coeff[1] / coeff[2];
179 double deq = deq2 / deq1;
180 deq *= (1 - deq / 2);
T x() const
Cartesian x coordinate.
T y() const
Cartesian y coordinate.
T curvature(T InversePt, const MagneticField &field)
Cos< T >::type cos(const T &t)
T z() const
Cartesian z coordinate.
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Power< A, B >::type pow(const A &a, const B &b)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point