39 #include <tpia_target.h>
40 #include <tpia_misc.h>
42 #if defined __cplusplus
52 tpia_multiplicity *multiplicity;
55 if( ( multiplicity = (tpia_multiplicity*) xData_malloc2( smr,
sizeof( tpia_multiplicity ), 0,
"multiplicity" ) ) == NULL )
return( NULL );
57 return( multiplicity );
64 memset( multiplicity, 0,
sizeof( tpia_multiplicity ) );
83 multiplicity->grouped.data = (
double*)
xData_free( smr, multiplicity->grouped.data );
85 multiplicity->pointwise = (
double*)
xData_free( smr, multiplicity->pointwise );
94 tpia_multiplicity *multiplicity;
98 return( multiplicity );
106 const char *timeScale;
107 int isDelayedNeutrons;
114 if( strcmp( data->name,
"grouped" ) == 0 ) {
116 else if( strcmp( data->name,
"pointwise" ) == 0 ) {
117 if( ( multiplicity->pointwise =
tpia_misc_get2dx_y_data( smr, data, &multiplicity->numberOfPointwise ) ) == NULL )
return( 1 ); }
129 double *dTimeScale ) {
134 *isDelayedNeutrons = 0;
137 if( *timeScale != NULL ) {
138 if( strcmp( *timeScale,
"prompt" ) ) {
139 if( strncmp( *timeScale,
"delayed", 7 ) ) {
143 for( p = &((*timeScale)[7]); *p; p++ )
if( !isspace( *p ) )
break;
149 *dTimeScale = strtod( p, &e );
155 *isDelayedNeutrons = 1;
162 #if defined __cplusplus
int tpia_multiplicity_release(statusMessageReporting *smr, tpia_multiplicity *multiplicity)
int xData_addToAccessed(statusMessageReporting *, xData_element *element, int increment)
int tpia_misc_get2d_xShared_yHistogram_data_Grouped(statusMessageReporting *smr, xData_element *element, tpia_1dData *group)
tpia_multiplicity * tpia_multiplicity_free(statusMessageReporting *smr, tpia_multiplicity *multiplicity)
tpia_multiplicity * tpia_multiplicity_create(statusMessageReporting *smr)
tpia_multiplicity * tpia_multiplicity_createGetFromElement(statusMessageReporting *smr, xData_element *multiplicityElement, int nGroups)
xData_element * xData_getNextElement(xData_element *element)
int tpia_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
int tpia_multiplicity_initialize(statusMessageReporting *smr, tpia_multiplicity *multiplicity)
char * xData_getAttributesValue(xData_attributionList *attributes, const char *name)
int tpia_frame_setFromString(statusMessageReporting *smr, const char *forItem, const char *value, int dimension, tpia_data_frame *frame)
xData_element * xData_getFirstElement(xData_element *element)
int tpia_multiplicity_getFromElement(statusMessageReporting *smr, xData_element *multiplicityElement, tpia_multiplicity *multiplicity, int)
int tpia_multiplicity_getTimeScaleFromElement(statusMessageReporting *smr, xData_element *element, const char **timeScale, int *isDelayedNeutrons, double *dTimeScale)
int tpia_frame_setFromElement(statusMessageReporting *smr, xData_element *element, int dimension, tpia_data_frame *frame)
void * xData_free(statusMessageReporting *, void *p)
double * tpia_misc_get2dx_y_data(statusMessageReporting *smr, xData_element *element, xData_Int *length)