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

#include <G4UniformElectricField.hh>

+ Inheritance diagram for G4UniformElectricField:

Public Member Functions

 G4UniformElectricField (const G4ThreeVector FieldVector)
 
 G4UniformElectricField (G4double vField, G4double vTheta, G4double vPhi)
 
virtual ~G4UniformElectricField ()
 
 G4UniformElectricField (const G4UniformElectricField &p)
 
G4UniformElectricFieldoperator= (const G4UniformElectricField &p)
 
virtual void GetFieldValue (const G4double pos[4], G4double *field) const
 
- Public Member Functions inherited from G4ElectricField
 G4ElectricField ()
 
virtual ~G4ElectricField ()
 
 G4ElectricField (const G4ElectricField &r)
 
G4ElectricFieldoperator= (const G4ElectricField &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 47 of file G4UniformElectricField.hh.

Constructor & Destructor Documentation

◆ G4UniformElectricField() [1/3]

G4UniformElectricField::G4UniformElectricField ( const G4ThreeVector  FieldVector)

Definition at line 40 of file G4UniformElectricField.cc.

41{
42 fFieldComponents[0] = 0.0;
43 fFieldComponents[1] = 0.0;
44 fFieldComponents[2] = 0.0;
45 fFieldComponents[3] = FieldVector.x();
46 fFieldComponents[4] = FieldVector.y();
47 fFieldComponents[5] = FieldVector.z();
48}
double z() const
double x() const
double y() const

◆ G4UniformElectricField() [2/3]

G4UniformElectricField::G4UniformElectricField ( G4double  vField,
G4double  vTheta,
G4double  vPhi 
)

Definition at line 50 of file G4UniformElectricField.cc.

53{
54 if ( (vField<0) || (vTheta<0) || (vTheta>pi) || (vPhi<0) || (vPhi>twopi) )
55 {
56 G4Exception("G4UniformElectricField::G4UniformElectricField()",
57 "GeomField0002", FatalException, "Invalid parameters.");
58 }
59
60 fFieldComponents[0] = 0.0;
61 fFieldComponents[1] = 0.0;
62 fFieldComponents[2] = 0.0;
63 fFieldComponents[3] = vField*std::sin(vTheta)*std::cos(vPhi) ;
64 fFieldComponents[4] = vField*std::sin(vTheta)*std::sin(vPhi) ;
65 fFieldComponents[5] = vField*std::cos(vTheta) ;
66}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4UniformElectricField()

G4UniformElectricField::~G4UniformElectricField ( )
virtual

Definition at line 68 of file G4UniformElectricField.cc.

69{
70}

◆ G4UniformElectricField() [3/3]

G4UniformElectricField::G4UniformElectricField ( const G4UniformElectricField p)

Definition at line 72 of file G4UniformElectricField.cc.

74{
75 for (G4int i=0; i<6; i++)
76 fFieldComponents[i] = p.fFieldComponents[i];
77}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ GetFieldValue()

void G4UniformElectricField::GetFieldValue ( const G4double  pos[4],
G4double field 
) const
virtual

Implements G4ElectricField.

Definition at line 89 of file G4UniformElectricField.cc.

91{
92 fieldBandE[0]= 0.0;
93 fieldBandE[1]= 0.0;
94 fieldBandE[2]= 0.0;
95 fieldBandE[3]= fFieldComponents[3] ;
96 fieldBandE[4]= fFieldComponents[4] ;
97 fieldBandE[5]= fFieldComponents[5] ;
98}

◆ operator=()

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

Definition at line 80 of file G4UniformElectricField.cc.

81{
82 for (G4int i=0; i<6; i++)
83 fFieldComponents[i] = p.fFieldComponents[i];
84 return *this;
85}

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