PlasmaMLPALLAS
|
Defines the magnetic field model for the PALLAS simulation. More...
#include <PlasmaMLPALLASMagneticField.hh>
Public Member Functions | |
PlasmaMLPALLASMagneticField () | |
Constructor. | |
~PlasmaMLPALLASMagneticField () override | |
Destructor. | |
void | GetFieldValue (const G4double point[4], double *bField) const override |
Compute the magnetic field at a given location. | |
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.
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:
Key features:
NumQuadrupoles
)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 | ( | ) |
Constructor.
Default constructor.
|
override |
Destructor.
|
override |
Compute the magnetic field at a given location.
Compute the magnetic field at a given point.
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.
point | Array [x,y,z,t] with position and time |
bField | Output array [Bx,By,Bz] |
G4double PlasmaMLPALLASMagneticField::GetGradient | ( | size_t | index | ) | const |
Get the gradient of a quadrupole.
Get gradient of a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
index | Quadrupole index (0-based) |
G4double PlasmaMLPALLASMagneticField::GetQDrift | ( | size_t | index | ) | const |
Get the drift distance before a quadrupole.
Get drift distance before a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
index | Quadrupole index (0-based) |
G4double PlasmaMLPALLASMagneticField::GetQLength | ( | size_t | index | ) | const |
Get the length of a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
index | Quadrupole index (0-based) |
void PlasmaMLPALLASMagneticField::SetDipoleField | ( | G4double | fieldValue | ) |
Set the constant dipole magnetic field value.
Set the constant dipole field.
val | Field strength in tesla |
fieldValue | Dipole field in tesla |
void PlasmaMLPALLASMagneticField::SetGradient | ( | size_t | index, |
G4double | gradient | ||
) |
Set the gradient of a quadrupole.
Set gradient of a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
gradient | Gradient value in tesla/meter |
index | Quadrupole index (0-based) |
gradient | Gradient in tesla/m |
void PlasmaMLPALLASMagneticField::SetMapBFieldStatus | ( | G4bool | status | ) |
Enable or disable mapped magnetic field usage.
Enable or disable mapped-field mode.
val | True to use a field map, false for constant/parameterized fields |
status | True for mapped-field, false for constant/parameterized |
void PlasmaMLPALLASMagneticField::SetQDrift | ( | size_t | index, |
G4double | drift | ||
) |
Set the drift distance before a quadrupole.
Set drift distance before a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
drift | Distance in mm |
index | Quadrupole index (0-based) |
drift | Drift distance in meters |
void PlasmaMLPALLASMagneticField::SetQLength | ( | size_t | index, |
G4double | length | ||
) |
Set the length of a quadrupole.
index | Quadrupole index (0-based, < NumQuadrupoles) |
length | Length in mm |
index | Quadrupole index (0-based) |
length | Length in meters |