PlasmaMLPALLAS
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PlasmaMLPALLASMagneticField Class Reference

Defines the magnetic field model for the PALLAS simulation. More...

#include <PlasmaMLPALLASMagneticField.hh>

Inheritance diagram for PlasmaMLPALLASMagneticField:
Inheritance graph
[legend]
Collaboration diagram for PlasmaMLPALLASMagneticField:
Collaboration graph
[legend]

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.
 

Detailed Description

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

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:

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.

Constructor & Destructor Documentation

◆ PlasmaMLPALLASMagneticField()

PlasmaMLPALLASMagneticField::PlasmaMLPALLASMagneticField ( )

Constructor.

Default constructor.

◆ ~PlasmaMLPALLASMagneticField()

PlasmaMLPALLASMagneticField::~PlasmaMLPALLASMagneticField ( )
override

Destructor.

Member Function Documentation

◆ 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
pointPosition (and time) array [x, y, z, t] in global coordinates
bFieldOutput array [Bx, By, Bz] to store field components in tesla

Computes dipole and quadrupole contributions based on current configuration.

Parameters
pointArray [x,y,z,t] with position and time
bFieldOutput array [Bx,By,Bz]

◆ GetGradient()

G4double PlasmaMLPALLASMagneticField::GetGradient ( size_t  index) const

Get the gradient of a quadrupole.

Get gradient of a quadrupole.

Parameters
indexQuadrupole index (0-based, < NumQuadrupoles)
Returns
Gradient value in tesla/meter
Parameters
indexQuadrupole index (0-based)
Returns
Gradient in tesla/m

◆ GetQDrift()

G4double PlasmaMLPALLASMagneticField::GetQDrift ( size_t  index) const

Get the drift distance before a quadrupole.

Get drift distance before a quadrupole.

Parameters
indexQuadrupole index (0-based, < NumQuadrupoles)
Returns
Drift distance in mm
Parameters
indexQuadrupole index (0-based)
Returns
Drift distance in meters

◆ GetQLength()

G4double PlasmaMLPALLASMagneticField::GetQLength ( size_t  index) const

Get the length of a quadrupole.

Parameters
indexQuadrupole index (0-based, < NumQuadrupoles)
Returns
Length in mm
Parameters
indexQuadrupole 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
valField strength in tesla
fieldValueDipole field in tesla

◆ SetGradient()

void PlasmaMLPALLASMagneticField::SetGradient ( size_t  index,
G4double  gradient 
)

Set the gradient of a quadrupole.

Set gradient of a quadrupole.

Parameters
indexQuadrupole index (0-based, < NumQuadrupoles)
gradientGradient value in tesla/meter
indexQuadrupole index (0-based)
gradientGradient in tesla/m

◆ SetMapBFieldStatus()

void PlasmaMLPALLASMagneticField::SetMapBFieldStatus ( G4bool  status)

Enable or disable mapped magnetic field usage.

Enable or disable mapped-field mode.

Parameters
valTrue to use a field map, false for constant/parameterized fields
statusTrue 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
indexQuadrupole index (0-based, < NumQuadrupoles)
driftDistance in mm
indexQuadrupole index (0-based)
driftDrift distance in meters

◆ SetQLength()

void PlasmaMLPALLASMagneticField::SetQLength ( size_t  index,
G4double  length 
)

Set the length of a quadrupole.

Parameters
indexQuadrupole index (0-based, < NumQuadrupoles)
lengthLength in mm
indexQuadrupole index (0-based)
lengthLength in meters

The documentation for this class was generated from the following files: