Geant4-11
Data Structures | Functions | Variables
G4GIDI_mass.cc File Reference
#include <string.h>
#include <statusMessageReporting.h>
#include "G4GIDI_mass.hh"
#include "G4GIDI_Misc.hh"

Go to the source code of this file.

Data Structures

struct  ZAMass
 

Functions

double G4GIDI_targetMass (const char *targetSymbol)
 
double G4GIDI_Z_AMass (int iZ, int iA)
 

Variables

static struct ZAMass ZAMasses []
 

Function Documentation

◆ G4GIDI_targetMass()

double G4GIDI_targetMass ( const char *  targetSymbol)

Definition at line 875 of file G4GIDI_mass.cc.

875 {
876
877 int i, n = sizeof( ZAMasses ) / sizeof( ZAMasses[0] );
878 double mass = -1.0;
879
880 for( i = 0; i < n; i++ ) {
881 if( !strcmp( ZAMasses[i].symbol, targetSymbol ) ) {
882 mass = ZAMasses[i].mass;
883 break;
884 }
885 }
886 return( mass );
887}
static struct ZAMass ZAMasses[]
Definition: G4GIDI_mass.cc:47
double mass
Definition: G4GIDI_mass.cc:44

References ZAMass::mass, CLHEP::detail::n, ZAMass::symbol, and ZAMasses.

Referenced by G4GIDI_Z_AMass(), and G4GIDI_target::init().

◆ G4GIDI_Z_AMass()

double G4GIDI_Z_AMass ( int  iZ,
int  iA 
)

Definition at line 891 of file G4GIDI_mass.cc.

891 {
892
893 char *name = G4GIDI_Misc_Z_A_m_ToName( iZ, iA );
894 double mass;
895
896 if( name == NULL ) return( -1.0 );
897 mass = G4GIDI_targetMass( name );
898 smr_freeMemory( (void **) &name );
899 return( mass );
900}
char * G4GIDI_Misc_Z_A_m_ToName(int iZ, int iA, int im=0)
Definition: G4GIDI_Misc.cc:44
double G4GIDI_targetMass(const char *targetSymbol)
Definition: G4GIDI_mass.cc:875
const char * name(G4int ptype)
void * smr_freeMemory(void **p)

References G4GIDI_Misc_Z_A_m_ToName(), G4GIDI_targetMass(), ZAMass::mass, G4InuclParticleNames::name(), and smr_freeMemory().

Variable Documentation

◆ ZAMasses

struct ZAMass ZAMasses[]
static

Definition at line 47 of file G4GIDI_mass.cc.

Referenced by G4GIDI_targetMass().