3.10.1.20.1.5. opengate.sources.phspsources

3.10.1.20.1.5.1. Classes

PhaseSpaceSourceGenerator

Class that read phase space root file and extract position/direction/energy/weights of particles.

PhaseSpaceSource

Source of particles from a (root) phase space.

3.10.1.20.1.5.2. Module Contents

class opengate.sources.phspsources.PhaseSpaceSourceGenerator[source]

Class that read phase space root file and extract position/direction/energy/weights of particles. Particles information will be copied to the c++ side to be used as a source

current_index = None[source]
user_info = None[source]
root_file = None[source]
num_entries = 0[source]
cycle_count = 0[source]
batch = None[source]
points = None[source]
w = None[source]
__getstate__()[source]
initialize(user_info)[source]
read_phsp_and_keys()[source]
get_entry_start()[source]
generate(source)[source]

Main function that will be called from the cpp side every time a batch of particles should be created. Once created here, the particles are copied to cpp. (Yes maybe the copy could be avoided, but I did not manage to do it)

class opengate.sources.phspsources.PhaseSpaceSource(user_info)[source]

Bases: opengate.sources.generic.SourceBase

Source of particles from a (root) phase space. Read position + direction + energy + weight from the root and use them as event.

if global flag is True, the position/direction are global, not in the coordinate system of the mother volume. if the global flag is False, the position/direction are relative to the mother volume

  • Timing is not used (yet)

  • NOT ready for multithread (yet)

  • type of particle not read in the phase space but set by user

type_name = 'PhaseSpaceSource'[source]
static set_default_user_info(user_info)[source]
create_g4_source()[source]
particle_generator[source]
initialize(run_timing_intervals)[source]