#include <G4UniformElectricField.hh>
Definition at line 41 of file G4UniformElectricField.hh.
◆ G4UniformElectricField() [1/3]
G4UniformElectricField::G4UniformElectricField |
( |
const G4ThreeVector & |
FieldVector | ) |
|
Definition at line 34 of file G4UniformElectricField.cc.
36{
37 fFieldComponents[0] = 0.0;
38 fFieldComponents[1] = 0.0;
39 fFieldComponents[2] = 0.0;
40 fFieldComponents[3] = FieldVector.
x();
41 fFieldComponents[4] = FieldVector.
y();
42 fFieldComponents[5] = FieldVector.
z();
43}
◆ G4UniformElectricField() [2/3]
Definition at line 45 of file G4UniformElectricField.cc.
48{
49 if ( (vField<0) || (vTheta<0) || (vTheta>pi) || (vPhi<0) || (vPhi>twopi) )
50 {
51 G4Exception(
"G4UniformElectricField::G4UniformElectricField()",
53 }
54
55 fFieldComponents[0] = 0.0;
56 fFieldComponents[1] = 0.0;
57 fFieldComponents[2] = 0.0;
58 fFieldComponents[3] = vField*std::sin(vTheta)*std::cos(vPhi) ;
59 fFieldComponents[4] = vField*std::sin(vTheta)*std::sin(vPhi) ;
60 fFieldComponents[5] = vField*std::cos(vTheta) ;
61}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
◆ ~G4UniformElectricField()
G4UniformElectricField::~G4UniformElectricField |
( |
| ) |
|
|
virtual |
◆ G4UniformElectricField() [3/3]
Definition at line 67 of file G4UniformElectricField.cc.
70{
71 for (auto i=0; i<6; ++i)
72 {
73 fFieldComponents[i] = p.fFieldComponents[i];
74 }
75}
◆ Clone()
G4Field * G4UniformElectricField::Clone |
( |
| ) |
const |
|
virtual |
Reimplemented from G4Field.
Definition at line 89 of file G4UniformElectricField.cc.
90{
92 fFieldComponents[4],
93 fFieldComponents[5]));
94}
CLHEP::Hep3Vector G4ThreeVector
◆ GetFieldValue()
void G4UniformElectricField::GetFieldValue |
( |
const G4double |
pos[4], |
|
|
G4double * |
field |
|
) |
| const |
|
virtual |
Implements G4ElectricField.
Definition at line 98 of file G4UniformElectricField.cc.
100{
101 fieldBandE[0] = 0.0;
102 fieldBandE[1] = 0.0;
103 fieldBandE[2] = 0.0;
104 fieldBandE[3] = fFieldComponents[3];
105 fieldBandE[4] = fFieldComponents[4];
106 fieldBandE[5] = fFieldComponents[5];
107}
◆ operator=()
Definition at line 78 of file G4UniformElectricField.cc.
79{
80 if (&p == this) return *this;
82 for (auto i=0; i<6; ++i)
83 {
84 fFieldComponents[i] = p.fFieldComponents[i];
85 }
86 return *this;
87}
G4ElectricField & operator=(const G4ElectricField &p)
The documentation for this class was generated from the following files: