G4GIDI_mass.cc File Reference

#include <string>
#include <string.h>
#include <xData.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)


Function Documentation

double G4GIDI_targetMass ( const char *  targetSymbol  ) 

Definition at line 903 of file G4GIDI_mass.cc.

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

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

00903                                                      {
00904 
00905     int i, n = sizeof( ZAMasses ) / sizeof( ZAMasses[0] );
00906     double mass = -1.0;
00907 
00908     //TK modified 
00909     std::string target(targetSymbol);
00910     for( i = 0; i < n; i++ ) {
00911         //TK modified 
00912         //if( !strcmp( ZAMasses[i].symbol, targetSymbol ) ) {
00913         if(  ZAMasses[i].symbol == target ) {
00914             mass = ZAMasses[i].mass;
00915             break;
00916         }
00917     }
00918     return( mass );
00919 }

double G4GIDI_Z_AMass ( int  iZ,
int  iA 
)

Definition at line 923 of file G4GIDI_mass.cc.

References G4GIDI_Misc_Z_A_m_ToName(), G4GIDI_targetMass(), ZAMass::mass, and xData_free().

00923                                         {
00924 
00925     char *name = G4GIDI_Misc_Z_A_m_ToName( iZ, iA );
00926     double mass;
00927 
00928     if( name == NULL ) return( -1.0 );
00929     mass = G4GIDI_targetMass( name );
00930     xData_free( NULL, name );
00931     return( mass );
00932 }


Generated on Mon May 27 17:50:45 2013 for Geant4 by  doxygen 1.4.7