5 #include "vdt/sincos.h" 11 x = par.constAt(ti, 0, 0);
12 y = par.constAt(ti, 1, 0);
13 z = par.constAt(ti, 2, 0);
14 const float pt = 1.0f / par.constAt(ti, 3, 0);
29 const float k = 1.0f /
inv_k;
32 const float oo_curv = 1.0f / curv;
43 float td = (
R - r0) * curv;
44 float id = oo_curv * td * (1.0f + 0.16666666f * td * td);
54 vdt::fast_sincosf(
alpha, sina, cosa);
58 c.x +=
k * (
c.px * sina -
c.py * (1.0f - cosa));
59 c.y +=
k * (
c.py * sina +
c.px * (1.0f - cosa));
61 const float o_px =
c.px;
62 c.px =
c.px * cosa -
c.py * sina;
63 c.py =
c.py * cosa + o_px * sina;
82 const float k = 1.0f /
inv_k;
84 const float dz =
Z -
z;
88 vdt::fast_sincosf(
alpha, sina, cosa);
91 c.x =
x +
k * (
px * sina -
py * (1.0f - cosa));
92 c.y =
y +
k * (
py * sina +
px * (1.0f - cosa));
95 if (update_momentum) {
96 c.px =
px * cosa -
py * sina;
97 c.py =
py * cosa +
px * sina;
143 throw std::runtime_error(
"Quadratic prop_to_plane not implemented");
147 throw std::runtime_error(
"Exact prop_to_plane not implemented");
159 for (
int i = 0;
i < y.kTotSize; ++
i) {
160 t[
i] = vdt::fast_atan2f(y[
i],
x[
i]);
167 for (
int i = 0;
i <
a.kTotSize; ++
i) {
168 t[
i] = vdt::fast_tanf(
a[
i]);
174 for (
int i = 0;
i <
a.kTotSize; ++
i) {
175 vdt::fast_sincosf(
a[
i],
s[
i],
c[
i]);
180 x = par.ReduceFixedIJ(0, 0);
181 y = par.ReduceFixedIJ(1, 0);
182 z = par.ReduceFixedIJ(2, 0);
183 const MPF pt = 1.0f / par.ReduceFixedIJ(3, 0);
204 const MPF oo_curv = 1.0f / curv;
215 MPF td = (
R - r0) * curv;
216 MPF id = oo_curv * td * (1.0f + 0.16666666f * td * td);
231 c.x +=
k * (
c.px * sina -
c.py * (1.0f - cosa));
232 c.y +=
k * (
c.py * sina +
c.px * (1.0f - cosa));
235 c.px =
c.px * cosa -
c.py * sina;
236 c.py =
c.py * cosa + o_px * sina;
247 for (
int i = 0;
i < N_proc; ++
i) {
274 c.x =
x +
k * (
px * sina -
py * (1.0f - cosa));
275 c.y =
y +
k * (
py * sina +
px * (1.0f - cosa));
278 if (update_momentum) {
279 c.px =
px * cosa -
py * sina;
280 c.py =
py * cosa +
px * sina;
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Sin< T >::type sin(const T &t)
int propagate_to_r(PropAlgo_e algo, const MPF &R, StatePlex &c, bool update_momentum, int N_proc=NN) const
int propagate_to_z(PropAlgo_e algo, const MPF &Z, StatePlex &c, bool update_momentum, int N_proc=NN) const
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
bool propagate_to_z(PropAlgo_e algo, float Z, State &c, bool update_momentum) const
Cos< T >::type cos(const T &t)
MPF fast_tan(const MPF &a)
bool propagate_to_plane(PropAlgo_e algo, const ModuleInfo &mi, State &c, bool update_momentum) const
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
DecomposeProduct< arg, typename Div::arg > D
MPF fast_atan2(const MPF &y, const MPF &x)
void fast_sincos(const MPF &a, MPF &s, MPF &c)
bool propagate_to_r(PropAlgo_e algo, float R, State &c, bool update_momentum) const