How to store all particles steps with PhaseSpaceActor using 'steps_to_store = "all" ' ? #750
Replies: 6 comments
-
|
actor.attached_to = 'volume' what is 'volume' here ? |
Beta Was this translation helpful? Give feedback.
-
|
Ah sorry, the volume is supposed to be the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I noticed that your box material is air, which is too light to stop a photon. Maybe you can try a different material, such as water. |
Beta Was this translation helpful? Give feedback.
-
|
I think @ustcfdm is right: the reason why you are only seeing single steps per event in your volume is that Geant4 only does one step. Geant4 adjusts the step size according to the mean free path length in your volume, i.e. how far can I move the particle until I should sample a new interaction. Since your volume is filled with air, the step length is long. In a denser medium like water, you should see multiple steps within the volume. You can force Geant4 to not exceed a certain step length: In your case, e.g.: With these lines, you should get steps for at least every mm for electrons and gammas. @jocars31: Please report back if this works so we can mark the question as answered. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @nkrah and @ustcfdm, reducing stepsize solves does the job for the air phantom. Thank you very much!! |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am really happy for the last release of opengate, since it states that all steps within a volume linked to a
PhaseSpaceActorcan be stored usingactor.steps_to_store = "all". I upgraded my opengate package and ran the tests (all passed) and started coding in jupyter lab in a venv.In the end, I want to save a particle track in a certain volume and plot it later.
So I tried to use this function as follows:
Now I run the simulation with
sim.run(start_new_process=True)and looked into the output root file, but only saw the entries for Energy and I assume entering position. I also looking into other attributes returning the position but they only returned one position.
I can't really figure out, what I'm missing here. Any ideas or comments on this are highly appreciated!
Please let me know, if you need further information.
Thank you all very much in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions