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
G4double G4Log(G4double x)
MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_outputChannel_getDomain(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
#define MCGIDI_speedOfLight_cm_sec
MCGIDI_outputChannel * MCGIDI_outputChannel_new(statusMessageReporting *smr)
double MCGIDI_outputChannel_getQ_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
int MCGIDI_KalbachMann_sampleEp(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
@ MCGIDI_distributionType_angularEnergy_e
@ MCGIDI_distributionType_energyAngular_e
@ MCGIDI_distributionType_KalbachMann_e
@ MCGIDI_distributionType_uncorrelated_e
@ MCGIDI_distributionType_none_e
@ MCGIDI_channelGenre_uncorrelated_e
@ MCGIDI_channelGenre_twoBody_e
@ MCGIDI_channelGenre_twoBodyDecay_e
@ MCGIDI_channelGenre_undefined_e
@ MCGIDI_channelGenre_uncorrelatedDecay_e
@ MCGIDI_channelGenre_sumOfRemaining_e
double MCGIDI_outputChannel_getFinalQ(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
MCGIDI_outputChannel * MCGIDI_outputChannel_free(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
int MCGIDI_kinetics_COM2Lab(statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated(statusMessageReporting *smr, MCGIDI_reaction *reaction)
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int MCGIDI_uncorrelated_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
double MCGIDI_outputChannel_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
int MCGIDI_outputChannel_numberOfProducts(MCGIDI_outputChannel *outputChannel)
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
int MCGIDI_energyAngular_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_product_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_product *product, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_product * MCGIDI_outputChannel_getProductAtIndex(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, int i)
double MCGIDI_outputChannel_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double getProjectileEnergy(void) const
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_setReportError2p(smr, libraryID, code, fmt)
void * smr_freeMemory(void **p)
int smr_isOk(statusMessageReporting *smr)
#define smr_malloc2(smr, size, zero, forItem)
enum xDataTOM_frame frame
MCGIDI_angularEnergy * angularEnergy
enum MCGIDI_distributionType type
MCGIDI_KalbachMann * KalbachMann
MCGIDI_reaction * reaction
enum MCGIDI_channelGenre genre
MCGIDI_product * products
double delayedNeutronRate
MCGIDI_outputChannel decayChannel
MCGIDI_distribution distribution
double delayedNeutronRate
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
@ xDataTOM_frame_centerOfMass