4This module provides classes and functions for scoring reactions
13from Geant4.hepunit import *
15# ==================================================================
17# ==================================================================
18__all__ = [ 'MCParticle', 'MCVertex', 'read_next_vertex' ]
21# ==================================================================
30 def __init__(self, aname, aZ, aA, akE, apx, apy, apz):
40 print(
"--- particle: %s, Z=%2d, A=%2d, kE=%g" % \
60 print(
"@@@ vertex: x=(%g,%g,%g) Nsec=%3d" % \
66 aline =
"%g %g %g %d\n" % \
70 aline =
" %s %d %d %g %g %g %g\n" % \
71 (p.name, p.Z, p.A, p.kineticE/MeV, p.px/MeV, p.py/MeV, p.pz/MeV)
83 "read next vertex from a file stream"
84 line= stream.readline()
90 x = string.atof(data[0]) * m
91 y = string.atof(data[1]) * m
92 z = string.atof(data[2]) * m
93 nsec = string.atoi(data[3])
98 for p
in range(0, nsec):
99 data = stream.readline().
split()
101 Z = string.atoi(data[1])
102 A = string.atoi(data[2])
103 kE = string.atof(data[3]) * MeV
104 px = string.atof(data[4]) * MeV
105 py = string.atof(data[5]) * MeV
106 pz = string.atof(data[6]) * MeV
108 particle =
MCParticle(pname, Z, A, kE, px, py, pz)
109 vertex.append_particle(particle)
118 f = open(
"reaction.dat")
134if __name__ ==
"__main__":
void print(G4double elem)
def __init__(self, aname, aZ, aA, akE, apx, apy, apz)
def dump_vertex(self, stream)
def __init__(self, ax, ay, az)
def append_particle(self, aparticle)
def read_next_vertex(stream)