File indexing completed on 2025-01-18 09:59:31
0001
0002
0003
0004
0005
0006 #ifndef PoPs_h_included
0007 #define PoPs_h_included
0008
0009
0010 #if __INTEL_COMPILER > 1399
0011 #pragma warning( disable:593 )
0012 #endif
0013
0014 #include <statusMessageReporting.h>
0015
0016
0017
0018 #ifdef PoPs_MPI
0019 #include <mpi.h>
0020 #endif
0021
0022 #if defined __cplusplus
0023 extern "C" {
0024 namespace GIDI {
0025 #endif
0026
0027 #define POPS_VERSION_MAJOR 1
0028 #define POPS_VERSION_MINOR 0
0029 #define POPS_VERSION_PATCHLEVEL 5
0030
0031 #define PoPs_packageSymbol "PoPs (properties of particles)"
0032 #define PoPs_packageName PoPs_packageSymbol " (properties of particles)"
0033 typedef struct PoP_s PoP;
0034
0035 enum PoPs_errorTokens { PoPs_errorToken_Okay, PoPs_errorToken_badName, PoPs_errorToken_badIndex, PoPs_errorToken_badUnitConversion };
0036 enum PoPs_genre { PoPs_genre_invalid, PoPs_genre_unknown, PoPs_genre_alias, PoPs_genre_photon, PoPs_genre_lepton,
0037 PoPs_genre_quark, PoPs_genre_meson, PoPs_genre_baryon, PoPs_genre_nucleus, PoPs_genre_atom };
0038
0039
0040
0041
0042
0043
0044
0045 struct PoP_s {
0046 int index, properIndex, aliasIndex;
0047 enum PoPs_genre genre;
0048 char const *name;
0049 int Z, A, l;
0050 double mass;
0051 char const *massUnit;
0052 };
0053
0054 extern int PoPs_smr_ID;
0055
0056 const char *PoPs_version( void );
0057 int PoPs_versionMajor( void );
0058 int PoPs_versionMinor( void );
0059 int PoPs_versionPatchLevel( void );
0060
0061 int PoPs_register( void );
0062 int PoPs_readDatabase( statusMessageReporting *smr, char const *fileName );
0063 int PoPs_release( statusMessageReporting *smr );
0064 PoP *PoPs_addParticleIfNeeded( statusMessageReporting *smr, PoP *pop );
0065 PoP *PoPs_copyAddParticleIfNeeded( statusMessageReporting *smr, PoP *pop );
0066 PoP *PoPs_addAliasIfNeeded( statusMessageReporting *smr, char const *name, char const *alias );
0067 int PoPs_numberOfParticle( void );
0068 int PoPs_particleIndex( char const *name );
0069 int PoPs_particleIndex_smr( statusMessageReporting *smr, char const *name, char const *file, int line, char const *func );
0070 char const *PoPs_getName_atIndex( statusMessageReporting *smr, int index );
0071 double PoPs_getMassInUnitOf( statusMessageReporting *smr, char const *name, char const *unit );
0072 double PoPs_getMassInUnitOf_atIndex( statusMessageReporting *smr, int index, char const *unit );
0073 enum PoPs_genre PoPs_getGenre( statusMessageReporting *smr, char const *name );
0074 enum PoPs_genre PoPs_getGenre_atIndex( statusMessageReporting *smr, int index );
0075 int PoPs_getZ_A_l( statusMessageReporting *smr, char const *name, int *Z, int *A, int *l );
0076 int PoPs_getZ_A_l_atIndex( statusMessageReporting *smr, int index, int *Z, int *A, int *l );
0077 int PoPs_hasNucleus( statusMessageReporting *smr, char const *name, int protonIsNucleus );
0078 int PoPs_hasNucleus_atIndex( statusMessageReporting *smr, int index, int protonIsNucleus );
0079 char const *PoPs_getAtomsName( statusMessageReporting *smr, char const *name );
0080 char const *PoPs_getAtomsName_atIndex( statusMessageReporting *smr, int index );
0081 int PoPs_getAtomsIndex( statusMessageReporting *smr, char const *name );
0082 int PoPs_getAtomsIndex_atIndex( statusMessageReporting *smr, int index );
0083 PoP *PoPs_getParticle_atIndex( int index );
0084
0085 char const *PoPs_genreTokenToString( enum PoPs_genre genre );
0086 void PoPs_print( int sorted );
0087 void PoPs_write( FILE *f, int sorted );
0088
0089 PoP *PoP_new( statusMessageReporting *smr );
0090 int PoP_initialize( statusMessageReporting *smr, PoP *pop );
0091 int PoP_release( PoP *pop );
0092 PoP *PoP_free( PoP *pop );
0093 int PoP_copyParticle( statusMessageReporting *smr, PoP *desc, PoP *src );
0094 PoP *PoP_makeParticle( statusMessageReporting *smr, enum PoPs_genre genre, char const *name, double mass, char const *massUnit );
0095 int PoP_setZ_A_l( statusMessageReporting *smr, PoP *pop, int Z, int A, int l );
0096 int PoP_getIndex( PoP *pop );
0097 char const *PoP_getName( PoP *pop );
0098
0099 int PoPs_particleReadDatabase( statusMessageReporting *smr, char const *name );
0100 PoP *PoPs_particleCreateLoadInfo( statusMessageReporting *smr, const char *name );
0101 int PoPs_particleLoadInfo( statusMessageReporting *smr, const char *name, PoP *pop );
0102
0103 double PoP_getMassInUnitOf( statusMessageReporting *smr, PoP *pop, char const *unit );
0104
0105 PoP *PoP_makeAlias( statusMessageReporting *smr, char const *name, char const *alias );
0106
0107 int PoPs_unitConversionRatio( char const *_from, char const *_to, double *ratio );
0108
0109 int lPoPs_addParticleIfNeeded( statusMessageReporting *smr, char const *name, char const *special );
0110
0111
0112
0113
0114 #ifdef PoPs_MPI
0115 int PoPs_Bcast( statusMessageReporting *smr, MPI_Comm comm, int bossRank );
0116 #endif
0117
0118
0119 int PoPs_setBDFLS_File( char const *name );
0120
0121 #if defined __cplusplus
0122 }
0123 }
0124 #endif
0125
0126 #endif