12 #if defined __cplusplus
60 double productMass_MeV,
double residualMass_MeV ) {
62 if( angular == NULL )
return( 0 );
76 char const *nativeData;
85 if( strcmp( nativeData,
"isotropic" ) == 0 ) {
91 else if( strcmp( nativeData,
"recoil" ) == 0 ) {
95 double norm, energyFactor;
102 char const *energyUnit, *multiplicityProbabilityUnits[2] = {
"",
"" };
110 frameElement = linearElement;
118 if( ( dists->
Ws = (
double *)
smr_malloc2( smr, W_XYs->
length *
sizeof(
double ), 1,
"dists->Ws" ) ) == NULL )
goto err;
126 for( i = 0; i < W_XYs->
length; i++ ) {
127 XYs = &(W_XYs->
XYs[i]);
128 dist = &(dists->
dist[i]);
129 dists->
Ws[i] = XYs->
value * energyFactor;
134 if( ( dist->
Xs = (
double *)
smr_malloc2( smr, 3 * n *
sizeof(
double ), 0,
"dist->Xs" ) ) == NULL )
goto err;
136 dist->
pdf = &(dist->
Xs[
n]);
139 for( j = 0; j <
n; j++ ) {
141 dist->
Xs[j] = point->
x;
142 dist->
pdf[j] = point->
y;
150 if( norms != NULL ) {
152 else if( std::fabs( 1. - norm ) > 0.99 ) {
157 for( j = 0; j <
n; j++ ) dist->
pdf[j] /= norm;
164 if( frameElement != NULL ) {
168 distribution->
angular = angular;
175 if( cdfX != NULL ) cdfX =
ptwX_free( cdfX );
185 double randomMu = decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
188 switch( angular->
type ) {
191 decaySamplingInfo->
mu = 1. - 2. * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
198 decaySamplingInfo->
mu = sampled.
x;
207 #if defined __cplusplus