3.10.1.9. opengate.engines¶
3.10.1.9.1. Classes¶
Base class for all engines (SimulationEngine, VolumeEngine, etc.) |
|
Source Engine manages the G4 objects of sources at runtime |
|
Class that contains all the information and mechanism regarding physics |
|
Main object to manage all actions during a simulation. |
|
This object manages all actors G4 objects at runtime |
|
FIXME: Doc ParallelWorldEngine |
|
Engine that will create all G4 elements for the hierarchy of volumes. |
|
Main class to manage visualisation |
|
FIXME |
|
Main class to execute a Simulation (optionally in a separate subProcess) |
3.10.1.9.2. Functions¶
This function parses an xml file containing optical material properties. |
|
Creates and fills a G4MaterialPropertiesTable with values from a dictionary created by a parsing function, |
|
|
|
|
3.10.1.9.3. Module Contents¶
- class opengate.engines.EngineBase(simulation_engine)[source]¶
Base class for all engines (SimulationEngine, VolumeEngine, etc.)
- class opengate.engines.SourceEngine(simulation_engine)[source]¶
Bases:
EngineBaseSource Engine manages the G4 objects of sources at runtime
- initialize_actors(actors)[source]¶
3.10.1.9. Parameters¶
- actorsdict
The dictionary ActorEngine.actors which contains key-value pairs “actor_name” : “Actor object”
- opengate.engines.load_optical_properties_from_xml(optical_properties_file, material_name)[source]¶
This function parses an xml file containing optical material properties. Fetches property elements and property vector elements.
Returns a dictionary with the properties or None if the material is not found in the file.
- opengate.engines.create_g4_optical_properties_table(material_properties_dictionary)[source]¶
Creates and fills a G4MaterialPropertiesTable with values from a dictionary created by a parsing function, e.g. from an xml file. Returns G4MaterialPropertiesTable.
- class opengate.engines.PhysicsEngine(simulation_engine)[source]¶
Bases:
EngineBaseClass that contains all the information and mechanism regarding physics to actually run a simulation. It is associated with a simulation engine.
- close_physics_constructors()[source]¶
This method removes PhysicsConstructors defined in python from the physics list.
It should be called after a simulation run, i.e. when a simulation engine closes, because the RunManager will otherwise attempt to delete the PhysicsConstructor and cause a segfault.
- class opengate.engines.ActionEngine(simulation_engine)[source]¶
Bases:
opengate_core.G4VUserActionInitialization,EngineBaseMain object to manage all actions during a simulation.
- class opengate.engines.ActorEngine(simulation_engine)[source]¶
Bases:
EngineBaseThis object manages all actors G4 objects at runtime
- class opengate.engines.ParallelWorldEngine(parallel_world_name, *args)[source]¶
Bases:
opengate_core.G4VUserParallelWorld,EngineBaseFIXME: Doc ParallelWorldEngine
- class opengate.engines.VolumeEngine(simulation_engine)[source]¶
Bases:
opengate_core.G4VUserDetectorConstruction,EngineBaseEngine that will create all G4 elements for the hierarchy of volumes. Correspond to the G4VUserDetectorConstruction (inherit) Also manage the list of parallel worlds.
- class opengate.engines.VisualisationEngine(simulation_engine)[source]¶
Bases:
EngineBaseMain class to manage visualisation
- class opengate.engines.SimulationEngine(simulation, new_process=False)[source]¶
Bases:
EngineBaseMain class to execute a Simulation (optionally in a separate subProcess)
- run_engine()[source]¶
When the simulation is about to init, if the Simulation object is in a separate process (with ‘spawn’), it has been pickled (copied) and the G4 phys list classes does not exist anymore, so we need to recreate them with ‘create_physics_list_classes’ Also, the StateManager must be recreated.
NK: Yes, but not this way. Each class should take care of recreating attributes which where set to None during pickling by implementing a __setstate__ method. Implementing the resetting somewhere else (maybe in multiple places…) in the code will make it very difficult to maintain.
-> removed the lines and implemented __setstate__ methods for the classes in question