6#define _USE_MATH_DEFINES
12#if defined __cplusplus
27 return( outputChannel );
65 int n{0}, delayedNeutronIndex{0};
66 char const *genre{
""}, *Q{
""};
72 outputChannel->
parent = parent;
74 if( ( parent != NULL ) && ( strcmp( genre,
"NBody" ) ) ) {
78 if( strcmp( genre,
"twoBody" ) == 0 ) {
80 else if( strcmp( genre,
"NBody" ) == 0 ) {
82 else if( strcmp( genre,
"sumOfRemainingOutputChannels" ) == 0 ) {
98 if( strcmp( child->name,
"product" ) == 0 ) {
100 &delayedNeutronIndex ) )
goto err;
102 else if( strcmp( child->name,
"fissionEnergyReleased" ) == 0 ) {
105 printf(
"outputChannel child not currently supported = %s\n", child->name );
109 double projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV;
149 return( &(outputChannel->
products[i]) );
188 return( outputChannel->
Q );
196 double Q = outputChannel->
Q;
199 for( iProduct = 0; iProduct < outputChannel->
numberOfProducts; iProduct++ ) {
200 product = &(outputChannel->
products[iProduct]);
218 int secondTwoBody = 0, isDecayChannel = ( outputChannel->
reaction == NULL );
221 double phi, p, masses[3];
225 if (isDecayChannel) {
226 masses[0] = masses_[0];
227 masses[1] = masses_[1];
239 product = &(outputChannel->
products[i1]);
242 modes, decaySamplingInfo,
243 productDatas, masses ) < 0 )
return( -1 );
248 if (!secondTwoBody) {
252 if ((multiplicity = product->
multiplicity) == 0) multiplicity =
254 decaySamplingInfo->
rng( decaySamplingInfo->
rngState ) );
255 while (multiplicity > 0) {
258 decaySamplingInfo->
pop = product->
pop;
259 decaySamplingInfo->
mu = 0;
260 decaySamplingInfo->
Ep = 0;
262 productData[0].
pop = product->
pop;
271 switch( outputChannel->
genre ) {
277 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
280 productData[1].
pop = product[1].
pop;
285 if( !
smr_isOk( smr ) )
return( -1 );
287 if( !
smr_isOk( smr ) )
return( -1 );
297 switch( distribution->
type ) {
311 printf(
"Unknown spectral data form product name = %s, channel genre = %d\n", product->
pop->
name, outputChannel->
genre );
317 printf(
"Channel is undefined\n" );
321 printf(
"Channel is twoBodyDecay\n" );
325 printf(
"Channel is uncorrelatedDecay\n" );
329 printf(
"Unsupported channel genre = %d\n", outputChannel->
genre );
334 if (!secondTwoBody) {
341 p = std::sqrt( decaySamplingInfo->
Ep * ( decaySamplingInfo->
Ep + 2. * product->
pop->
mass_MeV ) );
343 productData[0].
pz_vz = p * decaySamplingInfo->
mu;
344 p = std::sqrt( 1. - decaySamplingInfo->
mu * decaySamplingInfo->
mu ) * p;
345 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
346 productData[0].
px_vx = p * std::sin( phi );
347 productData[0].
py_vy = p * std::cos( phi );
361#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