Skip to content

Opengate newsletter 3

David Sarrut edited this page Nov 28, 2023 · 4 revisions

News

A lot of consolidation work is happening right now and during the last month about Gate version 10. Here are some changes (in Monte Carlo ... uh ... random order):

  • Thanks to the UC Davis team and Nils, optical physics is now available! See the first feature in test013_phys_lists_6. We will focus on this part in the next newsletter
  • ElectroMagnetic physics options and parameters, such as fluo, auger, pixe, etc, are now very easy to set. They follow the Geant4 way, see test test063_em_switches
  • Because sometimes particles need a reminder to mind their steps, especially when they're wandering into unauthorized volumes, we implemented the KillActor just like in Gate9. When this actor is attached to a volume, every particle that will have a step in this volume will stop being tracked. This is useful to gain computation time. See test test064_kill_actor
  • Generic source has been updated with theta/phi angles (Geant4 style): see test test010_generic_source_thetaphi
  • The MotionActor have been updated (see focus below)
  • An important new feature is the "simulation as json": any simulation that you create can now be stored as a very simple json (text) file. This file can then be read to run again the same simulation. Don't get us wrong: it is not only a fancy mechanism, but a very important piece of work that will allow tons of advanced applications, such as easier multi-CPU spawning, UI creation, reproducibility etc. This feature is still only halfway done (actors and sources are missing). More on this in future newsletters. Current tests: test065_sim_as_dict and test065_sim_from_dict

All mentioned tests are in https://github.com/OpenGATE/opengate/tree/master/opengate/tests/src

There is a new beta version 10.0beta06:

pip install --upgrade --pre opengate

Or use the developer version.

Focus on ... the MotionActor

This actor is used to move a given volume (and of course all of the daughters') from one run to the other. The principle is simple, it manages a list of translations and rotations that are successively applied to the volume at the beginning of each run. For example:

    motion = sim.add_actor("MotionVolumeActor", "my_motion_actor")
    motion.mother = "my_waterbox"
    motion.translations = [ 
            [0, 0, 10*cm], 
            [0, 10*cm, 3*mm], 
            [8*mm, 0, 0]]
    motion.rotations = [
            Rotation.from_euler("y", -20, degrees=True).as_matrix(), 
            Rotation.from_euler("x", 20, degrees=True).as_matrix(),
            Rotation.from_euler("z", 55, degrees=True).as_matrix()]
            
    sim.run_timing_intervals = [
        [0, 0.5 * sec],
        [0.5 * sec, 1.0 * sec],
        # Watch out: there is (on purpose) a 'hole' in the timeline
        [1.5 * sec, 2.5 * sec],
    ]

The volume called "my_waterbox" will have a different position (translation and rotation) in all of the 3 runs (having all different durations).


As always, your feedback is crucial to us. Please don't hesitate to reach out with any questions, suggestions, or comments.
Thank you for your continued support and contributions. 2023/11/28