k4SimGeant4
Loading...
Searching...
No Matches
MapField3DRegular.h
Go to the documentation of this file.
1#ifndef SIMG4COMMON_MAPFIELD3DREGULAR_H
2#define SIMG4COMMON_MAPFIELD3DREGULAR_H
3
4// Geant 4
5#include "G4MagneticField.hh"
6#include <vector>
7
16namespace sim {
17class MapField3DRegular : public G4MagneticField {
18public:
19 // Constructor
20 explicit MapField3DRegular(const std::vector<double>& bX, const std::vector<double>& bY,
21 const std::vector<double>& bZ, const std::vector<double>& posX,
22 const std::vector<double>& posY, const std::vector<double>& posZ);
23 // Destructor
24 virtual ~MapField3DRegular() {}
25
29 virtual void GetFieldValue(const G4double point[4], double* bField) const final;
30
31private:
33 std::vector<std::vector<std::vector<double>>> m_fieldX;
35 std::vector<std::vector<std::vector<double>>> m_fieldY;
37 std::vector<std::vector<std::vector<double>>> m_fieldZ;
45 size_t m_nX, m_nY, m_nZ;
46};
47} // namespace sim
48#endif /* SIMG4COMMON_MAPFIELD3DREGULAR_H */
Magnetic field from the field map.
Definition MapField3DRegular.h:17
virtual ~MapField3DRegular()
Definition MapField3DRegular.h:24
std::vector< std::vector< std::vector< double > > > m_fieldY
By component of the field.
Definition MapField3DRegular.h:35
double m_maxY
Definition MapField3DRegular.h:41
std::vector< std::vector< std::vector< double > > > m_fieldX
Bx component of the field.
Definition MapField3DRegular.h:33
double m_minX
Extend of the field in x direction.
Definition MapField3DRegular.h:39
size_t m_nX
Number of datapoints in every direction.
Definition MapField3DRegular.h:45
size_t m_nZ
Definition MapField3DRegular.h:45
double m_widthX
Definition MapField3DRegular.h:39
double m_minY
Extend of the field in y direction.
Definition MapField3DRegular.h:41
double m_maxZ
Definition MapField3DRegular.h:43
double m_widthY
Definition MapField3DRegular.h:41
double m_minZ
Extend of the field in z direction.
Definition MapField3DRegular.h:43
double m_widthZ
Definition MapField3DRegular.h:43
std::vector< std::vector< std::vector< double > > > m_fieldZ
Bz component of the field.
Definition MapField3DRegular.h:37
virtual void GetFieldValue(const G4double point[4], double *bField) const final
Get the value of the magnetic field value at position.
Definition MapField3DRegular.cpp:120
size_t m_nY
Definition MapField3DRegular.h:45
double m_maxX
Definition MapField3DRegular.h:39
MapField3DRegular(const std::vector< double > &bX, const std::vector< double > &bY, const std::vector< double > &bZ, const std::vector< double > &posX, const std::vector< double > &posY, const std::vector< double > &posZ)
Definition MapField3DRegular.cpp:16
Conversion between units.
Definition ConstantField.h:14