Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mcscore Namespace Reference

Classes

class  MCParticle
 
class  MCVertex
 

Functions

def read_next_vertex
 
def test
 

Variables

list __all__ = [ 'MCParticle', 'MCVertex', 'read_next_vertex' ]
 

Detailed Description

Python module

This module provides classes and functions for scoring reactions

  [C] MCVertex:
  [C] MCParticle:
  [f] read_next_vertex(stream):

                                          Q, 2006
Python module (Python3)

This module provides classes and functions for scoring reactions

  [C] MCVertex:
  [C] MCParticle:
  [f] read_next_vertex(stream):

                                          Q, 2006

Function Documentation

def mcscore.read_next_vertex (   stream)

Definition at line 82 of file mcscore.py.

82 
83 def read_next_vertex(stream):
84  "read next vertex from a file stream"
85  line= stream.readline()
86  if line == "": # EOF
87  return 0
88 
89  # reading vertex
90  data = line.split()
91  x = string.atof(data[0]) * m
92  y = string.atof(data[1]) * m
93  z = string.atof(data[2]) * m
94  nsec = string.atoi(data[3])
95 
96  vertex = MCVertex(x,y,z)
97 
98  # reading particles
99  for p in range(0, nsec):
100  data = stream.readline().split()
101  pname = data[0]
102  Z = string.atoi(data[1])
103  A = string.atoi(data[2])
104  kE = string.atof(data[3]) * MeV
105  px = string.atof(data[4]) * MeV
106  py = string.atof(data[5]) * MeV
107  pz = string.atof(data[6]) * MeV
108 
109  particle = MCParticle(pname, Z, A, kE, px, py, pz)
110  vertex.append_particle(particle)
111 
112  return vertex
113 
114 
115 # ==================================================================
116 # test
# ==================================================================
const G4ParticleDefinition const G4Material *G4double range
def read_next_vertex
Definition: mcscore.py:82

Here is the caller graph for this function:

def mcscore.test ( )

Definition at line 117 of file mcscore.py.

118 def test():
119  f = open("reaction.dat")
120  f.seek(0)
121 
122  while(1):
123  vertex = read_next_vertex(f)
124  if vertex == 0:
125  break
126  vertex.printout()
127  del vertex
128  f.close()
129  print ">>> EOF"
130 
131 
132 # ==================================================================
133 # main
# ==================================================================
def read_next_vertex
Definition: mcscore.py:82
def test
Definition: mcscore.py:117

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

list mcscore.__all__ = [ 'MCParticle', 'MCVertex', 'read_next_vertex' ]

Definition at line 18 of file mcscore.py.