#include <G4UniformMagField.hh>
Definition at line 49 of file G4UniformMagField.hh.
G4UniformMagField::G4UniformMagField |
( |
const G4ThreeVector & |
FieldVector | ) |
|
Definition at line 39 of file G4UniformMagField.cc.
41 fFieldComponents[0] = FieldVector.
x();
42 fFieldComponents[1] = FieldVector.
y();
43 fFieldComponents[2] = FieldVector.
z();
Definition at line 61 of file G4UniformMagField.cc.
65 if ( (vField<0) || (vTheta<0) || (vTheta>
pi) || (vPhi<0) || (vPhi>
twopi) )
67 std::ostringstream msg;
68 msg <<
"ERROR in G4UniformMagField::G4UniformMagField(double, double, double) : "
69 <<
"Invalid parameter(s). " << std::endl;
70 msg <<
" Expected " << std::endl;
72 msg <<
" - Magnitude vField: Value = " << vField
73 <<
" Expected vField > 0 " ;
74 if ( vField<0) { msg <<
" <------ Erroneous "; }
77 msg <<
" - Theta angle: Value = " << vTheta
78 <<
" Expected between 0 <= theta <= pi = " <<
pi <<
" ";
79 if ( (vTheta<0) || (vTheta>pi) ) { msg <<
" <------ Erroneous "; }
82 msg <<
" - Phi angle: Value = " << vPhi
83 <<
" Expected between 0 <= phi <= 2*pi = " <<
twopi << std::endl;
84 if ( (vPhi<0) || (vPhi>
twopi) ) { msg <<
" <------ Erroneous "; }
86 G4Exception(
"G4UniformMagField::G4UniformMagField()",
89 fFieldComponents[0] = vField*std::sin(vTheta)*std::cos(vPhi) ;
90 fFieldComponents[1] = vField*std::sin(vTheta)*std::sin(vPhi) ;
91 fFieldComponents[2] = vField*std::cos(vTheta) ;
static constexpr double twopi
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static constexpr double pi
G4UniformMagField::~G4UniformMagField |
( |
| ) |
|
|
virtual |
G4Field * G4UniformMagField::Clone |
( |
| ) |
const |
|
virtual |
Implements G4MagneticField.
Definition at line 120 of file G4UniformMagField.cc.
123 B[0]= fFieldComponents[0] ;
124 B[1]= fFieldComponents[1] ;
125 B[2]= fFieldComponents[2] ;
double B(double temperature)
Definition at line 107 of file G4UniformMagField.cc.
109 if (&p ==
this)
return *
this;
111 for (
G4int i=0; i<3; i++)
113 fFieldComponents[i] = p.fFieldComponents[i];
G4MagneticField & operator=(const G4MagneticField &p)
Definition at line 54 of file G4UniformMagField.cc.
56 fFieldComponents[0] = newFieldVector.x();
57 fFieldComponents[1] = newFieldVector.y();
58 fFieldComponents[2] = newFieldVector.z();
The documentation for this class was generated from the following files: