GooFit  v2.1.3
Public Member Functions | List of all members
GooFit::Dim5 Struct Reference

#include <EvalVar.h>

Inheritance diagram for GooFit::Dim5:

Public Member Functions

 Dim5 ()
 
__host__ __device__ mcbooster::GReal_t cosHELANG (const mcbooster::Vector4R p, const mcbooster::Vector4R q, const mcbooster::Vector4R d)
 
__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__ void operator() (const mcbooster::GInt_t n, mcbooster::Vector4R **particles, mcbooster::GReal_t *variables) override
 

Detailed Description

Definition at line 19 of file EvalVar.h.

Constructor & Destructor Documentation

◆ Dim5()

GooFit::Dim5::Dim5 ( )
inline

Definition at line 20 of file EvalVar.h.

References GooFit::dim.

20 { dim = 4; }
constexpr rang::style const dim
Definition: Color.h:18

Member Function Documentation

◆ cosHELANG()

__host__ __device__ mcbooster::GReal_t GooFit::Dim5::cosHELANG ( const mcbooster::Vector4R  p,
const mcbooster::Vector4R  q,
const mcbooster::Vector4R  d 
)
inline

Definition at line 23 of file EvalVar.h.

Referenced by operator()().

23  {
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();
30 
31  return (pd * mq2 - pq * qd) / sqrt((pq * pq - mq2 * mp2) * (qd * qd - mq2 * md2));
32  }

◆ operator()()

__host__ __device__ void GooFit::Dim5::operator() ( const mcbooster::GInt_t  n,
mcbooster::Vector4R **  particles,
mcbooster::GReal_t *  variables 
)
inlineoverride

Definition at line 94 of file EvalVar.h.

References cosHELANG(), and phi().

94  {
95  mcbooster::Vector4R ppip = *particles[0];
96  mcbooster::Vector4R ppim = *particles[1];
97  mcbooster::Vector4R pK = *particles[2];
98  mcbooster::Vector4R ppip2 = *particles[3];
99 
100  mcbooster::Vector4R pM = ppip + ppim + pK + ppip2;
101  mcbooster::Vector4R ppipi = ppip + ppim;
102  mcbooster::Vector4R pKpi = pK + ppip2;
103 
104  variables[0] = ppipi.mass();
105  variables[1] = pKpi.mass();
106  variables[2] = cosHELANG(pM, ppipi, ppip);
107  variables[3] = cosHELANG(pM, pKpi, pK);
108  variables[4] = phi(pM, ppip, ppim, pK, ppip2);
109  }
__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)
Definition: EvalVar.h:34
__host__ __device__ mcbooster::GReal_t cosHELANG(const mcbooster::Vector4R p, const mcbooster::Vector4R q, const mcbooster::Vector4R d)
Definition: EvalVar.h:23

◆ phi()

__host__ __device__ mcbooster::GReal_t GooFit::Dim5::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 
)
inline

Definition at line 34 of file EvalVar.h.

Referenced by operator()().

38  {
39  mcbooster::Vector4R p4_d1p, p4_h1p, p4_h2p, p4_d2p;
40 
41  mcbooster::Vector4R d1_perp, d1_prime, h1_perp;
42  mcbooster::Vector4R D;
43 
44  D = p4_d1 + p4_d2;
45  mcbooster::Vector4R D2 = p4_h1 + p4_h2;
46 
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;
49 
50  // orthogonal to both D and d1_perp
51 
52  d1_prime = D.cross(d1_perp);
53 
54  d1_perp = d1_perp / d1_perp.d3mag();
55  d1_prime = d1_prime / d1_prime.d3mag();
56 
57  mcbooster::GReal_t x, y;
58 
59  x = d1_perp.dot(h1_perp);
60  y = d1_prime.dot(h1_perp);
61  mcbooster::GReal_t phi = atan2(y, x);
62  // printf("x:%.5g, y%.5g phi %.5g\n", x, y, phi );
63 
64  if(phi < 0.0)
65  phi += 2.0 * M_PI;
66 
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();
73 
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);
79 
80  mcbooster::GReal_t cp = (n1.dot(n2));
81  mcbooster::GReal_t sp = (n3.dot(h12n));
82 
83  mcbooster::GReal_t phi2 = acos(cp);
84 
85  if(sp < 0)
86  phi2 *= -1;
87 
88  // printf("cp %.5g, sp %.5g, phi2 %.5g\n",cp, sp, phi2 );
89 
90  return phi2;
91  }
__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)
Definition: EvalVar.h:34

The documentation for this struct was generated from the following file: