Unique module, adds a magnetic field to the full volume, including the active sensors. By default, the magnetic field is turned off.
Unique module, adds a magnetic field to the full volume of the simulation, including the active sensors.
By default, the magnetic field is turned off.
The magnetic field reader only provides constant magnetic fields, read in as a three-dimensional vector. The magnetic field is forwarded to the GeometryManager, enabling the magnetic field for the particle propagation via Geant4, as well as to all detectors for enabling a Lorentz drift during the charge propagation.
The magnetic field reader provides the possibility of using a simple constant magnetic field permeating the entire simulated setup,
or a meshed field which is centered around the origin of the global coordinate system. The magnetic field is forwarded to the
GeometryManager, enabling the magnetic field for the particle propagation via Geant4, as well as to all detectors for
enabling a Lorentz drift during the charge propagation.
For the **constant** model, the field is set as a three-dimensional vector.
For the **mesh** model, the field needs to be provided in form of an APF or INIT file which provides total size of the field,
the bin size of the mesh as well as the actual field data. In addition, an offset of this field from the origin of the global
coordinate system can be provided via the `offset` parameter. Here, the value set via `magnetic_field` is sued as a fallback
field value used outside the volume provided by the field file.
## Parameters
*`model` : Type of the magnetic field model, currently only **constant** possible.
*`magnetic_field` : Vector describing the magnetic field.
*`model` : Type of the magnetic field model, possible values are **constant** and **mesh**.
*`magnetic_field` : Vector describing the magnetic field. In the model **mesh** this is used as the fallback field outside the meshed region.
*`file_name` : Path to the APF or INIT file containing the magnetic field to be used. Only used in the **mesh** model.
*`offset` : Offset of the meshed magnetic field center from the global center of origin of the simulation. Defaults to `0, 0, 0` and is only used in the **mesh** model.
## Usage
An example is given below
An example for a constant magnetic field is
```ini
[MagneticFieldReader]
model="constant"
magnetic_field=500mT 3.8T 0T
```
The configuration for a meshed field may look like the following: