k4SimGeant4
Loading...
Searching...
No Matches
MapField2DRegular.h
Go to the documentation of this file.
1#ifndef SIMG4COMMON_MAPFIELD2DREGULAR_H
2#define SIMG4COMMON_MAPFIELD2DREGULAR_H
3
4// Geant 4
5#include "G4MagneticField.hh"
6#include <vector>
7
16namespace sim {
17 class MapField2DRegular : public G4MagneticField {
18 public:
19 // Constructor
20 explicit MapField2DRegular(const std::vector<double>& bR,
21 const std::vector<double>& bZ,
22 const std::vector<double>& posR,
23 const std::vector<double>& posZ);
24 // Destructor
25 virtual ~MapField2DRegular() {}
26
30 virtual void GetFieldValue(const G4double point[4], double* bField) const final;
31
32 private:
34 std::vector<std::vector<double>> m_fieldR;
36 std::vector<std::vector<double>> m_fieldZ;
42 size_t m_nR, m_nZ;
43 };
44}
45
46#endif /* SIMG4COMMON_MAPFIELD2DREGULAR_H */
Magnetic field from the COMSOL field map.
Definition MapField2DRegular.h:17
virtual void GetFieldValue(const G4double point[4], double *bField) const final
Get the value of the magnetic field value at position.
Definition MapField2DRegular.cpp:93
size_t m_nZ
Definition MapField2DRegular.h:42
double m_maxR
Definition MapField2DRegular.h:38
size_t m_nR
Number of datapoints in every direction.
Definition MapField2DRegular.h:42
std::vector< std::vector< double > > m_fieldR
Br component of the field.
Definition MapField2DRegular.h:34
virtual ~MapField2DRegular()
Definition MapField2DRegular.h:25
double m_widthR
Definition MapField2DRegular.h:38
double m_widthZ
Definition MapField2DRegular.h:40
double m_maxZ
Definition MapField2DRegular.h:40
double m_minR
Extend of the field in r direction.
Definition MapField2DRegular.h:38
std::vector< std::vector< double > > m_fieldZ
Bz component of the field.
Definition MapField2DRegular.h:36
MapField2DRegular(const std::vector< double > &bR, const std::vector< double > &bZ, const std::vector< double > &posR, const std::vector< double > &posZ)
Definition MapField2DRegular.cpp:17
double m_minZ
Extend of the field in z direction.
Definition MapField2DRegular.h:40
Conversion between units.
Definition ConstantField.h:14