• No results found

2.2 Monte Carlo technique Basic concepts

2.2.5 Monte Carlo optimization

The use in the clinic of the dose calculation systems requires a compromise between two main goals: Accuracy and precision in the results and a reasonable calculation time. The last condition is specially important in IORT, where the calculations must be done right after the surgery. In MC methods the precision of the results can be improved by increasing the number of histories. However, by improving the precision there is an increasing in the simulation time. To solve this, some methods have been designed to reduce simulation time with dierent techniques.

In this section we will describe the most common optimization techniques. Some of them imply a certain loss in the results quality because the use simplications in the physics model, in the input data or incorporate some strategies inside the MC algorithm to reduce the amount of needed histories regardless the consequences in the dose results.

Other techniques reduce computation time without losing quality in the data. Normally, they keep the physics of the model unaltered and change the calculation algorithm. These strategies are the most used and can be found in the conguration input of most codes.

2.2.5.1 Cut-o energies and step length

The mean free path of the particles (ie. the distance traveled between interactions) depends on their energy. Furthermore, the particle transfers energy to the medium in each interaction, until its energy is so low that the particle is absorbed. Some programs introduce these two facts in their code to accelerate simulation time.

The cut-o energy value is a threshold in energy. When the energy of a history goes below the cut-o energy value, the program stops following that particle. The particle is considered to be absorbed at that point. There are dierent cut-o values for the energy depending on the type of particle and the type of interaction.

The step length parameter denes the distance between interactions. The bigger the value is, the quicker the simulation.

The user may modify both of the mentioned parameters. They had to be handled carefully, as such parameters may signicantly inuence a simulation and accuracy might be lost.

Some of the available programs that use these techniques are: PENELOPE [Salvat et al., 2006], EGS4 [Kawrakow and Rogers, 2000, Kawrakow et al., 2014] and VMC [Kawrakow et al., 1996].

2.2.5.2 Condensed histories

Another optimization technique of the MC simulations is the use of condensed histories [Berger et al., 1963, Kawrakow and Bielajew, 1998]. It consists of replacing the calculation of a certain number of interactions (several thousands) by a single interaction whose eect will be the sum of all replaced particle eects.

A typical fast electron slowing down inside a medium undergoes of the order of 105-106 collisions with surrounding matter, causing in most interactions only minor changes in the particle's energy and direction of ight. This large number of interactions makes very dicult to track every electron individually, and the computation time of doing this is very high. To circumvent this diculty, Berger [Berger et al., 1963] developed the condensed history technique. In this method, large numbers of transport and collision processes are condensed to a single electron step. The cumulative eect of the individual interactions is taken into account by the appropriate change of the particles energy and direction of motion at the end of the step.

This approximation has a limitation. In multiple dispersion theories, it is assumed that particles move in heterogeneous media and the distance they travel is bigger than their main free path. As

2.2. Monte Carlo technique. Basic concepts a result, condensed history approximation can lead to artifacts in areas next to interfaces and, in general, in any object with a comparable size to the mean free path of the particles. Another limitation of the condensed simulation is that this approximation cannot take into account the catastrophic eects (ie. individual interactions that signicantly modify the energy or direction of the particles). To solve these limitations a mixed model can be implemented. In this model, condensed histories simulations are used to reproduce the soft interactions where the energy or direction of the particles do not exceed an user-dened threshold, and the rest of the simulations are calculated in detail (known as hard interactions) [Berger et al., 1963].

2.2.5.3 Variance reduction techniques

The variance reduction techniques may be used to make calculations more ecient. In some cases, these techniques require that no further approximations must be made to the transport physics. In other cases, the gains in computing speed come at the cost of computing results that may be less accurate since approximations are introduced [Bielajew, 2001].

Lets introduce the most used variance reduction techniques.

The interaction forcing technique takes advantage of the fact that, usually, a high variance comes from a low interaction rate. This is specially signicant for photons, where eciency may be lost because photons leave the geometry of the simulation without interacting and time is spent tracking photons through a geometry that do not contribute to the score. This technique forces photons to interact within the geometry of interest. These photons will then be weighted by the probability that the photon would have had of interacting before leaving the geometry of the simulation.

The particle splitting technique is used in situations where interest is focused on a particular volume inside the geometry. To increase interaction statistics within that area, a splitting technique can be used. It divides the particles with weight ω into a N smaller ones each with a new weight, ω' = ω/N.

Another technique is used when particle weights become very small. If this happens and the photon is headed away from the region of interest it can be used the russian roulette technique. It selects a random number. If this random number lies above a threshold α, the photon is discarded without scoring any quantity of interest. If the random number turns out to be below α the photon survives but with a new weight, ω' = ω/α.

All these techniques distort the simulation results because they modify the probability distribution functions of the involved interactions. In order to minimize the alteration, parameters involved in these techniques must be chosen carefully.

Now, we will describe a technique that accelerate the simulation without modifying the quality of the results.

2.2.5.4 Pre-calculation of the source. Phase Space les

When a MC simulation of a treatment planning needs to be done, we need to simulate the detailed geometry of the accelerator. But if in each treatment planning the simulation is performed by starting the electrons at the beginning of the accelerator head, we will need a very long simulation to achieve a dose distribution with low variance.

This is because the particles, before entering the medium, go though a serial of materials, such as collimators, attening lters, etc., as seen in Chapter 1. Most particles will interact in the accelerator head, being absorbed or generating secondary particles, and following their tracks will slow down considerably the simulation, even though these interactions are not directly contributing to the dose. But these elements, responsible of beam modication, are usually xed to the accelerator head and used in all treatments. By taking advantage of this property, some codes have developed a strategy that consist of saving the information of the particles in a le at a certain point, usually at the end of the collimation system. With this, a full simulation of each accelerator head can be done once, and the information of the particles coming out the accelerator is recorded. Next time a simulation of that accelerator is required, instead of generating again the detailed geometry of all the components of the accelerator, all the beam information coming out of the accelerator can be read from the stored le.

This le is known as Phase Space le. It contains all the information needed to characterize the beam. This information includes type of particle, energy, position and direction of the particles, among other properties particular of each code.