10#if defined __cplusplus
25 beta = std::sqrt( K * ( K + 2. * m1 ) ) / ( K +
mi );
28 Kp =
mi - mf + K *
m2 /
mi * ( 1 - 0.5 * x * ( 1 - x ) ); }
30 Kp = std::sqrt(
mi *
mi + 2 * K *
m2 ) - mf;
45 double x, v_p, p, pp3, pp4, px3, py3, pz3, pz4, pz, p_perp2, E3, E4, gamma, m3cc2 = m3cc * m3cc, m4cc2 = m4cc * m4cc;
47 p = std::sqrt( e_kinetic_com * ( e_kinetic_com + 2. * m3cc ) * ( e_kinetic_com + 2. * m4cc ) * ( e_kinetic_com + 2. * ( m3cc + m4cc ) ) ) /
48 ( 2. * ( e_kinetic_com + m3cc + m4cc ) );
49 py3 = p * std::sqrt( 1 - mu * mu );
50 px3 = py3 * std::cos( phi );
51 py3 *= std::sin( phi );
54 E3 = std::sqrt( p * p + m3cc2 );
55 E4 = std::sqrt( p * p + m4cc2 );
56 gamma = std::sqrt( 1. / ( 1. -
beta *
beta ) );
57 pz3 = gamma * ( pz +
beta * E3 );
58 pz4 = gamma * ( -pz +
beta * E4 ); }
65 p_perp2 = px3 * px3 + py3 * py3;
67 outgoingData[0].
px_vx = px3;
68 outgoingData[0].
py_vy = py3;
69 outgoingData[0].
pz_vz = pz3;
70 pp3 = p_perp2 + pz3 * pz3;
71 x = ( m3cc > 0 ) ? pp3 / ( 2 * m3cc2 ) : 1.;
73 outgoingData[0].
kineticEnergy = m3cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
75 outgoingData[0].
kineticEnergy = std::sqrt( m3cc2 + pp3 ) - m3cc;
77 outgoingData[1].
px_vx = -px3;
78 outgoingData[1].
py_vy = -py3;
79 outgoingData[1].
pz_vz = pz4;
80 pp4 = p_perp2 + pz4 * pz4;
81 x = ( m4cc > 0 ) ? pp4 / ( 2 * m4cc2 ) : 1.;
83 outgoingData[1].
kineticEnergy = m4cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
85 outgoingData[1].
kineticEnergy = std::sqrt( m4cc2 + pp4 ) - m4cc;
88 if( outgoingData[0].isVelocity ) {
90 outgoingData[0].
px_vx *= v_p;
91 outgoingData[0].
py_vy *= v_p;
92 outgoingData[0].
pz_vz *= v_p;
95 outgoingData[1].
px_vx *= v_p;
96 outgoingData[1].
py_vy *= v_p;
97 outgoingData[1].
pz_vz *= v_p;
109 double a = masses[0] + masses[1], b, e_in = modes.
getProjectileEnergy( ) * masses[0] * masses[2] / ( a * a ), Ep;
115 a = std::sqrt( e_in );
116 b = std::sqrt( decaySamplingInfo->
Ep );
117 Ep = decaySamplingInfo->
Ep + e_in + 2. * decaySamplingInfo->
mu * a * b;
119 decaySamplingInfo->
mu = ( a + decaySamplingInfo->
mu * b ) / std::sqrt( Ep );
121 decaySamplingInfo->
Ep = Ep;
126#if defined __cplusplus
static constexpr double m3
static constexpr double m2
#define MCGIDI_speedOfLight_cm_sec
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
int MCGIDI_kinetics_COM2Lab(statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
int MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum(statusMessageReporting *, double beta, double e_kinetic_com, double mu, double phi, double m3cc, double m4cc, MCGIDI_sampledProductsData *outgoingData)
double getProjectileEnergy(void) const
#define smr_setReportError2(smr, libraryID, code, fmt,...)
double projectileMass_MeV
enum xDataTOM_frame frame
@ xDataTOM_frame_centerOfMass