Geant4 9.6.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
 
- 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 G4ElectroMagneticField
 G4ElectroMagneticField ()
 
virtual ~G4ElectroMagneticField ()
 
 G4ElectroMagneticField (const G4ElectroMagneticField &r)
 
G4ElectroMagneticFieldoperator= (const G4ElectroMagneticField &p)
 
virtual void GetFieldValue (const G4double Point[4], G4double *Bfield) const =0
 
virtual G4bool DoesFieldChangeEnergy () const =0
 
- Public Member Functions inherited from G4Field
virtual void GetFieldValue (const double Point[4], double *fieldArr) const =0
 
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
virtual G4bool DoesFieldChangeEnergy () const =0
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 

Detailed Description

Definition at line 48 of file G4LineCurrentMagField.hh.

Constructor & Destructor Documentation

◆ G4LineCurrentMagField()

G4LineCurrentMagField::G4LineCurrentMagField ( G4double  pFieldConstant)

Definition at line 32 of file G4LineCurrentMagField.cc.

33{
34 fFieldConstant = pFieldConstant ;
35}

◆ ~G4LineCurrentMagField()

G4LineCurrentMagField::~G4LineCurrentMagField ( )

Definition at line 38 of file G4LineCurrentMagField.cc.

39{
40}

Member Function Documentation

◆ GetFieldValue()

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

Definition at line 45 of file G4LineCurrentMagField.cc.

47{
48 // G4double fFieldConstant = 100 ;
49 G4double a = 1.00 ; // mm
50 G4double x = a*yTrack[0], y = a*yTrack[1] ;
51 G4double x2 = x*x, y2 = y*y, r2 = x2 + y2 ;
52 G4double r = std::sqrt(r2+a*a) ;
53 G4double Br = fFieldConstant/r;
54 B[0] = -Br*y/r ;
55 B[1] = Br*x/r ;
56 B[2] = 0 ;
57}
double G4double
Definition: G4Types.hh:64

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