Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UniformElectricField Class Reference

#include <G4UniformElectricField.hh>

Inheritance diagram for G4UniformElectricField:
Collaboration 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
 
virtual G4FieldClone () const
 
- Public Member Functions inherited from G4ElectricField
 G4ElectricField ()
 
virtual ~G4ElectricField ()
 
 G4ElectricField (const G4ElectricField &r)
 
G4ElectricFieldoperator= (const G4ElectricField &p)
 
G4bool DoesFieldChangeEnergy () const
 
- Public Member Functions inherited from G4ElectroMagneticField
 G4ElectroMagneticField ()
 
virtual ~G4ElectroMagneticField ()
 
 G4ElectroMagneticField (const G4ElectroMagneticField &r)
 
G4ElectroMagneticFieldoperator= (const G4ElectroMagneticField &p)
 
- Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 

Detailed Description

Definition at line 47 of file G4UniformElectricField.hh.

Constructor & Destructor Documentation

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 x() const
double z() const
double y() const

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
static constexpr double twopi
Definition: G4SIunits.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static constexpr double pi
Definition: G4SIunits.hh:75

Here is the call graph for this function:

G4UniformElectricField::~G4UniformElectricField ( )
virtual

Definition at line 75 of file G4UniformElectricField.cc.

76 {
77 }
G4UniformElectricField::G4UniformElectricField ( const G4UniformElectricField p)

Definition at line 79 of file G4UniformElectricField.cc.

80  : G4ElectricField(p)
81 {
82  for (G4int i=0; i<6; i++)
83  {
84  fFieldComponents[i] = p.fFieldComponents[i];
85  }
86 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

G4Field * G4UniformElectricField::Clone ( ) const
virtual

Reimplemented from G4Field.

Definition at line 68 of file G4UniformElectricField.cc.

69 {
70  return new G4UniformElectricField( G4ThreeVector(fFieldComponents[3],
71  fFieldComponents[4],
72  fFieldComponents[5]) );
73 }
CLHEP::Hep3Vector G4ThreeVector
G4UniformElectricField(const G4ThreeVector FieldVector)

Here is the call graph for this function:

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

Implements G4ElectricField.

Definition at line 102 of file G4UniformElectricField.cc.

104 {
105  fieldBandE[0]= 0.0;
106  fieldBandE[1]= 0.0;
107  fieldBandE[2]= 0.0;
108  fieldBandE[3]= fFieldComponents[3] ;
109  fieldBandE[4]= fFieldComponents[4] ;
110  fieldBandE[5]= fFieldComponents[5] ;
111 }
G4UniformElectricField & G4UniformElectricField::operator= ( const G4UniformElectricField p)

Definition at line 89 of file G4UniformElectricField.cc.

90 {
91  if (&p == this) return *this;
93  for (G4int i=0; i<6; i++)
94  {
95  fFieldComponents[i] = p.fFieldComponents[i];
96  }
97  return *this;
98 }
int G4int
Definition: G4Types.hh:78
G4ElectricField & operator=(const G4ElectricField &p)

Here is the call graph for this function:


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