2 #ifndef QweakSimMagneticField_h
3 #define QweakSimMagneticField_h
11 #include "G4String.hh"
12 #include "G4ThreeVector.hh"
13 #include "G4MagneticField.hh"
19 template <
class value_t,
unsigned int value_n>
46 void GetFieldValue(
const G4double point[4], G4double *field)
const;
55 G4cout <<
"Magnetic field scale factor is now: " <<
fScaleFactor << G4endl;
63 G4cout <<
"Magnetic field reference current is now: " <<
fReferenceCurrent << G4endl;
73 G4cout <<
"Magnetic field actual current is now: " <<
fActualCurrent << G4endl;
86 G4cout <<
"Magnetic field rotation is now: " <<
fRotation/degree <<
" degree" << G4endl;
94 G4cout <<
"Magnetic field translation is now: " <<
fTranslation/cm <<
" cm" << G4endl;
102 G4cout <<
"Magnetic field translation is now: " <<
fTranslationVector/cm <<
" cm" << G4endl;
111 G4cout <<
"Magnetic field grid min " << i <<
" is " <<
fMin.at(i) <<
" cm/radian" << G4endl;
116 G4cout <<
"Magnetic field grid max " << i <<
" is " <<
fMax.at(i) <<
" cm/radian" << G4endl;
119 void SetStep(
const double value,
const int i) {
121 G4cout <<
"Magnetic field grid step " << i <<
" is " <<
fStep.at(i) <<
" cm/radian" << G4endl;
126 G4cout <<
"Magnetic field grid wrap " << i <<
" is " <<
fWrap.at(i) << G4endl;
136 void TestFieldMap(
const G4double point[4],
const G4double exact[3])
const;
QweakSimFieldMap< value_t, value_n > * fField
void SetTranslationVector(const G4ThreeVector translationvector)
Set the field translation vector.
void SetTranslation(const double translation)
Set the field translation along z.
QweakSimMagneticFieldMessenger * fMagneticFieldMessenger
Messenger.
double GetActualCurrent() const
Get the actual current.
void ReadFieldMapText(const G4String &filename)
std::vector< size_t > fWrap
A multi-dimensional grid of values with interpolation methods.
void SetWrap(const int value, const int i)
Set the wrap.
void SetReferenceCurrent(const double referencecurrent)
Set the reference current.
std::vector< double > fMax
void ReadFieldMap(const G4String &filename)
Read the field map.
static const unsigned int value_n
Number of field component in the map (x,y,z,r,phi)
void GetFieldValue(const G4double point[4], G4double *field) const
Get the field value.
double GetRotation() const
Get the field rotation around z.
void ReadFieldMapBinary(const G4String &filename)
double GetScaleFactor() const
Get the scale factor.
virtual ~QweakSimMagneticField()
Virtual destructor.
void SetScaleFactor(const double scalefactor)
Set the scale factor.
double GetReferenceCurrent() const
Get the reference current.
void SetStep(const double value, const int i)
Set the step.
double fRotation
Field rotation and translation with respect to the z axis.
std::vector< double > fMin
Field map grid definitions.
QweakSimMagneticField()
Default constructor.
void SetRotation(const double rotation)
Set the field rotation around z.
double fScaleFactor
Field map reference and actual currents.
G4ThreeVector GetTranslationVector() const
Get the field translation vector.
double GetTranslation() const
Get the field translation along z.
void TestFieldMap(const G4double point[4], const G4double exact[3]) const
Test the field map.
std::vector< double > fStep
float value_t
Field map storage data type.
void SetMaximum(const double value, const int i)
Set the maximum.
Scans input file for /MagnetField/xyz commands.
void PrintFieldValue(const G4double point[4]) const
Print the field value.
G4ThreeVector fTranslationVector
void SetMinimum(const double value, const int i)
Set the minimum.
void SetActualCurrent(const double actualcurrent)
Set the actual current.