Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4gsmate.cc File Reference
#include <cmath>
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G3toG4.hh"
#include "G3MatTable.hh"
#include "G3EleTable.hh"
#include "G4Material.hh"
#include "G4Isotope.hh"
#include "G4UnitsTable.hh"

Go to the source code of this file.

Functions

void PG4gsmate (G4String *tokens)
 
void G4gsmate (G4int imate, G4String name, G4double ain, G4double zin, G4double densin, G4double, G4int, G4double *)
 

Function Documentation

◆ G4gsmate()

void G4gsmate ( G4int  imate,
G4String  name,
G4double  ain,
G4double  zin,
G4double  densin,
G4double  radl,
G4int  nwbf,
G4double ubuf 
)

Definition at line 58 of file G4gsmate.cc.

60{
61 G4double G3_minimum_density = 1.e-10*g/cm3;
62
63 // add units
64 G4double z = zin;
65 G4double a = ain*g/mole;
66 G4double dens = densin*g/cm3;
67
68 G4Material* material=0;
69
70 G4String sname = G4StrUtil::strip_copy(name);
71 if (sname == "AIR") {
72 // handle the built in AIR mixture
73 G4double aa[2], zz[2], wmat[2];
74 aa[0] = 14.01*g/mole;
75 aa[1] = 16.00*g/mole;
76 zz[0] = 7;
77 zz[1] = 8;
78 wmat[0] = 0.7;
79 wmat[1] = 0.3;
80 // G4double theDensity = 1.2931*mg/cm3;
81 G4double theDensity = 0.0012931;
82 G4int n=2;
83 G4gsmixt(imate, sname, aa, zz, theDensity, n, wmat);
84 }
85 else if ( z<1 || dens < G3_minimum_density ) {
86 // define vacuum according to definition from N03 example
87 G4double density = universe_mean_density; //from PhysicalConstants.h
88 G4double pressure = 3.e-18*pascal;
89 G4double temperature = 2.73*kelvin;
90 material = new G4Material(name, z=1., a=1.01*g/mole, density,
91 kStateGas,temperature,pressure);
92 }
93 else {
94 //G4Element* element = CreateElement(z, a, name);
95 G4Element* element = G3Ele.GetEle(z);
96 material = new G4Material(name, dens, 1);
97 material->AddElement(element, 1.);
98 }
99
100 // add the material to the List
101 G3Mat.put(imate, material);
102}
G3G4DLL_API G3EleTable G3Ele
Definition: clparse.cc:59
void G4gsmixt(G4int imate, G4String name, G4double a[], G4double *z, G4double dens, G4int nlmat, G4double *wmat)
G3G4DLL_API G3MatTable G3Mat
Definition: clparse.cc:54
@ kStateGas
Definition: G4Material.hh:110
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define pascal
G4Element * GetEle(G4double Z)
Definition: G3EleTable.cc:51
void put(G4int id, G4Material *material)
Definition: G3MatTable.cc:52
void AddElement(G4Element *elm, G4int nAtoms)
Definition: G4Material.hh:156
G4String strip_copy(G4String str, char ch=' ')
Return copy of string with leading and trailing characters removed.

Referenced by PG4gsmate().

◆ PG4gsmate()

void PG4gsmate ( G4String tokens)

Definition at line 41 of file G4gsmate.cc.

42{
43 // fill the parameter containers
44 G3fillParams(tokens,PTgsmate);
45 G4String name = Spar[0];
46 G4int imate = Ipar[0];
47 G4int nwbf = Ipar[1];
48 G4double a = Rpar[0];
49 G4double z = Rpar[1];
50 G4double dens = Rpar[2];
51 G4double radl = Rpar[3];
52 // G4double absl = Rpar[4];
53 G4double *ubuf = &Rpar[5];
54
55 G4gsmate(imate, name, a, z, dens, radl, nwbf, ubuf);
56}
G3G4DLL_API G4int Ipar[1000]
Definition: clparse.cc:65
void G3fillParams(G4String *tokens, const char *ptypes)
Definition: clparse.cc:216
G3G4DLL_API G4double Rpar[1000]
Definition: clparse.cc:66
G3G4DLL_API G4String Spar[1000]
Definition: clparse.cc:67
#define PTgsmate
Definition: G3toG4.hh:61
void G4gsmate(G4int imate, G4String name, G4double ain, G4double zin, G4double densin, G4double, G4int, G4double *)
Definition: G4gsmate.cc:58
const char * name(G4int ptype)

Referenced by G3CLEval().