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]);
211 int i1, multiplicity, secondTwoBody = 0, isDecayChannel = ( outputChannel->
reaction == NULL );
214 double phi,
p, masses[3];
218 if( isDecayChannel ) {
219 masses[0] = masses_[0];
220 masses[1] = masses_[1]; }
227 product = &(outputChannel->
products[i1]);
233 if( !secondTwoBody ) {
235 decaySamplingInfo->
rng( decaySamplingInfo->
rngState ) );
236 while( multiplicity > 0 ) {
239 decaySamplingInfo->
pop = product->
pop;
240 decaySamplingInfo->
mu = 0;
241 decaySamplingInfo->
Ep = 0;
243 productData[0].
pop = product->
pop;
251 switch( outputChannel->
genre ) {
256 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
258 if( !
smr_isOk( smr ) )
return( -1 );
259 productData[1].
pop = product[1].
pop;
264 if( !
smr_isOk( smr ) )
return( -1 );
266 if( !
smr_isOk( smr ) )
return( -1 );
272 switch( distribution->
type ) {
286 printf(
"Unknown spectral data form product name = %s, channel genre = %d\n", product->
pop->
name, outputChannel->
genre );
291 printf(
"Channel is undefined\n" );
294 printf(
"Channel is twoBodyDecay\n" );
297 printf(
"Channel is uncorrelatedDecay\n" );
300 printf(
"Unsupported channel genre = %d\n", outputChannel->
genre );
303 if( !
smr_isOk( smr ) )
return( -1 );
304 if( !secondTwoBody ) {
309 p = std::sqrt( decaySamplingInfo->
Ep * ( decaySamplingInfo->
Ep + 2. * product->
pop->
mass_MeV ) );
311 productData[0].
pz_vz = p * decaySamplingInfo->
mu;
312 p = std::sqrt( 1. - decaySamplingInfo->
mu * decaySamplingInfo->
mu ) *
p;
313 phi = 2. *
M_PI * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
314 productData[0].
px_vx = p * std::sin( phi );
315 productData[0].
py_vy = p * std::cos( phi );
317 if( !
smr_isOk( smr ) )
return( -1 );
326 #if defined __cplusplus
int MCGIDI_outputChannel_getDomain(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_reaction * reaction
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
int MCGIDI_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
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])
int MCGIDI_energyAngular_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
double MCGIDI_outputChannel_getFinalQ(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
double MCGIDI_outputChannel_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
enum MCGIDI_distributionType type
G4double G4Log(G4double x)
enum MCGIDI_channelGenre genre
MCGIDI_angularEnergy * angularEnergy
int MCGIDI_outputChannel_numberOfProducts(MCGIDI_outputChannel *outputChannel)
MCGIDI_outputChannel * MCGIDI_outputChannel_free(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
MCGIDI_outputChannel decayChannel
double MCGIDI_outputChannel_getQ_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
double delayedNeutronRate
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
int smr_isOk(statusMessageReporting *smr)
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double delayedNeutronRate
printf("%d Experimental points found\n", nlines)
MCGIDI_KalbachMann * KalbachMann
MCGIDI_product * MCGIDI_outputChannel_getProductAtIndex(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, int i)
enum xDataTOM_frame frame
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
#define smr_setReportError2p(smr, libraryID, code, fmt)
int MCGIDI_KalbachMann_sampleEp(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
void * smr_freeMemory(void **p)
int MCGIDI_product_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_product *product, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
int MCGIDI_uncorrelated_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
MCGIDI_product * products
MCGIDI_outputChannel * MCGIDI_outputChannel_new(statusMessageReporting *smr)
double getProjectileEnergy(void) const
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated(statusMessageReporting *smr, MCGIDI_reaction *reaction)
#define MCGIDI_speedOfLight_cm_sec
double MCGIDI_outputChannel_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
MCGIDI_distribution distribution
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)