I’m currently simulating F-18 decays in Geant4. When I run the simulation with /run/beamOn N, I understand that Geant4 treats this as N independent events - each event starting at t=0.
I’d like to simulate a time-dependent scenario, where decays occur continuously over a certain period (several seconds or minutes), closer to a real radioactive source.
My questions are:
Is it possible to make Geant4 evolve “in real time,” or is it fundamentally event-based?
If not, what’s the correct approach to model a continuous source - should I assign SetParticleTime() manually for each primary, or use a different run structure?
How do users typically handle this when simulating activities or decay rates over time (especially for PET/PEPT-type setups)?
Geant4 gives you the timestamps relative to events. You can add a global timestamp reference when processing the data by sampling N events from a Poisson distribution with mean given by your activity and then just running a cumulative sum that you add to each event.
Thanks a lot, that makes perfect sense. So Geant4 stays event-based, but adding timestamps afterward (sampled from a Poisson/exponential law using the source activity) makes the dataset statistically time-realistic.
I was just hoping there might be a way to make it more time-continuous within Geant4 itself, since the events are still independent.
The philiosophy here is that you can use the same simulation results with different “activities” very easily. It is just that, for a fixed amount of time, you will need to scale the simulation accordingly to get the total number of events you’d desire.
Thanks, that really clarifies the philosophy. I understand the benefit of keeping events independent for scaling activities, but my goal is to simulate a moving radioactive source, and I’m not sure how to model that if events are time-independent.
If the source follows a trajectory, the emission position should depend on time, which seems at odds with Geant4’s event-by-event reset. Would the right approach be to define the source position externally as a function of time and assign it (along with SetParticleTime())?
Or is there a built-in way to let the geometry or source evolve dynamically during a run?