# Draft: DepositionGeant4: Allow for a beam of rectangular and elliptical shape.

The option of having a rectangle and ellipse beam in the `DepositionGeant4`

module was added.
The histogram `incident_track_position`

visualises the beam in 2D.
Below, there are examples for the `Rectangle`

and `Ellipse`

beam.

The dimensions are specified with the `beam_size`

parameter, by giving either one or two values.
If only one value is specified the length in x and y are equal (the beam sigma in x and y for the ellipse).
If two values are specified they should correspond to respective parameters in x and y.

As the `beam_size`

key can take one or two parameters, backwards capability is ensured when going for the default circle beam with one
`beam_size`

value for the beam sigma in r.

One remaining issue is that for some reason the `beam_size`

parameter when given two values, switches x and y.
The configuration for the rectangle beam shown below was as follows:

```
[DepositionGeant4]
source_type = "beam"
flat_beam = true
particle_type = "e-"
source_energy = 5GeV
beam_size = 3mm 4mm
beam_shape = Rectangle
beam_direction = 0 0 1
model = "fixed"
source_position = 0 0 -10mm
output_plots = true
```

In the resulting plot, however, it is exactly the other way around with a length in x of 4mm and in y of 3mm.

incident_track_position_rectangle.pdfincident_track_position_ellipse.pdf