Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GIDI_Misc.hh File Reference
#include <tpia_map.h>
#include <tpia_target.h>

Go to the source code of this file.

Functions

char * G4GIDI_Misc_Z_A_m_ToName (int iZ, int iA, int im=0)
 
char * G4GIDI_Misc_channelCompound (char *particle1, char *particle2)
 
int G4GIDI_Misc_channelProductsCompare (GIDI::tpia_channel *channel, int nProducts, char **productNames)
 
int getNamesOfAvailableTargets_walker (GIDI::tpia_mapEntry *entry, int level, void *userData)
 

Function Documentation

◆ G4GIDI_Misc_channelCompound()

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

Definition at line 99 of file G4GIDI_Misc.cc.

99 {
100
101 int Z1, A1, m1, Z2, A2, m2;
102
103 if( tpia_miscNameToZAm( NULL, particle1, &Z1, &A1, &m1 ) ) return( NULL );
104 if( tpia_miscNameToZAm( NULL, particle2, &Z2, &A2, &m2 ) ) return( NULL );
105 if( A1 == 0 ) A2 = 0;
106 if( A2 == 0 ) A1 = 0;
107 return( G4GIDI_Misc_Z_A_m_ToName( Z1 + Z2, A1 + A2, 0 ) );
108}
char * G4GIDI_Misc_Z_A_m_ToName(int iZ, int iA, int im)
Definition: G4GIDI_Misc.cc:76
int tpia_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m)
Definition: tpia_misc.cc:105

◆ G4GIDI_Misc_channelProductsCompare()

int G4GIDI_Misc_channelProductsCompare ( GIDI::tpia_channel channel,
int  nProducts,
char **  productNames 
)

◆ G4GIDI_Misc_Z_A_m_ToName()

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

Definition at line 76 of file G4GIDI_Misc.cc.

76 {
77
78 const char *Z = tpia_misc_ZToSymbol( iZ );
79 char S[128], mS[32], *name;
80
81 if( Z == NULL ) return( NULL );
82 if( iA == 0 ) {
83 if( im != 0 ) return( NULL );
84 sprintf( S, "%s_natural", Z ); }
85 else {
86 sprintf( S, "%s_%d", Z, iA );
87 if( im != 0 ) {
88 sprintf( mS, "_m%d", im );
89 strcat( S, mS );
90 }
91 }
92 name = (char *) xData_malloc2( NULL, strlen( S ) + 1, 0, "name" );
93 if( name != NULL ) strcpy( name, S );
94 return( name );
95}
const char * tpia_misc_ZToSymbol(int iZ)
Definition: tpia_misc.cc:83
#define xData_malloc2(smr, size, zero, forItem)
Definition: xData.h:313

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 ( GIDI::tpia_mapEntry entry,
int  level,
void *  userData 
)