Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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"

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

◆ G4GIDI_Misc_channelCompound()

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

Definition at line 70 of file G4GIDI_Misc.cc.

70 {
71
72 int Z1, A1, m1, Z2, A2, m2, level1, level2;
73
74 if( MCGIDI_miscNameToZAm( NULL, particle1, &Z1, &A1, &m1, &level1 ) ) return( NULL );
75 if( MCGIDI_miscNameToZAm( NULL, particle2, &Z2, &A2, &m2, &level2 ) ) return( NULL );
76 if( A1 == 0 ) A2 = 0;
77 if( A2 == 0 ) A1 = 0;
78 return( G4GIDI_Misc_Z_A_m_ToName( Z1 + Z2, A1 + A2, 0 ) );
79}
char * G4GIDI_Misc_Z_A_m_ToName(int iZ, int iA, int im)
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

◆ G4GIDI_Misc_Z_A_m_ToName()

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 snprintf( S, sizeof S, "%s_natural", Z ); }
53 else {
54 snprintf( S, sizeof S, "%s%d", Z, iA );
55 if( im != 0 ) {
56 //snprintf( mS, sizeof mS, "_m%d", im );
57 //TK 170509
58 //Fix inconsistency of name of excited isomer between data and code
59 snprintf( mS, sizeof mS, "m%d", im );
60 strcat( S, mS );
61 }
62 }
63 name = (char *) smr_malloc2( NULL, strlen( S ) + 1, 0, "name" );
64 if( name != NULL ) strcpy( name, S );
65 return( name );
66}
G4double S(G4double temp)
const G4int Z[17]
const char * MCGIDI_misc_ZToSymbol(int iZ)
Definition: MCGIDI_misc.cc:61
const char * name(G4int ptype)
#define smr_malloc2(smr, size, zero, forItem)

Referenced by G4GIDI::dataFilename(), G4GIDI::freeTarget(), G4GIDI_Misc_channelCompound(), G4GIDI_Z_AMass(), G4GIDI::getAlreadyReadTarget(), G4GIDI::getNamesOfAvailableLibraries(), G4GIDI::isThisDataAvailable(), and G4GIDI::readTarget().

◆ getNamesOfAvailableTargets_walker()

int getNamesOfAvailableTargets_walker ( MCGIDI_mapEntry entry,
int  ,
void *  userData 
)

Definition at line 99 of file G4GIDI_Misc.cc.

99 {
100
101 vector<string> *listOfTargets = (vector<string> *) userData;
102 vector<string>::iterator iter;
103
104 if( entry->type != MCGIDI_mapEntry_type_target ) return( 0 );
105 for( iter = listOfTargets->begin( ); iter != listOfTargets->end( ); iter++ ) {
106 if( entry->targetName == iter->c_str( ) ) return( 0 );
107 }
108 listOfTargets->push_back( entry->targetName );
109 return( 0 );
110}
@ MCGIDI_mapEntry_type_target
Definition: MCGIDI_map.h:17
enum MCGIDI_mapEntry_type type
Definition: MCGIDI_map.h:30