8 #include "PoPs_private.h"
15 #if defined __cplusplus
23 #if defined __cplusplus
31 #if defined __cplusplus
38 int i1, n1 =
sizeof( PoPDatas ) /
sizeof( PoPDatas[0] );
42 for( i1 = 0; i1 < n1; ++i1 ) {
45 if( ( pop->genre == PoPs_genre_atom ) && ( pop->Z < 110 ) ) {
46 sprintf( ZAName,
"%d%.3d", pop->Z, pop->A );
52 if(
smr_isOk( smr ) == 0 )
return( 1 );
65 if( ( pop =
PoP_new( smr ) ) != NULL ) {
75 int i,
n =
sizeof( PoPDatas ) /
sizeof( PoPDatas[0] );
77 if( ( pop->name = smr_allocateCopyString2( smr, name,
"name" ) ) == NULL )
return( -1 );
78 for( i = 0; i <
n; i++ ) {
79 if( strcmp( PoPDatas[i].name, name ) == 0 ) {
80 pop->genre = PoPDatas[i].genre;
81 pop->Z = PoPDatas[i].Z;
83 if( PoPDatas[i].N >= 0 ) pop->A = pop->Z + PoPDatas[i].N;
84 pop->l = PoPDatas[i].nuclearLevel;
91 smr_setReportError2( smr, smr_unknownID, 1,
"particle %s not in database", name );
104 int ZA = 1000 * pop->Z + pop->A;
107 if( BDFLS_Data == NULL )
return( mass );
109 mass_ = cbdflsGetMass( (cbdfls_file *) BDFLS_Data, ZA ); }
110 else if( pop->genre == PoPs_genre_lepton ) {
111 if( pop->name[0] ==
'e' ) mass_ = cbdflsGetMass( (cbdfls_file *) BDFLS_Data, 8 );
113 if( mass_ < 0 ) mass_ = mass;
128 if( BDFLS_Data != NULL ) cbdflsRelease( (cbdfls_file *) BDFLS_Data );
131 if( ( p = cbdflsOpen( name, &Error ) ) == NULL )
return( 1 );
132 BDFLS_Data = (
void *) p;
135 if( name == NULL ) BDFLS_Data = NULL;
140 #if defined __cplusplus
int PoPs_particleLoadInfo(statusMessageReporting *smr, const char *name, PoP *pop)
int PoPs_particleReadDatabase(statusMessageReporting *smr, char const *)
char const * unitsDB_addUnitIfNeeded(statusMessageReporting *smr, char const *unit)
int smr_isOk(statusMessageReporting *smr)
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
PoP * PoPs_particleCreateLoadInfo(statusMessageReporting *smr, const char *name)
void * smr_freeMemory(void **p)
PoP * PoP_new(statusMessageReporting *smr)
static double PoPs_getBDFLS_mass(char const *name, PoP *pop, double mass)
PoP * PoPs_addParticleIfNeeded(statusMessageReporting *smr, PoP *pop)
int PoPs_setBDFLS_File(char const *name)