Defines the magnetic field model for the PALLAS simulation.
More...
#include <PlasmaMLPALLASMagneticField.hh>
|
| | PlasmaMLPALLASMagneticField () |
| | Constructor.
|
| |
| | ~PlasmaMLPALLASMagneticField () override |
| | Destructor.
|
| |
| void | GetFieldValue (const G4double point[4], double *bField) const override |
| | Compute the magnetic field at a given location.
|
| |
| G4bool | GetMapBFieldStatus () const |
| |
| void | SetDipoleField (G4double val) |
| | Set the constant dipole magnetic field value.
|
| |
| void | SetGradient (size_t index, G4double gradient) |
| | Set the gradient of a quadrupole.
|
| |
| G4double | GetGradient (size_t index) const |
| | Get the gradient of a quadrupole.
|
| |
| void | SetQLength (size_t index, G4double length) |
| | Set the length of a quadrupole.
|
| |
| G4double | GetQLength (size_t index) const |
| | Get the length of a quadrupole.
|
| |
| void | SetQDrift (size_t index, G4double drift) |
| | Set the drift distance before a quadrupole.
|
| |
| G4double | GetQDrift (size_t index) const |
| | Get the drift distance before a quadrupole.
|
| |
| void | SetMapBFieldStatus (G4bool val) |
| | Enable or disable mapped magnetic field usage.
|
| |
Defines the magnetic field model for the PALLAS simulation.
Implements the PALLAS magnetic field configuration for dipole and quadrupole elements.
- Author
- Arnaud HUBER huber.nosp@m.@lp2.nosp@m.ib.in.nosp@m.2p3..nosp@m.fr - Alexei SYTOV sytov.nosp@m.@inf.nosp@m.n.it
- Date
- 2025
- Copyright
- PALLAS Project - GEANT4 Collaboration
This header declares the PlasmaMLPALLASMagneticField class, which extends Geant4's G4MagneticField to provide a configurable representation of the magnetic fields in the beamline, including dipole and quadrupole elements.
Responsibilities:
- Store and provide access to magnetic field parameters (dipole strength, quadrupole gradients, lengths, drifts)
- Compute the field value at any given point for use in particle tracking
- Allow toggling between constant-field mode and mapped-field mode
- Provide fitting functions for magnetic field profile parameterization
Key features:
- Configurable for up to four quadrupoles (
NumQuadrupoles)
- Units consistent with CLHEP system (tesla, mm, etc.)
- Command interface for runtime parameter changes
- Note
- This class is typically used by the geometry and tracking systems in conjunction with Geant4's field propagation.
This class allows setting and retrieving the parameters of dipole and quadrupole fields and calculates the magnetic field vector at any requested point.
◆ PlasmaMLPALLASMagneticField()
| PlasmaMLPALLASMagneticField::PlasmaMLPALLASMagneticField |
( |
| ) |
|
Constructor.
Default constructor.
◆ ~PlasmaMLPALLASMagneticField()
| PlasmaMLPALLASMagneticField::~PlasmaMLPALLASMagneticField |
( |
| ) |
|
|
override |
◆ GetFieldValue()
| void PlasmaMLPALLASMagneticField::GetFieldValue |
( |
const G4double |
point[4], |
|
|
double * |
bField |
|
) |
| const |
|
override |
Compute the magnetic field at a given location.
Compute the magnetic field at a given point.
- Parameters
-
| point | Position (and time) array [x, y, z, t] in global coordinates |
| bField | Output array [Bx, By, Bz] to store field components in tesla |
Computes dipole and quadrupole contributions based on current configuration.
- Parameters
-
| point | Array [x,y,z,t] with position and time |
| bField | Output array [Bx,By,Bz] |
◆ GetGradient()
| G4double PlasmaMLPALLASMagneticField::GetGradient |
( |
size_t |
index | ) |
const |
Get the gradient of a quadrupole.
Get gradient of a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
- Returns
- Gradient value in tesla/meter
- Parameters
-
| index | Quadrupole index (0-based) |
- Returns
- Gradient in tesla/m
◆ GetMapBFieldStatus()
| G4bool PlasmaMLPALLASMagneticField::GetMapBFieldStatus |
( |
| ) |
const |
|
inline |
◆ GetQDrift()
| G4double PlasmaMLPALLASMagneticField::GetQDrift |
( |
size_t |
index | ) |
const |
Get the drift distance before a quadrupole.
Get drift distance before a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
- Returns
- Drift distance in mm
- Parameters
-
| index | Quadrupole index (0-based) |
- Returns
- Drift distance in meters
◆ GetQLength()
| G4double PlasmaMLPALLASMagneticField::GetQLength |
( |
size_t |
index | ) |
const |
Get the length of a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
- Returns
- Length in mm
- Parameters
-
| index | Quadrupole index (0-based) |
- Returns
- Length in meters
◆ SetDipoleField()
| void PlasmaMLPALLASMagneticField::SetDipoleField |
( |
G4double |
fieldValue | ) |
|
Set the constant dipole magnetic field value.
Set the constant dipole field.
- Parameters
-
| val | Field strength in tesla |
| fieldValue | Dipole field in tesla |
◆ SetGradient()
| void PlasmaMLPALLASMagneticField::SetGradient |
( |
size_t |
index, |
|
|
G4double |
gradient |
|
) |
| |
Set the gradient of a quadrupole.
Set gradient of a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
| gradient | Gradient value in tesla/meter |
| index | Quadrupole index (0-based) |
| gradient | Gradient in tesla/m |
◆ SetMapBFieldStatus()
| void PlasmaMLPALLASMagneticField::SetMapBFieldStatus |
( |
G4bool |
status | ) |
|
Enable or disable mapped magnetic field usage.
Enable or disable mapped-field mode.
- Parameters
-
| val | True to use a field map, false for constant/parameterized fields |
| status | True for mapped-field, false for constant/parameterized |
◆ SetQDrift()
| void PlasmaMLPALLASMagneticField::SetQDrift |
( |
size_t |
index, |
|
|
G4double |
drift |
|
) |
| |
Set the drift distance before a quadrupole.
Set drift distance before a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
| drift | Distance in mm |
| index | Quadrupole index (0-based) |
| drift | Drift distance in meters |
◆ SetQLength()
| void PlasmaMLPALLASMagneticField::SetQLength |
( |
size_t |
index, |
|
|
G4double |
length |
|
) |
| |
Set the length of a quadrupole.
- Parameters
-
| index | Quadrupole index (0-based, < NumQuadrupoles) |
| length | Length in mm |
| index | Quadrupole index (0-based) |
| length | Length in meters |
The documentation for this class was generated from the following files: