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 {
17 class MapField3DRegular : public G4MagneticField {
18 public:
19 // Constructor
20 explicit MapField3DRegular(const std::vector<double>& bX,
21 const std::vector<double>& bY,
22 const std::vector<double>& bZ,
23 const std::vector<double>& posX,
24 const std::vector<double>& posY,
25 const std::vector<double>& posZ);
26 // Destructor
27 virtual ~MapField3DRegular() {}
28
32 virtual void GetFieldValue(const G4double point[4], double* bField) const final;
33
34 private:
36 std::vector<std::vector<std::vector<double>>> m_fieldX;
38 std::vector<std::vector<std::vector<double>>> m_fieldY;
40 std::vector<std::vector<std::vector<double>>> m_fieldZ;
48 size_t m_nX, m_nY, m_nZ;
49 };
50}
51#endif /* SIMG4COMMON_MAPFIELD3DREGULAR_H */
Magnetic field from the field map.
Definition MapField3DRegular.h:17
virtual ~MapField3DRegular()
Definition MapField3DRegular.h:27
std::vector< std::vector< std::vector< double > > > m_fieldY
By component of the field.
Definition MapField3DRegular.h:38
double m_maxY
Definition MapField3DRegular.h:44
std::vector< std::vector< std::vector< double > > > m_fieldX
Bx component of the field.
Definition MapField3DRegular.h:36
double m_minX
Extend of the field in x direction.
Definition MapField3DRegular.h:42
size_t m_nX
Number of datapoints in every direction.
Definition MapField3DRegular.h:48
size_t m_nZ
Definition MapField3DRegular.h:48
double m_widthX
Definition MapField3DRegular.h:42
double m_minY
Extend of the field in y direction.
Definition MapField3DRegular.h:44
double m_maxZ
Definition MapField3DRegular.h:46
double m_widthY
Definition MapField3DRegular.h:44
double m_minZ
Extend of the field in z direction.
Definition MapField3DRegular.h:46
double m_widthZ
Definition MapField3DRegular.h:46
std::vector< std::vector< std::vector< double > > > m_fieldZ
Bz component of the field.
Definition MapField3DRegular.h:40
virtual void GetFieldValue(const G4double point[4], double *bField) const final
Get the value of the magnetic field value at position.
Definition MapField3DRegular.cpp:124
size_t m_nY
Definition MapField3DRegular.h:48
double m_maxX
Definition MapField3DRegular.h:42
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:17
Conversion between units.
Definition ConstantField.h:14