Geant4-11
Functions
MCGIDI_mass.h File Reference

Go to the source code of this file.

Functions

double MCGIDI_particleMass_AMU (statusMessageReporting *smr, const char *name)
 

Function Documentation

◆ MCGIDI_particleMass_AMU()

double MCGIDI_particleMass_AMU ( statusMessageReporting smr,
const char *  name 
)

Definition at line 853 of file MCGIDI_mass.cc.

853 {
854
855 int i, n = sizeof( ZAMasses ) / sizeof( ZAMasses[0] );
856 double mass = -1.;
857
858 for( i = 0; i < n; i++ ) {
859 if( strcmp( ZAMasses[i].symbol, name ) == 0 ) {
860 mass = ZAMasses[i].mass;
861 break;
862 }
863 }
864 if( mass == -1. ) smr_setReportError2( smr, smr_unknownID, 1, "particle %s not in mass table", name );
865 return( mass );
866}
static struct ZAMass ZAMasses[]
Definition: MCGIDI_mass.cc:20
const char * name(G4int ptype)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
double mass
Definition: G4GIDI_mass.cc:44

References ZAMass::mass, CLHEP::detail::n, G4InuclParticleNames::name(), smr_setReportError2, smr_unknownID, ZAMass::symbol, and ZAMasses.

Referenced by MCGIDI_particle_getInternalID().