12 #include <mcbooster/GContainers.h> 13 #include <mcbooster/GFunctional.h> 14 #include <mcbooster/GTypes.h> 15 #include <mcbooster/Vector4R.h> 19 struct Dim5 :
public mcbooster::IFunctionArray {
22 __host__ __device__ mcbooster::GReal_t
23 cosHELANG(
const mcbooster::Vector4R p,
const mcbooster::Vector4R q,
const mcbooster::Vector4R d) {
24 mcbooster::GReal_t pd = p * d;
25 mcbooster::GReal_t pq = p * q;
26 mcbooster::GReal_t qd = q * d;
27 mcbooster::GReal_t mp2 = p.mass2();
28 mcbooster::GReal_t mq2 = q.mass2();
29 mcbooster::GReal_t md2 = d.mass2();
31 return (pd * mq2 - pq * qd) / sqrt((pq * pq - mq2 * mp2) * (qd * qd - mq2 * md2));
34 __host__ __device__ mcbooster::GReal_t
phi(
const mcbooster::Vector4R &p4_p,
35 const mcbooster::Vector4R &p4_d1,
36 const mcbooster::Vector4R &p4_d2,
37 const mcbooster::Vector4R &p4_h1,
38 const mcbooster::Vector4R &p4_h2) {
39 mcbooster::Vector4R p4_d1p, p4_h1p, p4_h2p, p4_d2p;
41 mcbooster::Vector4R d1_perp, d1_prime, h1_perp;
42 mcbooster::Vector4R D;
45 mcbooster::Vector4R D2 = p4_h1 + p4_h2;
47 d1_perp = p4_d1 - (D.dot(p4_d1) / D.dot(D)) * D;
48 h1_perp = p4_h1 - (D2.dot(p4_h1) / D2.dot(D2)) * D2;
52 d1_prime = D.cross(d1_perp);
54 d1_perp = d1_perp / d1_perp.d3mag();
55 d1_prime = d1_prime / d1_prime.d3mag();
57 mcbooster::GReal_t x, y;
59 x = d1_perp.dot(h1_perp);
60 y = d1_prime.dot(h1_perp);
61 mcbooster::GReal_t
phi = atan2(y, x);
67 mcbooster::Vector4R d1n = p4_d1 / p4_d1.d3mag();
68 mcbooster::Vector4R d2n = p4_d2 / p4_d2.d3mag();
69 mcbooster::Vector4R h1n = p4_h1 / p4_h1.d3mag();
70 mcbooster::Vector4R h2n = p4_h2 / p4_h2.d3mag();
71 mcbooster::Vector4R h12n = (p4_h1 + p4_h2);
72 h12n *= 1.0 / h12n.d3mag();
74 mcbooster::Vector4R n1 = d1n.cross(d2n);
75 mcbooster::Vector4R n2 = h1n.cross(h2n);
76 n1 *= 1.0 / n1.d3mag();
77 n2 *= 1.0 / n2.d3mag();
78 mcbooster::Vector4R n3 = n1.cross(n2);
80 mcbooster::GReal_t cp = (n1.dot(n2));
81 mcbooster::GReal_t sp = (n3.dot(h12n));
83 mcbooster::GReal_t phi2 = acos(cp);
93 __host__ __device__
void 94 operator()(
const mcbooster::GInt_t n, mcbooster::Vector4R **particles, mcbooster::GReal_t *variables)
override {
95 mcbooster::Vector4R ppip = *particles[0];
96 mcbooster::Vector4R ppim = *particles[1];
97 mcbooster::Vector4R pK = *particles[2];
98 mcbooster::Vector4R ppip2 = *particles[3];
100 mcbooster::Vector4R pM = ppip + ppim + pK + ppip2;
101 mcbooster::Vector4R ppipi = ppip + ppim;
102 mcbooster::Vector4R pKpi = pK + ppip2;
104 variables[0] = ppipi.mass();
105 variables[1] = pKpi.mass();
106 variables[2] =
cosHELANG(pM, ppipi, ppip);
108 variables[4] =
phi(pM, ppip, ppim, pK, ppip2);
__host__ __device__ void operator()(const mcbooster::GInt_t n, mcbooster::Vector4R **particles, mcbooster::GReal_t *variables) override
__host__ __device__ mcbooster::GReal_t phi(const mcbooster::Vector4R &p4_p, const mcbooster::Vector4R &p4_d1, const mcbooster::Vector4R &p4_d2, const mcbooster::Vector4R &p4_h1, const mcbooster::Vector4R &p4_h2)
__host__ __device__ mcbooster::GReal_t cosHELANG(const mcbooster::Vector4R p, const mcbooster::Vector4R q, const mcbooster::Vector4R d)
constexpr rang::style const dim