Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LineCurrentMagField Class Reference

#include <G4LineCurrentMagField.hh>

+ Inheritance diagram for G4LineCurrentMagField:

Public Member Functions

 G4LineCurrentMagField (G4double pFieldConstant)
 
 ~G4LineCurrentMagField ()
 
void GetFieldValue (const G4double yTrack[], G4double B[]) const
 
G4FieldClone () const
 
- Public Member Functions inherited from G4MagneticField
 G4MagneticField ()
 
virtual ~G4MagneticField ()
 
 G4MagneticField (const G4MagneticField &r)
 
G4MagneticFieldoperator= (const G4MagneticField &p)
 
G4bool DoesFieldChangeEnergy () const
 
virtual void GetFieldValue (const G4double Point[4], G4double *Bfield) const =0
 
- Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
virtual void GetFieldValue (const G4double Point[4], G4double *fieldArr) const =0
 
virtual G4bool DoesFieldChangeEnergy () const =0
 
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 42 of file G4LineCurrentMagField.hh.

Constructor & Destructor Documentation

◆ G4LineCurrentMagField()

G4LineCurrentMagField::G4LineCurrentMagField ( G4double  pFieldConstant)

Definition at line 34 of file G4LineCurrentMagField.cc.

35{
36 fFieldConstant = pFieldConstant ;
37}

◆ ~G4LineCurrentMagField()

G4LineCurrentMagField::~G4LineCurrentMagField ( )

Definition at line 48 of file G4LineCurrentMagField.cc.

49{
50}

Member Function Documentation

◆ Clone()

G4Field * G4LineCurrentMagField::Clone ( ) const
virtual

Reimplemented from G4Field.

Definition at line 41 of file G4LineCurrentMagField.cc.

42{
43 return new G4LineCurrentMagField( fFieldConstant );
44}

◆ GetFieldValue()

void G4LineCurrentMagField::GetFieldValue ( const G4double  yTrack[],
G4double  B[] 
) const

Definition at line 54 of file G4LineCurrentMagField.cc.

56{
57 // G4double fFieldConstant = 100 ;
58 G4double a = 1.00 ; // mm
59 G4double x = a*yTrack[0], y = a*yTrack[1] ;
60 G4double x2 = x*x, y2 = y*y, r2 = x2 + y2 ;
61 G4double r = std::sqrt(r2+a*a) ;
62 G4double Br = fFieldConstant/r;
63 B[0] = -Br*y/r ;
64 B[1] = Br*x/r ;
65 B[2] = 0.0 ;
66}
double B(double temperature)
double G4double
Definition: G4Types.hh:83

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