12#if defined __cplusplus
85 char const *name, *label, *delayedNeutron, *multiplicityStr, *multiplicityUnits[2] = {
"MeV",
"" };
88 ptwXYPoints *multiplicityVsEnergy = NULL, *norms1 = NULL, *norms2 = NULL;
103 if( strcmp( delayedNeutron,
"delayed" ) == 0 ) {
109 (*delayedNeutronIndex)++;
115 if( strcmp( multiplicityStr,
"energyDependent" ) ) {
121 if( MCGIDI_product_parseWeightedReferenceMultiplicityFromTOM( smr, multiplicityTOM, product, &multiplicityVsEnergy, &norms1 ) )
goto err; }
123 if( MCGIDI_product_parsePiecewiseMultiplicity( smr, multiplicityTOM, product ) )
goto err; }
125 if( ( multiplicityVsEnergy = MCGIDI_product_parsePolynomialMultiplicity( smr, multiplicityTOM, product ) ) == NULL )
goto err; }
133 if( strcmp( product->
pop->
name,
"gamma" ) == 0 ) {
140 if( norms2 != NULL ) {
148 if( ( norms1 != NULL ) && ( norms2 != NULL ) ) {
154 product->
norms = norms1;
155 if( norms2 != NULL ) product->
norms = norms2;
164 if( multiplicityVsEnergy != NULL )
ptwXY_free( multiplicityVsEnergy );
179 char const *multiplicityUnits[2] = {
"MeV",
"" };
181 if( ( product->piecewiseMultiplicities = (
ptwXYPoints **)
smr_malloc2( smr, regionsXYs->length *
sizeof(
ptwXYPoints * ), 1,
"piecewiseMultiplicities" ) ) == NULL )
return( 1 );
183 for( i = 0; i < regionsXYs->length; i++ ) {
185 XYs = &(regionsXYs->XYs[i]);
187 ) == NULL )
return( 1 );
188 product->piecewiseMultiplicities[i] = multiplicityVsEnergy;
189 product->numberOfPiecewiseMultiplicities++;
200 double *coefficients;
201 char const *energyUnit;
221 ptwXY_setValueAtX( ptwXY, EMin, MCGIDI_product_evaluatePolynomial( EMin, &args ) );
222 ptwXY_setValueAtX( ptwXY, EMax, MCGIDI_product_evaluatePolynomial( EMax, &args ) );
224 int i,
n = 4 * length;
225 double E = EMin, dE = ( EMax - EMin ) / n;
227 for( i = 1; i <
n; i++ ) {
257 char const *link, *energyInMWUnits[2] = {
"MeV",
"" };
258 xDataTOM_element *reference, *productTOM, *multiplicity, *weights, *pointwise;
275 if( *multiplicityVsEnergy != NULL ) *multiplicityVsEnergy =
ptwXY_free( *multiplicityVsEnergy );
276 if( *norms != NULL ) *norms =
ptwXY_free( *norms );
290 double productMass_MeV,
double residualMass_MeV ) {
328 double y, norm = 1.0;
340 multiplicity = (int) y;
341 if( r < ( y - multiplicity ) ) multiplicity++;
343 return( multiplicity );
364 if( incrementSize < 10 ) incrementSize = 10;
368 sampledProductsDatas->
products = NULL;
419 if( index < 0 )
return( NULL );
421 return( &(sampledProductsDatas->
products[index]) );
424#if defined __cplusplus
MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_sampling_ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x1)
int MCGIDI_angular_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_angular *angular, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
int MCGIDI_outputChannel_getDomain(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
@ MCGIDI_distributionType_angular_e
int MCGIDI_distribution_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product, MCGIDI_POPs *pops, ptwXYPoints *norms)
MCGIDI_product * MCGIDI_product_free(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
int MCGIDI_distribution_release(statusMessageReporting *smr, MCGIDI_distribution *distribution)
int MCGIDI_product_initialize(statusMessageReporting *smr, MCGIDI_product *product)
double MCGIDI_outputChannel_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_POP_getMass_MeV(MCGIDI_POP *pop)
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_product * MCGIDI_product_new(statusMessageReporting *smr)
double MCGIDI_outputChannel_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
ptwXYPoints * MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *units[2])
ptwXYPoints * MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_element *linear, char const *toUnits[2])
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *, MCGIDI_product *product, double e_in, double r)
MCGIDI_sampledProductsData * MCGIDI_sampledProducts_getProductAtIndex(MCGIDI_sampledProductsDatas *sampledProductsDatas, int index)
int MCGIDI_sampledProducts_number(MCGIDI_sampledProductsDatas *sampledProductsDatas)
double MCGIDI_product_getMass_MeV(statusMessageReporting *, MCGIDI_product *product)
int MCGIDI_product_sampleMu(statusMessageReporting *smr, MCGIDI_product *product, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_sampledProducts_release(statusMessageReporting *, MCGIDI_sampledProductsDatas *sampledProductsDatas)
struct polynomialCallbackArgs_s polynomialCallbackArgs
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
int MCGIDI_sampledProducts_initialize(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, int incrementSize)
int MCGIDI_sampledProducts_remalloc(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_product_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_product *product, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
enum nfu_status_e nfu_status
const char * nfu_statusMessage(nfu_status status)
nfu_status ptwXY_setValueAtX(ptwXYPoints *ptwXY, double x, double y)
double ptwXY_getYMax(ptwXYPoints *ptwXY)
nfu_status ptwXY_simpleCoalescePoints(ptwXYPoints *ptwXY)
ptwXYPoints * ptwXY_new(ptwXY_interpolation interpolation, ptwXY_interpolationOtherInfo const *interpolationOtherInfo, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, nfu_status *status, int userFlag)
@ ptwXY_interpolationLinLin
int64_t ptwXY_length(ptwXYPoints *ptwXY)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
double ptwXY_getXMax(ptwXYPoints *ptwXY)
double ptwXY_getYMin(ptwXYPoints *ptwXY)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_setReportError2p(smr, libraryID, code, fmt)
#define smr_realloc2(smr, old, size, forItem)
#define smr_allocateCopyString2(smr, s, forItem)
void * smr_freeMemory(void **p)
int smr_isOk(statusMessageReporting *smr)
#define smr_malloc2(smr, size, zero, forItem)
enum MCGIDI_distributionType type
double delayedNeutronRate
MCGIDI_outputChannel decayChannel
MCGIDI_distribution distribution
ptwXYPoints * multiplicityVsEnergy
MCGIDI_outputChannel * outputChannel
int numberOfPiecewiseMultiplicities
ptwXYPoints ** piecewiseMultiplicities
MCGIDI_sampledProductsData * products
xDataTOM_xDataInfo xDataInfo
char const * xDataTOM_axes_getUnit(statusMessageReporting *smr, xDataTOM_axes *axes, int index)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
xDataTOM_element * xDataTOM_getLinksElement(statusMessageReporting *smr, xDataTOM_element *element, char const *link)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
int xDataTOME_convertAttributeToInteger(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int *n)
int xDataTOM_polynomial_getDataFromXDataInfo(xDataTOM_xDataInfo *xDI, double **data)