43#if defined __cplusplus
48static const int tpia_b_unknown = 0,
50 tpia_b_twoBody_formFactor = 0,
54 tpia_b_NBody_pairProduction = 0;
125 multiplicity_next = multiplicity->
next;
131 for( decayProduct = product->
decayChannel.
products; decayProduct != NULL; decayProduct = nextProduct ) {
132 nextProduct = decayProduct->
next;
145 char const *productGenre;
146 char *name, *multiplicity, *e;
156 if( multiplicity != NULL ) {
157 if( strcmp( multiplicity,
"energyDependent" ) && strcmp( multiplicity,
"partialProduction" ) ) {
159 while( isspace( *e ) ) e++;
189 if(
smr_isOk( smr ) ) _tpia_product_getProductOutgoingData( smr, productElement, product );
202 if( strcmp( data->
name,
"depositionEnergy" ) == 0 ) {
204 if( _tpia_product_checkRequiredData( smr, allowMany,
tpia_m_depositionEnergy, productElement, product, (
char*)
"deposition energy" ) )
return( 1 );
205 if( _tpia_product_getDepositionEnergy( smr, data, product ) != 0 )
return( 1 ); }
206 else if( strcmp( data->
name,
"multiplicity" ) == 0 ) {
209 if( _tpia_product_checkRequiredData( smr, allowMany,
tpia_m_multiplicity, productElement, product, (
char*)
"multiplicity" ) )
return( 1 );
210 if( _tpia_product_getMultiplicityFromElement( smr, data, product ) != 0 )
return( 1 ); }
211 else if( strcmp( data->
name,
"angular" ) == 0 ) {
213 if( _tpia_product_checkRequiredData( smr, allowMany,
tpia_m_angular, productElement, product, (
char*)
"angular" ) )
return( 1 );
215 else if( strcmp( data->
name,
"Legendre" ) == 0 ) {
217 if( _tpia_product_checkRequiredData( smr, allowMany,
tpia_m_Legendre, productElement, product, (
char*)
"Legendre" ) )
return( 1 );
219 else if( strcmp( data->
name,
"angularEnergy" ) == 0 ) {
220 if( _tpia_product_checkRequiredData( smr, allowMany,
tpia_m_angular_energy, productElement, product, (
char*)
"angularEnergy" ) )
return( 1 );
222 else if( strcmp( data->
name,
"decayChannel" ) == 0 ) {
226 printf(
" %s\n", data->
name );
232 char const *str =
"";
276 for( i = 0; i < list->
n; i++ ) {
281 if( parentProduct == NULL ) {
290 *priorProductNext = product;
291 priorProductNext = &(product->
next);
305 if( strcmp( data->
name,
"grouped" ) == 0 ) {
320 const char *timeScale;
321 int isDelayedNeutrons;
330 if( isDelayedNeutrons == 0 ) {
341 current = current->
next ) {
343 multiplicity->
next = current;
344 prior->
next = multiplicity;
349 if( current == NULL ) prior->
next = multiplicity;
379 if( index < 0 )
return( NULL );
415 double *p = multiplicityVsEnergy->
pointwise, dMult;
422 for( i = 0; i < multiplicityVsEnergy->
numberOfPointwise - 1; i++, p += 2 )
if( e_in < p[2] )
break;
423 dMult = ( e_in - p[0] ) / ( p[2] - p[0] );
424 dMult = dMult * p[3] + ( 1. - dMult ) * p[1];
426 multiplicity = (int) dMult;
427 if( r < ( dMult - multiplicity ) ) multiplicity++;
429 return( multiplicity );
432#if defined __cplusplus
int gString_addTo(statusMessageReporting *smr, gString *gStr, char const *str)
char const * gString_string(statusMessageReporting *smr, gString *gStr)
int gString_release(statusMessageReporting *smr, gString *gStr)
int gString_initialize(statusMessageReporting *smr, gString *gStr, int size, int increment)
int smr_isOk(statusMessageReporting *smr)
tpia_target_heated * target
tpia_decayChannel decayChannel
xData_Int numberOfPointwise
tpia_multiplicity * multiplicityVsEnergy
tpia_product * parentProduct
tpia_decayChannel decayChannel
tpia_1dData depositionEnergyGrouped
xData_attributionList attributes
tpia_angularEnergy angularEnergy
tpia_multiplicity * delayedNeutronMultiplicityVsEnergy
tpia_particle * productID
tpia_particle * projectileID
xData_elementListItem * items
xData_attributionList attributes
int tpia_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
#define tpia_misc_pointerToAttributeIfAllOk2(smr, element, required, attributes, name)
int tpia_product_release(statusMessageReporting *smr, tpia_product *product)
DLL_LEND const char * tpia_productGenre_unknown
#define tpia_m_depositionEnergy
DLL_LEND const char * tpia_productGenre_NBody_uncorrelate_Legendre
tpia_particle * tpia_particle_getInternalID(statusMessageReporting *smr, const char *const name)
int tpia_product_doesDecay(statusMessageReporting *smr, tpia_product *product)
tpia_product * tpia_decayChannel_getFirstProduct(tpia_decayChannel *decayChannel)
tpia_product * tpia_product_create(statusMessageReporting *smr)
int tpia_product_numberOfProducts(statusMessageReporting *smr, tpia_product *product)
int tpia_product_initialize(statusMessageReporting *smr, tpia_product *product)
int tpia_multiplicity_getTimeScaleFromElement(statusMessageReporting *smr, xData_element *element, const char **timeScale, int *isDelayedNeutrons, double *dTimeScale)
tpia_multiplicity * tpia_multiplicity_createGetFromElement(statusMessageReporting *smr, xData_element *multiplicityElement, int nGroups)
DLL_LEND const char * tpia_productGenre_twoBody_angular
int tpia_Legendre_initialize(statusMessageReporting *smr, tpia_Legendre *Legendre)
DLL_LEND const char * tpia_productGenre_NBody_Legendre
#define tpia_m_multiplicity
int tpia_angularEnergy_release(statusMessageReporting *smr, tpia_angularEnergy *angularEnergy)
int tpia_product_getDecayChannelFromElement(statusMessageReporting *smr, xData_element *parentElement, tpia_channel *channel, tpia_product *parentProduct, tpia_product **priorProductNext)
int tpia_angularEnergy_getFromElement(statusMessageReporting *smr, xData_element *angularEnergyElement, tpia_angularEnergy *angularEnergy)
tpia_product * tpia_product_getFirstProduct(tpia_product *product)
int tpia_angular_getFromElement(statusMessageReporting *smr, xData_element *angularElement, tpia_angular *angular)
long tpia_product_dataRequired(statusMessageReporting *smr, tpia_product *product)
tpia_product * tpia_product_free(statusMessageReporting *smr, tpia_product *product)
tpia_multiplicity * tpia_multiplicity_free(statusMessageReporting *smr, tpia_multiplicity *multiplicity)
int tpia_misc_get2d_xShared_yHistogram_data_Grouped(statusMessageReporting *smr, xData_element *element, tpia_1dData *group)
int tpia_Legendre_release(statusMessageReporting *smr, tpia_Legendre *Legendre)
#define tpia_m_commonShift
#define tpia_m_decayChannel
int tpia_product_getFromElement(statusMessageReporting *smr, tpia_channel *channel, tpia_product *parentProduct, xData_element *productElement, tpia_product *product)
tpia_product * tpia_decayChannel_getNextProduct(tpia_product *product)
int tpia_Legendre_getFromElement(statusMessageReporting *smr, xData_element *LegendreElement, tpia_Legendre *Legendre)
#define tpia_m_formFactor
DLL_LEND const char * tpia_productGenre_NBody_pairProduction
tpia_product * tpia_product_getProductByIndex(statusMessageReporting *smr, tpia_product *product, int index)
tpia_product * tpia_product_createGetFromElement(statusMessageReporting *smr, tpia_channel *channel, tpia_product *parentProduct, xData_element *productElement)
int tpia_product_isDataPresent(statusMessageReporting *smr, tpia_product *product, int b_data)
#define tpia_m_angular_energy
int tpia_angular_release(statusMessageReporting *smr, tpia_angular *angular)
DLL_LEND const char * tpia_productGenre_twoBody_formFactor
int tpia_angular_initialize(statusMessageReporting *smr, tpia_angular *angular)
DLL_LEND const char * tpia_productGenre_NBody_angular_energy
int tpia_product_sampleMultiplicity(statusMessageReporting *smr, tpia_product *product, double e_in, double r)
void * xData_free(statusMessageReporting *smr, void *p)
void xData_freeElementList(statusMessageReporting *smr, xData_elementList *list)
int xData_copyAttributionList(statusMessageReporting *smr, xData_attributionList *dest, xData_attributionList *src)
int xData_releaseAttributionList(statusMessageReporting *smr, xData_attributionList *attributes)
int xData_addToAccessed(statusMessageReporting *smr, xData_element *element, int increment)
xData_element * xData_getNextElement(xData_element *element)
xData_elementList * xData_getElementsByTagName(statusMessageReporting *smr, xData_element *element, const char *tagName)
xData_element * xData_getFirstElement(xData_element *element)
#define xData_malloc2(smr, size, zero, forItem)