Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PoPs.h
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# <<END-copyright>>
4*/
5
6#ifndef PoPs_h_included
7#define PoPs_h_included
8
9/* Disable Effective C++ warnings in PoP code. */
10#if __INTEL_COMPILER > 1399
11#pragma warning( disable:593 )
12#endif
13
15/*
16* MPI stuff.
17*/
18#ifdef PoPs_MPI
19#include <mpi.h>
20#endif
21
22#if defined __cplusplus
23 extern "C" {
24 namespace GIDI {
25#endif
26
27#define POPS_VERSION_MAJOR 1
28#define POPS_VERSION_MINOR 0
29#define POPS_VERSION_PATCHLEVEL 5
30
31#define PoPs_packageSymbol "PoPs (properties of particles)"
32#define PoPs_packageName PoPs_packageSymbol " (properties of particles)"
33typedef struct PoP_s PoP;
34
38/*
39* In the following struct, 'index' is the index of the particle (proper or aliased) in the list of particles. If a particle
40* is a proper particle its properIndex is -1. Otherwise, it is the index of the aliased particle's proper particle. If a proper
41* particle does not have an aliased particle referring to it, aliasIndex is -1. If a proper particle has aliaes particles,
42* its aliasIndex is the index of its first aliased particle. If a second alias is added to a proper particle, then its first
43* aliased particle's aliasIndex is the index of that particle, and so on. The last aliased particle added has aliasIndex = -1.
44*/
45struct PoP_s { /* Any changes here must be reflected in functions PoP_initialize and PoP_copyParticle and in file PoPs_Bcast.c logic. */
46 int index, properIndex, aliasIndex;
48 char const *name;
49 int Z, A, l;
50 double mass; /* Mass to be added to base. */
51 char const *massUnit;
52};
53
54extern int PoPs_smr_ID;
55
56const char *PoPs_version( void );
57int PoPs_versionMajor( void );
58int PoPs_versionMinor( void );
59int PoPs_versionPatchLevel( void );
60
61int PoPs_register( void );
62int PoPs_readDatabase( statusMessageReporting *smr, char const *fileName );
66PoP *PoPs_addAliasIfNeeded( statusMessageReporting *smr, char const *name, char const *alias );
67int PoPs_numberOfParticle( void );
68int PoPs_particleIndex( char const *name );
69int PoPs_particleIndex_smr( statusMessageReporting *smr, char const *name, char const *file, int line, char const *func );
70char const *PoPs_getName_atIndex( statusMessageReporting *smr, int index );
71double PoPs_getMassInUnitOf( statusMessageReporting *smr, char const *name, char const *unit );
72double PoPs_getMassInUnitOf_atIndex( statusMessageReporting *smr, int index, char const *unit );
73enum PoPs_genre PoPs_getGenre( statusMessageReporting *smr, char const *name );
75int PoPs_getZ_A_l( statusMessageReporting *smr, char const *name, int *Z, int *A, int *l );
76int PoPs_getZ_A_l_atIndex( statusMessageReporting *smr, int index, int *Z, int *A, int *l );
77int PoPs_hasNucleus( statusMessageReporting *smr, char const *name, int protonIsNucleus );
78int PoPs_hasNucleus_atIndex( statusMessageReporting *smr, int index, int protonIsNucleus );
79char const *PoPs_getAtomsName( statusMessageReporting *smr, char const *name );
80char const *PoPs_getAtomsName_atIndex( statusMessageReporting *smr, int index );
81int PoPs_getAtomsIndex( statusMessageReporting *smr, char const *name );
83PoP *PoPs_getParticle_atIndex( int index );
84
85char const *PoPs_genreTokenToString( enum PoPs_genre genre );
86void PoPs_print( int sorted );
87void PoPs_write( FILE *f, int sorted );
88
91int PoP_release( PoP *pop );
92PoP *PoP_free( PoP *pop );
93int PoP_copyParticle( statusMessageReporting *smr, PoP *desc, PoP *src );
94PoP *PoP_makeParticle( statusMessageReporting *smr, enum PoPs_genre genre, char const *name, double mass, char const *massUnit );
95int PoP_setZ_A_l( statusMessageReporting *smr, PoP *pop, int Z, int A, int l );
96int PoP_getIndex( PoP *pop );
97char const *PoP_getName( PoP *pop );
98
99int PoPs_particleReadDatabase( statusMessageReporting *smr, char const *name );
101int PoPs_particleLoadInfo( statusMessageReporting *smr, const char *name, PoP *pop );
102
103double PoP_getMassInUnitOf( statusMessageReporting *smr, PoP *pop, char const *unit );
104
105PoP *PoP_makeAlias( statusMessageReporting *smr, char const *name, char const *alias );
106
107int PoPs_unitConversionRatio( char const *_from, char const *_to, double *ratio );
108
109int lPoPs_addParticleIfNeeded( statusMessageReporting *smr, char const *name, char const *special );
110
111/*
112* MPI stuff.
113*/
114#ifdef PoPs_MPI
115int PoPs_Bcast( statusMessageReporting *smr, MPI_Comm comm, int bossRank );
116#endif
117
118/* Use the next function with caution as it is only for initial testing of the package and will soon be gone. */
119int PoPs_setBDFLS_File( char const *name );
120
121#if defined __cplusplus
122 }
123 }
124#endif
125
126#endif /* End of PoPs_h_included. */
const G4int Z[17]
const G4double A[17]
int PoPs_setBDFLS_File(char const *name)
Definition: PoPs_data.cc:121
char const * PoPs_getAtomsName_atIndex(statusMessageReporting *smr, int index)
Definition: PoPs.cc:387
int PoPs_particleIndex_smr(statusMessageReporting *smr, char const *name, char const *file, int line, char const *func)
Definition: PoPs.cc:216
void PoPs_write(FILE *f, int sorted)
Definition: PoPs.cc:462
PoP * PoP_new(statusMessageReporting *smr)
Definition: PoPs.cc:522
int PoPs_getAtomsIndex_atIndex(statusMessageReporting *smr, int index)
Definition: PoPs.cc:407
int PoPs_getZ_A_l(statusMessageReporting *smr, char const *name, int *Z, int *A, int *l)
Definition: PoPs.cc:325
PoPs_errorTokens
Definition: PoPs.h:35
@ PoPs_errorToken_Okay
Definition: PoPs.h:35
@ PoPs_errorToken_badIndex
Definition: PoPs.h:35
@ PoPs_errorToken_badName
Definition: PoPs.h:35
@ PoPs_errorToken_badUnitConversion
Definition: PoPs.h:35
int PoP_getIndex(PoP *pop)
Definition: PoPs.cc:612
char const * PoPs_getName_atIndex(statusMessageReporting *smr, int index)
Definition: PoPs.cc:275
int PoPs_release(statusMessageReporting *smr)
Definition: PoPs.cc:88
int PoPs_particleIndex(char const *name)
Definition: PoPs.cc:204
int PoPs_versionMajor(void)
Definition: PoPs.cc:67
int PoP_release(PoP *pop)
Definition: PoPs.cc:549
char const * PoPs_genreTokenToString(enum PoPs_genre genre)
Definition: PoPs.cc:446
enum PoPs_genre PoPs_getGenre(statusMessageReporting *smr, char const *name)
Definition: PoPs.cc:301
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
Definition: lPoPs.cc:36
int PoP_copyParticle(statusMessageReporting *smr, PoP *desc, PoP *src)
Definition: PoPs.cc:567
int PoPs_getAtomsIndex(statusMessageReporting *smr, char const *name)
Definition: PoPs.cc:397
double PoPs_getMassInUnitOf_atIndex(statusMessageReporting *smr, int index, char const *unit)
Definition: PoPs.cc:286
PoP * PoPs_particleCreateLoadInfo(statusMessageReporting *smr, const char *name)
Definition: PoPs_data.cc:61
int PoPs_particleLoadInfo(statusMessageReporting *smr, const char *name, PoP *pop)
Definition: PoPs_data.cc:73
PoP * PoP_makeAlias(statusMessageReporting *smr, char const *name, char const *alias)
Definition: PoPs.cc:647
int PoPs_readDatabase(statusMessageReporting *smr, char const *fileName)
Definition: PoPs.cc:81
int PoP_setZ_A_l(statusMessageReporting *smr, PoP *pop, int Z, int A, int l)
Definition: PoPs.cc:602
int PoPs_versionMinor(void)
Definition: PoPs.cc:68
PoP * PoPs_addAliasIfNeeded(statusMessageReporting *smr, char const *name, char const *alias)
Definition: PoPs.cc:179
int PoPs_versionPatchLevel(void)
Definition: PoPs.cc:69
int PoPs_getZ_A_l_atIndex(statusMessageReporting *smr, int index, int *Z, int *A, int *l)
Definition: PoPs.cc:335
int PoPs_numberOfParticle(void)
Definition: PoPs.cc:197
int PoPs_smr_ID
Definition: PoPs.cc:35
char const * PoPs_getAtomsName(statusMessageReporting *smr, char const *name)
Definition: PoPs.cc:377
PoP * PoPs_copyAddParticleIfNeeded(statusMessageReporting *smr, PoP *pop)
Definition: PoPs.cc:153
int PoPs_hasNucleus(statusMessageReporting *smr, char const *name, int protonIsNucleus)
Definition: PoPs.cc:349
int PoPs_register(void)
Definition: PoPs.cc:73
double PoP_getMassInUnitOf(statusMessageReporting *smr, PoP *pop, char const *unit)
Definition: PoPs.cc:626
int PoP_initialize(statusMessageReporting *smr, PoP *pop)
Definition: PoPs.cc:533
const char * PoPs_version(void)
Definition: PoPs.cc:59
int PoPs_particleReadDatabase(statusMessageReporting *smr, char const *name)
Definition: PoPs_data.cc:36
PoP * PoPs_addParticleIfNeeded(statusMessageReporting *smr, PoP *pop)
Definition: PoPs.cc:113
int PoPs_unitConversionRatio(char const *_from, char const *_to, double *ratio)
Definition: PoPs.cc:748
enum PoPs_genre PoPs_getGenre_atIndex(statusMessageReporting *smr, int index)
Definition: PoPs.cc:311
PoP * PoPs_getParticle_atIndex(int index)
Definition: PoPs.cc:438
char const * PoP_getName(PoP *pop)
Definition: PoPs.cc:619
PoP * PoP_makeParticle(statusMessageReporting *smr, enum PoPs_genre genre, char const *name, double mass, char const *massUnit)
Definition: PoPs.cc:585
PoPs_genre
Definition: PoPs.h:36
@ PoPs_genre_atom
Definition: PoPs.h:37
@ PoPs_genre_photon
Definition: PoPs.h:36
@ PoPs_genre_nucleus
Definition: PoPs.h:37
@ PoPs_genre_alias
Definition: PoPs.h:36
@ PoPs_genre_unknown
Definition: PoPs.h:36
@ PoPs_genre_invalid
Definition: PoPs.h:36
@ PoPs_genre_lepton
Definition: PoPs.h:36
@ PoPs_genre_baryon
Definition: PoPs.h:37
@ PoPs_genre_quark
Definition: PoPs.h:37
@ PoPs_genre_meson
Definition: PoPs.h:37
double PoPs_getMassInUnitOf(statusMessageReporting *smr, char const *name, char const *unit)
Definition: PoPs.cc:265
int PoPs_hasNucleus_atIndex(statusMessageReporting *smr, int index, int protonIsNucleus)
Definition: PoPs.cc:359
PoP * PoP_free(PoP *pop)
Definition: PoPs.cc:558
void PoPs_print(int sorted)
Definition: PoPs.cc:455
Definition: PoPs.h:45
int aliasIndex
Definition: PoPs.h:46
char const * massUnit
Definition: PoPs.h:51
enum PoPs_genre genre
Definition: PoPs.h:47
char const * name
Definition: PoPs.h:48
double mass
Definition: PoPs.h:50
int A
Definition: PoPs.h:49