Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions | Variables
mcscore Namespace Reference

Data Structures

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.

Referenced by mcscore.MCVertex.__del__(), and test().

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
# ==================================================================
def read_next_vertex
Definition: mcscore.py:82
def mcscore.test ( )

Definition at line 117 of file mcscore.py.

References read_next_vertex().

Referenced by mcscore.MCVertex.__del__(), G4PreCompoundModel.DeExcite(), UPolyPhiFace.Diagnose(), G4PolyPhiFace.Diagnose(), G4TwistTubsSide.DistanceToSurface(), G4RPGInelastic.GetNormalizationConstant(), G4Trap.GetPointOnSurface(), G4ITReactionChange.Initialize(), UReduciblePolygon.RemoveRedundantVertices(), G4ReduciblePolygon.RemoveRedundantVertices(), G4NeutronHPVector.Sample(), and G4PenelopeAnnihilationModel.SampleSecondaries().

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

Variable Documentation

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

Definition at line 18 of file mcscore.py.