Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MagneticField Class Referenceabstract

#include <G4MagneticField.hh>

Inheritance diagram for G4MagneticField:

Public Member Functions

 G4MagneticField ()
 ~G4MagneticField () override=default
 G4MagneticField (const G4MagneticField &r)
G4MagneticFieldoperator= (const G4MagneticField &p)
G4bool DoesFieldChangeEnergy () const override
void GetFieldValue (const G4double Point[4], G4double *Bfield) const override=0
G4FieldType GetFieldType () const override
Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
virtual ~G4Field ()=default
 G4Field (const G4Field &p)=default
G4Fieldoperator= (const G4Field &p)
G4bool IsGravityActive () const
void SetGravityActive (G4bool OnOffFlag)
virtual G4FieldClone () const

Additional Inherited Members

Static Public Attributes inherited from G4Field
static constexpr G4int MAX_NUMBER_OF_COMPONENTS = 24

Detailed Description

Definition at line 40 of file G4MagneticField.hh.

Constructor & Destructor Documentation

◆ G4MagneticField() [1/2]

◆ ~G4MagneticField()

G4MagneticField::~G4MagneticField ( )
overridedefault

◆ G4MagneticField() [2/2]

G4MagneticField::G4MagneticField ( const G4MagneticField & r)

Copy constructor and assignment operator.

Definition at line 38 of file G4MagneticField.cc.

39 : G4Field( false )
40{
41}

Member Function Documentation

◆ DoesFieldChangeEnergy()

G4bool G4MagneticField::DoesFieldChangeEnergy ( ) const
inlineoverridevirtual

Since a pure magnetic field does not change track energy, returns false.

Implements G4Field.

Definition at line 59 of file G4MagneticField.hh.

59{ return false; }

◆ GetFieldType()

G4FieldType G4MagneticField::GetFieldType ( ) const
inlineoverridevirtual

Returns the field type-ID, "kMagnetic". This should be overriden in derived classes.

Reimplemented from G4Field.

Definition at line 74 of file G4MagneticField.hh.

74{ return kMagnetic; }
@ kMagnetic
magnetic field

◆ GetFieldValue()

void G4MagneticField::GetFieldValue ( const G4double Point[4],
G4double * Bfield ) const
overridepure virtual

Given the position time vector 'Point', returns the value of the field in the array 'Bfield'.

Parameters
[in]PointThe position time vector.
[out]BfieldThe field array in output.

Implements G4Field.

Implemented in G4CachedMagneticField, G4TCachedMagneticField< T_Field >, G4TUniformMagneticField, and G4UniformMagField.

◆ operator=()

G4MagneticField & G4MagneticField::operator= ( const G4MagneticField & p)

Definition at line 43 of file G4MagneticField.cc.

44{
45 if (&p == this) { return *this; }
47 return *this;
48}
G4Field & operator=(const G4Field &p)
Definition G4Field.cc:38

Referenced by G4CachedMagneticField::operator=(), and G4UniformMagField::operator=().


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