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;
139 return( &(outputChannel->
products[i]) );
178 return( outputChannel->
Q );
186 double Q = outputChannel->
Q;
189 for( iProduct = 0; iProduct < outputChannel->
numberOfProducts; iProduct++ ) {
190 product = &(outputChannel->
products[iProduct]);
202 int i1, multiplicity, secondTwoBody = 0, isDecayChannel = ( outputChannel->
reaction == NULL );
205 double phi,
p, masses[3];
209 if( isDecayChannel ) {
210 masses[0] = masses_[0];
211 masses[1] = masses_[1]; }
218 product = &(outputChannel->
products[i1]);
224 if( !secondTwoBody ) {
226 decaySamplingInfo->
rng( decaySamplingInfo->
rngState ) );
227 while( multiplicity > 0 ) {
230 decaySamplingInfo->
pop = product->
pop;
231 decaySamplingInfo->
mu = 0;
232 decaySamplingInfo->
Ep = 0;
234 productData[0].
pop = product->
pop;
242 switch( outputChannel->
genre ) {
247 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
249 if( !
smr_isOk( smr ) )
return( -1 );
250 productData[1].
pop = product[1].
pop;
255 if( !
smr_isOk( smr ) )
return( -1 );
257 if( !
smr_isOk( smr ) )
return( -1 );
263 switch( distribution->
type ) {
277 printf(
"Unknown spectral data form product name = %s, channel genre = %d\n", product->
pop->
name, outputChannel->
genre );
282 printf(
"Channel is undefined\n" );
285 printf(
"Channel is twoBodyDecay\n" );
288 printf(
"Channel is uncorrelatedDecay\n" );
291 printf(
"Unsupported channel genre = %d\n", outputChannel->
genre );
294 if( !
smr_isOk( smr ) )
return( -1 );
295 if( !secondTwoBody ) {
300 p = std::sqrt( decaySamplingInfo->
Ep * ( decaySamplingInfo->
Ep + 2. * product->
pop->
mass_MeV ) );
302 productData[0].
pz_vz = p * decaySamplingInfo->
mu;
303 p = std::sqrt( 1. - decaySamplingInfo->
mu * decaySamplingInfo->
mu ) *
p;
304 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
305 productData[0].
px_vx = p * std::sin( phi );
306 productData[0].
py_vy = p * std::cos( phi );
308 if( !
smr_isOk( smr ) )
return( -1 );
317 #if defined __cplusplus
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
#define MCGIDI_speedOfLight_cm_sec
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
int MCGIDI_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
double delayedNeutronRate
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
double MCGIDI_outputChannel_getTargetMass_MeV(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_product_release(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_outputChannel * MCGIDI_outputChannel_new(statusMessageReporting *smr)
double MCGIDI_outputChannel_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
#define smr_setReportError2p(smr, libraryID, code, fmt)
MCGIDI_product * MCGIDI_outputChannel_getProductAtIndex(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, int i)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int MCGIDI_outputChannel_numberOfProducts(MCGIDI_outputChannel *outputChannel)
int MCGIDI_energyAngular_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
MCGIDI_outputChannel * MCGIDI_outputChannel_free(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_uncorrelated_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_outputChannel_getDomain(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
double MCGIDI_outputChannel_getFinalQ(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int smr_isOk(statusMessageReporting *smr)
double delayedNeutronRate
G4double G4Log(G4double x)
enum MCGIDI_distributionType type
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
double MCGIDI_outputChannel_getQ_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
enum MCGIDI_channelGenre genre
MCGIDI_KalbachMann * KalbachMann
void * smr_freeMemory(void **p)
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
int MCGIDI_kinetics_COM2Lab(statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
enum xDataTOM_frame frame
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
MCGIDI_outputChannel decayChannel
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
MCGIDI_distribution distribution
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
MCGIDI_product * products
double getProjectileEnergy(void) const
MCGIDI_angularEnergy * angularEnergy
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
MCGIDI_reaction * reaction
int MCGIDI_KalbachMann_sampleEp(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)