11 #if defined __cplusplus
26 return( outputChannel );
64 int n, delayedNeutronIndex = 0;
65 char const *genre, *
Q;
71 outputChannel->
parent = parent;
73 if( ( parent != NULL ) && ( strcmp( genre,
"NBody" ) ) ) {
77 if( strcmp( genre,
"twoBody" ) == 0 ) {
79 else if( strcmp( genre,
"NBody" ) == 0 ) {
81 else if( strcmp( genre,
"sumOfRemainingOutputChannels" ) == 0 ) {
97 if( strcmp( child->
name,
"product" ) == 0 ) {
99 &delayedNeutronIndex ) )
goto err;
101 else if( strcmp( child->
name,
"fissionEnergyReleased" ) == 0 ) {
104 printf(
"outputChannel child not currently supported = %s\n", child->
name );
108 double projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV;
148 return( &(outputChannel->
products[i]) );
187 return( outputChannel->
Q );
195 double Q = outputChannel->
Q;
198 for( iProduct = 0; iProduct < outputChannel->
numberOfProducts; iProduct++ ) {
199 product = &(outputChannel->
products[iProduct]);
217 int secondTwoBody = 0, isDecayChannel = ( outputChannel->
reaction == NULL );
220 double phi,
p, masses[3];
224 if (isDecayChannel) {
225 masses[0] = masses_[0];
226 masses[1] = masses_[1];
238 product = &(outputChannel->
products[i1]);
241 modes, decaySamplingInfo,
242 productDatas, masses ) < 0 )
return( -1 );
247 if (!secondTwoBody) {
251 if ((multiplicity = product->
multiplicity) == 0) multiplicity =
253 decaySamplingInfo->
rng( decaySamplingInfo->
rngState ) );
254 while (multiplicity > 0) {
257 decaySamplingInfo->
pop = product->
pop;
258 decaySamplingInfo->
mu = 0;
259 decaySamplingInfo->
Ep = 0;
261 productData[0].
pop = product->
pop;
270 switch( outputChannel->
genre ) {
276 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
279 productData[1].
pop = product[1].
pop;
284 if( !
smr_isOk( smr ) )
return( -1 );
286 if( !
smr_isOk( smr ) )
return( -1 );
296 switch( distribution->
type ) {
310 printf(
"Unknown spectral data form product name = %s, channel genre = %d\n", product->
pop->
name, outputChannel->
genre );
316 printf(
"Channel is undefined\n" );
320 printf(
"Channel is twoBodyDecay\n" );
324 printf(
"Channel is uncorrelatedDecay\n" );
328 printf(
"Unsupported channel genre = %d\n", outputChannel->
genre );
333 if (!secondTwoBody) {
340 p = std::sqrt( decaySamplingInfo->
Ep * ( decaySamplingInfo->
Ep + 2. * product->
pop->
mass_MeV ) );
342 productData[0].
pz_vz = p * decaySamplingInfo->
mu;
343 p = std::sqrt( 1. - decaySamplingInfo->
mu * decaySamplingInfo->
mu ) *
p;
344 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
345 productData[0].
px_vx = p * std::sin( phi );
346 productData[0].
py_vy = p * std::cos( phi );
360 #if defined __cplusplus