Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4GIDI_Misc.cc File Reference
#include <string.h>
#include <iostream>
#include <string>
#include <vector>
#include <statusMessageReporting.h>
#include <MCGIDI.h>
#include <MCGIDI_misc.h>
#include "G4GIDI_Misc.hh"
Include dependency graph for G4GIDI_Misc.cc:

Go to the source code of this file.

Functions

char * G4GIDI_Misc_Z_A_m_ToName (int iZ, int iA, int im)
 
char * G4GIDI_Misc_channelCompound (char *particle1, char *particle2)
 
int getNamesOfAvailableTargets_walker (MCGIDI_mapEntry *entry, int, void *userData)
 

Function Documentation

char* G4GIDI_Misc_channelCompound ( char *  particle1,
char *  particle2 
)

Definition at line 67 of file G4GIDI_Misc.cc.

67  {
68 
69  int Z1, A1, m1, Z2, A2, m2, level1, level2;
70 
71  if( MCGIDI_miscNameToZAm( NULL, particle1, &Z1, &A1, &m1, &level1 ) ) return( NULL );
72  if( MCGIDI_miscNameToZAm( NULL, particle2, &Z2, &A2, &m2, &level2 ) ) return( NULL );
73  if( A1 == 0 ) A2 = 0;
74  if( A2 == 0 ) A1 = 0;
75  return( G4GIDI_Misc_Z_A_m_ToName( Z1 + Z2, A1 + A2, 0 ) );
76 }
char * G4GIDI_Misc_Z_A_m_ToName(int iZ, int iA, int im=0)
Definition: G4GIDI_Misc.cc:44
int MCGIDI_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
Definition: MCGIDI_misc.cc:81
static constexpr double m2
Definition: G4SIunits.hh:130

Here is the call graph for this function:

char* G4GIDI_Misc_Z_A_m_ToName ( int  iZ,
int  iA,
int  im 
)

Definition at line 44 of file G4GIDI_Misc.cc.

44  {
45 
46  const char *Z = MCGIDI_misc_ZToSymbol( iZ );
47  char S[128], mS[32], *name;
48 
49  if( Z == NULL ) return( NULL );
50  if( iA == 0 ) {
51  if( im != 0 ) return( NULL );
52  sprintf( S, "%s_natural", Z ); }
53  else {
54  sprintf( S, "%s%d", Z, iA );
55  if( im != 0 ) {
56  sprintf( mS, "_m%d", im );
57  strcat( S, mS );
58  }
59  }
60  name = (char *) smr_malloc2( NULL, strlen( S ) + 1, 0, "name" );
61  if( name != NULL ) strcpy( name, S );
62  return( name );
63 }
const char * MCGIDI_misc_ZToSymbol(int iZ)
Definition: MCGIDI_misc.cc:61
const XML_Char * name
Definition: expat.h:151
double S(double temp)
#define smr_malloc2(smr, size, zero, forItem)

Here is the call graph for this function:

Here is the caller graph for this function:

int getNamesOfAvailableTargets_walker ( MCGIDI_mapEntry entry,
int  ,
void userData 
)

Definition at line 96 of file G4GIDI_Misc.cc.

96  {
97 
98  vector<string> *listOfTargets = (vector<string> *) userData;
99  vector<string>::iterator iter;
100 
101  if( entry->type != MCGIDI_mapEntry_type_target ) return( 0 );
102  for( iter = listOfTargets->begin( ); iter != listOfTargets->end( ); iter++ ) {
103  if( entry->targetName == iter->c_str( ) ) return( 0 );
104  }
105  listOfTargets->push_back( entry->targetName );
106  return( 0 );
107 }
#define userData
Definition: xmlparse.cc:572
char * targetName
Definition: MCGIDI_map.h:36
enum MCGIDI_mapEntry_type type
Definition: MCGIDI_map.h:30