KAHIBARO
Discord Login Register

14.2. Simulation Statistics Actor

Number of events

The simulation statistics actor in GATE is a simple but very important tool that summarizes what happened during a run. It does not record detailed physics information, but instead provides global counters, such as how many events were simulated, how many tracks were created, and how many steps were taken.

In GATE, an event is usually associated with one primary history, for example one radioactive decay or one primary particle entering the geometry. The number of events reported by the statistics actor is therefore the total number of primary histories that GATE has processed during the simulation.

You typically attach the simulation statistics actor to the world volume. When the simulation finishes, GATE prints a small report to the terminal and often writes a text file. That report includes at least the total number of events, and sometimes a breakdown over threads if multithreading is enabled.

The number of events is one of the key parameters that controls statistical precision. For many quantities estimated with Monte Carlo, such as dose or energy spectra, the relative statistical uncertainty behaves approximately like
$$
\frac{\sigma}{\mu} \propto \frac{1}{\sqrt{N_{\text{events}}}},
$$
where $N_{\text{events}}$ is the number of simulated events, $\mu$ is the mean value, and $\sigma$ is the standard deviation of the estimate.

For a fixed simulation setup, doubling the number of events reduces the statistical noise by about a factor of $\sqrt{2}$, but also roughly doubles the computation time. The simulation statistics actor helps you check that you actually simulated the intended number of events.

When you run parameter scans or repeat the same simulation with different random seeds, the statistics actor allows you to verify that each run used the same number of events. This is very useful when you compare results or combine them later, for example by averaging dose maps or merging ROOT output.

In addition, the actor can help you detect configuration errors. If the number of events in the report is zero or much smaller than expected, there might be a problem with the primary source configuration or with how the run was started. By checking the event count first, you avoid wasting time inspecting empty output files or trying to debug actors that never saw any particles.

Tracks

While events count primary histories, tracks count particle trajectories that GATE had to transport. A single event can create many tracks, for example a primary gamma that produces electrons, or a proton that creates secondary protons, neutrons, and photons. The simulation statistics actor reports the total number of tracks created during the run.

The ratio of tracks to events gives a quick impression of how “busy” a simulation is. In a simple photon-beam simulation in air, you might see only slightly more tracks than events. In a detailed proton therapy simulation in a patient, you can observe many secondaries, so the number of tracks per event can become very large.

Tracks are closely linked to computational cost. Every new track needs to be transported until it stops, leaves the geometry, or is killed by a cut. A configuration that produces many low-energy secondaries will therefore increase the track count and slow down the simulation. The statistics actor exposes this behavior and helps you understand performance.

You can use track statistics in several ways. If you change the physics list or production cuts and notice that the track count drops significantly, you have made the simulation less detailed. This might be acceptable if you want faster runs. If the track count rises sharply, it can explain longer runtimes and higher memory consumption.

A sudden increase in the number of tracks, without a corresponding change in the number of events, usually means your physics or cut settings now generate more secondary particles. Always check whether this is physically justified for your application, such as detailed dosimetry, or if you accidentally made the simulation unnecessarily complex.

Track statistics are also useful for debugging. If you expect certain particle types to be produced but the total track count is unexpectedly small, or remains close to the number of events, it can indicate missing physics processes or overly aggressive cuts that stop particles before they are transported.

Steps

Steps are the smallest transport units in a Monte Carlo simulation. A step represents the movement of a particle from one point to another, along with any interactions that occur at the end of that movement. The simulation statistics actor reports the total number of steps taken over all tracks and events.

Each step involves physics calculations, such as energy loss, scattering, or boundary interactions, so the total number of steps is intimately connected to computation time. A large number of short steps leads to high accuracy but slower execution. Fewer, longer steps can make the simulation faster but less detailed.

The total number of steps is especially relevant when you study how transport parameters affect performance. For example, finer step limits, tighter production cuts, or detailed geometry boundaries tend to increase the step count. By comparing runs with different configurations and examining the reported steps, you can quantify how much extra work each choice creates.

You can combine events, tracks, and steps from the statistics actor to form simple indicators, such as average tracks per event or average steps per track. These ratios help you understand the complexity of particle transport in your problem. For example, if the average number of steps per track becomes very large after a change in geometry, it might mean you added a dense region or many small volumes that force frequent boundary checks.

If the number of steps is extremely high compared to the number of events, your simulation may be over-resolved. Before running large studies, check step statistics and consider adjusting cuts or transport parameters to balance accuracy and performance.

Finally, step statistics can reveal unexpected behavior. If you introduce a new material or region and see that the step count increases sharply, you might have created tiny overlaps or very thin layers that force many short steps. The simulation statistics actor provides a quick numerical signal of such issues, which you can then investigate further with geometry visualization or more detailed diagnostic actors.

Views: 8

Comments

Please login to add a comment.

Don't have an account? Register now!