43 #if defined __cplusplus
48 static 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 ) {
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
tpia_product * parentProduct
long tpia_product_dataRequired(statusMessageReporting *smr, tpia_product *product)
tpia_particle * projectileID
DLL_LEND const char * tpia_productGenre_NBody_angular_energy
#define tpia_m_depositionEnergy
tpia_product * tpia_product_getProductByIndex(statusMessageReporting *smr, tpia_product *product, int index)
xData_element * xData_getFirstElement(xData_element *element)
char const * gString_string(statusMessageReporting *smr, gString *gStr)
int tpia_Legendre_release(statusMessageReporting *smr, tpia_Legendre *Legendre)
tpia_product * tpia_product_getFirstProduct(tpia_product *product)
tpia_decayChannel decayChannel
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
int gString_release(statusMessageReporting *smr, gString *gStr)
int tpia_product_initialize(statusMessageReporting *smr, tpia_product *product)
tpia_target_heated * target
int xData_copyAttributionList(statusMessageReporting *smr, xData_attributionList *dest, xData_attributionList *src)
int tpia_angularEnergy_release(statusMessageReporting *smr, tpia_angularEnergy *angularEnergy)
tpia_decayChannel decayChannel
#define xData_malloc2(smr, size, zero, forItem)
DLL_LEND const char * tpia_productGenre_NBody_Legendre
DLL_LEND const char * tpia_productGenre_NBody_pairProduction
tpia_product * tpia_product_free(statusMessageReporting *smr, tpia_product *product)
DLL_LEND const char * tpia_productGenre_twoBody_formFactor
void * xData_free(statusMessageReporting *smr, void *p)
xData_Int numberOfPointwise
xData_attributionList attributes
#define tpia_m_formFactor
DLL_LEND const char * tpia_productGenre_NBody_uncorrelate_Legendre
int tpia_angularEnergy_getFromElement(statusMessageReporting *smr, xData_element *angularEnergyElement, tpia_angularEnergy *angularEnergy)
tpia_product * tpia_product_createGetFromElement(statusMessageReporting *smr, tpia_channel *channel, tpia_product *parentProduct, xData_element *productElement)
int gString_addTo(statusMessageReporting *smr, gString *gStr, char const *str)
int tpia_product_getFromElement(statusMessageReporting *smr, tpia_channel *channel, tpia_product *parentProduct, xData_element *productElement, tpia_product *product)
int gString_initialize(statusMessageReporting *smr, gString *gStr, int size, int increment)
#define tpia_misc_pointerToAttributeIfAllOk2(smr, element, required, attributes, name)
int tpia_product_isDataPresent(statusMessageReporting *smr, tpia_product *product, int b_data)
int xData_releaseAttributionList(statusMessageReporting *smr, xData_attributionList *attributes)
int tpia_product_getDecayChannelFromElement(statusMessageReporting *smr, xData_element *parentElement, tpia_channel *channel, tpia_product *parentProduct, tpia_product **priorProductNext)
tpia_1dData depositionEnergyGrouped
int tpia_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
#define tpia_m_multiplicity
tpia_multiplicity * tpia_multiplicity_createGetFromElement(statusMessageReporting *smr, xData_element *multiplicityElement, int nGroups)
tpia_particle * tpia_particle_getInternalID(statusMessageReporting *smr, const char *const name)
int smr_isOk(statusMessageReporting *smr)
int tpia_angular_release(statusMessageReporting *smr, tpia_angular *angular)
int tpia_angular_getFromElement(statusMessageReporting *smr, xData_element *angularElement, tpia_angular *angular)
tpia_product * tpia_product_create(statusMessageReporting *smr)
int tpia_product_doesDecay(statusMessageReporting *smr, tpia_product *product)
int tpia_product_release(statusMessageReporting *smr, tpia_product *product)
int tpia_misc_get2d_xShared_yHistogram_data_Grouped(statusMessageReporting *smr, xData_element *element, tpia_1dData *group)
int tpia_product_numberOfProducts(statusMessageReporting *smr, tpia_product *product)
tpia_angularEnergy angularEnergy
DLL_LEND const char * tpia_productGenre_unknown
#define tpia_m_angular_energy
int tpia_angular_initialize(statusMessageReporting *smr, tpia_angular *angular)
#define tpia_m_decayChannel
tpia_multiplicity * multiplicityVsEnergy
int xData_addToAccessed(statusMessageReporting *smr, xData_element *element, int increment)
int tpia_Legendre_getFromElement(statusMessageReporting *smr, xData_element *LegendreElement, tpia_Legendre *Legendre)
void xData_freeElementList(statusMessageReporting *smr, xData_elementList *list)
xData_element * xData_getNextElement(xData_element *element)
xData_attributionList attributes
tpia_multiplicity * delayedNeutronMultiplicityVsEnergy
int tpia_Legendre_initialize(statusMessageReporting *smr, tpia_Legendre *Legendre)
int tpia_multiplicity_getTimeScaleFromElement(statusMessageReporting *smr, xData_element *element, const char **timeScale, int *isDelayedNeutrons, double *dTimeScale)
printf("%d Experimental points found\n", nlines)
xData_elementListItem * items
int tpia_product_sampleMultiplicity(statusMessageReporting *smr, tpia_product *product, double e_in, double r)
xData_elementList * xData_getElementsByTagName(statusMessageReporting *smr, xData_element *element, const char *tagName)
tpia_product * tpia_decayChannel_getFirstProduct(tpia_decayChannel *decayChannel)
tpia_multiplicity * tpia_multiplicity_free(statusMessageReporting *smr, tpia_multiplicity *multiplicity)
#define tpia_m_commonShift
tpia_particle * productID
DLL_LEND const char * tpia_productGenre_twoBody_angular
const XML_Char const XML_Char * data
tpia_product * tpia_decayChannel_getNextProduct(tpia_product *product)