#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}
Referenced by Clone().
◆ 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 |
( |
| ) |
|
|
overridedefault |
◆ G4UniformElectricField() [3/3]
Definition at line 65 of file G4UniformElectricField.cc.
68{
69 for (auto i=0; i<6; ++i)
70 {
71 fFieldComponents[i] = p.fFieldComponents[i];
72 }
73}
◆ Clone()
G4Field * G4UniformElectricField::Clone |
( |
| ) |
const |
|
overridevirtual |
Reimplemented from G4Field.
Definition at line 87 of file G4UniformElectricField.cc.
88{
90 fFieldComponents[4],
91 fFieldComponents[5]));
92}
CLHEP::Hep3Vector G4ThreeVector
◆ GetFieldValue()
void G4UniformElectricField::GetFieldValue |
( |
const G4double | pos[4], |
|
|
G4double * | field ) const |
|
overridevirtual |
Implements G4ElectricField.
Definition at line 96 of file G4UniformElectricField.cc.
98{
99 fieldBandE[0] = 0.0;
100 fieldBandE[1] = 0.0;
101 fieldBandE[2] = 0.0;
102 fieldBandE[3] = fFieldComponents[3];
103 fieldBandE[4] = fFieldComponents[4];
104 fieldBandE[5] = fFieldComponents[5];
105}
◆ operator=()
Definition at line 76 of file G4UniformElectricField.cc.
77{
78 if (&p == this) { return *this; }
80 for (auto i=0; i<6; ++i)
81 {
82 fFieldComponents[i] = p.fFieldComponents[i];
83 }
84 return *this;
85}
G4ElectricField & operator=(const G4ElectricField &p)
The documentation for this class was generated from the following files: