Geant4-11
Data Structures | Functions | Variables
mcscore Namespace Reference

Data Structures

class  MCParticle
 
class  MCVertex
 

Functions

def read_next_vertex (stream)
 
def test ()
 

Variables

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

Detailed Description

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

◆ read_next_vertex()

def mcscore.read_next_vertex (   stream)

Definition at line 82 of file mcscore.py.

82def read_next_vertex(stream):
83 "read next vertex from a file stream"
84 line= stream.readline()
85 if line == "": # EOF
86 return 0
87
88 # reading vertex
89 data = line.split()
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])
94
95 vertex = MCVertex(x,y,z)
96
97 # reading particles
98 for p in range(0, nsec):
99 data = stream.readline().split()
100 pname = data[0]
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
107
108 particle = MCParticle(pname, Z, A, kE, px, py, pz)
109 vertex.append_particle(particle)
110
111 return vertex
112
113
114# ==================================================================
115# test
116# ==================================================================
String_V split(const G4String &input, char separator='\n')
def read_next_vertex(stream)
Definition: mcscore.py:82

References G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}.split().

Referenced by test().

◆ test()

def mcscore.test ( )

Definition at line 117 of file mcscore.py.

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

References print(), and read_next_vertex().

Referenced by G4PolyPhiFace.Diagnose(), G4PixeShellDataSet.FullFileName(), G4GenericTrap.InsidePolygone(), G4DNAPTBIonisationModel.ReadDiffCSFile(), G4DNAPTBElasticModel.ReadDiffCSFile(), G4ReduciblePolygon.RemoveRedundantVertices(), and G4ParticleHPVector.Sample().

Variable Documentation

◆ __all__

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

Definition at line 18 of file mcscore.py.