40#if defined __cplusplus
56 m4 = pp4->productID->fullMass_MeV;
59 beta = std::sqrt( K * ( K + 2. * m1 ) ) / ( K + mi );
60 x = K * m2 / ( mi * mi );
62 Kp = mi - mf + K * m2 / mi * ( 1 - 0.5 * x * ( 1 - x ) ); }
64 Kp = std::sqrt( mi * mi + 2 * K * m2 ) - mf;
69 outgoingData[1].
productID = pp4->productID;
84 double x, v_p, p, pp3, pp4, px3, py3, pz3, pz4, pz, p_perp2, E3, E4, gamma, m3cc2 = m3cc * m3cc, m4cc2 = m4cc * m4cc;
86 p = std::sqrt( e_kinetic_com * ( e_kinetic_com + 2. * m3cc ) * ( e_kinetic_com + 2. * m4cc ) * ( e_kinetic_com + 2. * ( m3cc + m4cc ) ) ) /
87 ( 2. * ( e_kinetic_com + m3cc + m4cc ) );
88 py3 = p * std::sqrt( 1 - mu * mu );
89 px3 = py3 * std::cos( phi );
90 py3 *= std::sin( phi );
93 E3 = std::sqrt( p * p + m3cc2 );
94 E4 = std::sqrt( p * p + m4cc2 );
95 gamma = std::sqrt( 1. / ( 1. - beta * beta ) );
96 pz3 = gamma * ( pz + beta * E3 );
97 pz4 = gamma * ( -pz + beta * E4 ); }
103 outgoingData[1].
frame = outgoingData[0].
frame;
105 p_perp2 = px3 * px3 + py3 * py3;
107 outgoingData[0].
px_vx = px3;
108 outgoingData[0].
py_vy = py3;
109 outgoingData[0].
pz_vz = pz3;
110 pp3 = p_perp2 + pz3 * pz3;
111 x = pp3 / ( 2 * m3cc2 );
113 outgoingData[0].
kineticEnergy = m3cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
115 outgoingData[0].
kineticEnergy = std::sqrt( m3cc2 + pp3 ) - m3cc;
117 outgoingData[1].
px_vx = -px3;
118 outgoingData[1].
py_vy = -py3;
119 outgoingData[1].
pz_vz = pz4;
120 pp4 = p_perp2 + pz4 * pz4;
121 x = pp4 / ( 2 * m4cc2 );
123 outgoingData[1].
kineticEnergy = m4cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
125 outgoingData[1].
kineticEnergy = std::sqrt( m4cc2 + pp4 ) - m4cc;
128 if( outgoingData[0].isVelocity ) {
130 outgoingData[0].
px_vx *= v_p;
131 outgoingData[0].
py_vy *= v_p;
132 outgoingData[0].
pz_vz *= v_p;
135 outgoingData[1].
px_vx *= v_p;
136 outgoingData[1].
py_vy *= v_p;
137 outgoingData[1].
pz_vz *= v_p;
143#if defined __cplusplus
tpia_particle * productID
tpia_decayChannel * decayChannel
tpia_decayChannel decayChannel
tpia_particle * productID
#define tpia_referenceFrame_lab
int tpia_kinetics_2BodyReaction(statusMessageReporting *smr, tpia_decayChannel *decayChannel, double K, double mu, double phi, tpia_productOutgoingData *outgoingData)
tpia_product * tpia_decayChannel_getFirstProduct(tpia_decayChannel *decayChannel)
int tpia_frame_getColumn(statusMessageReporting *smr, tpia_data_frame *frame, int column)
int tpia_kinetics_COMKineticEnergy2LabEnergyAndMomentum(statusMessageReporting *smr, double beta, double e_kinetic_com, double mu, double phi, double m3cc, double m4cc, tpia_productOutgoingData *outgoingData)
#define tpia_speedOfLight_cm_sec
tpia_product * tpia_decayChannel_getNextProduct(tpia_product *product)