In fact, I have two questions. Let’s say that I pass protons through the sample, which lose energy and get stuck in it. That is, a charge accumulates inside. Is it possible to make it so that when modeling the passage of protons through a sample, the electric field of previous protons that are already stuck in it is taken into account? The second question: can the program calculate the resulting electric field of all accumulated protons inside the sample in order to subsequently output this information?
_Geant4 Version:_11.2.2
_Operating System:_Linux Mint 21.3
_Compiler/Version:_gcc 11.4.0
_CMake Version:_3.22.1
In short, an event in Geant4 is the history of a primary until it stops and there is nothing for it to do at rest. If secondaries are created, it follows their history until the same happens to them.
In general Geant4 does not keep the history of one event for the next one and there is no concept of the particle tracked affecting the geometry in any way
We have similar concerns about charge trapping and accumulation in my experiment. To expand on what Luis wrote, Geant4 does not generate an event as a “time history” – each track is followed individual until it is killed, then another track is followed. Each track has it’s own internal timestamp, which is incremented for it alone during steps.
Tracks can’t interact with one another in Geant4, and tracks as such cannot affect the geometry or fields. You can define a time varying geometry, or time varying fields (there are examples for these), but those are externally driven.
Our plan is to do multiple stages for charge accumulation: run some number of events and collect information about where charges get trapped. Use that information externally (e.g., with COMSOL, FEniCS, Garfield, whatever) to compute the resulting distorted electric field, and then put that new field into another Geant4 run to see the effect.
Experimentally, we also have a neutralization procedure we follow before the start of each run, but this is a simulations discussion