LDMX Software
MagneticFieldMap3D.h
Go to the documentation of this file.
1
8#ifndef SIMCORE_MAGNETICFIELDMAP3D_H_
9#define SIMCORE_MAGNETICFIELDMAP3D_H_
10
11// Geant4
12#include "Framework/Logger.h"
13#include "G4MagneticField.hh"
14
15// STL
16#include <vector>
17using std::vector;
18
19namespace simcore {
20
63class MagneticFieldMap3D : public G4MagneticField {
64 public:
71 MagneticFieldMap3D(const char* filename, double xOffset, double yOffset,
72 double zOffset);
73
79 void GetFieldValue(const double point[4], double* bfield) const;
80
81 private:
82 /*
83 * Storage space for the table.
84 */
85 vector<vector<vector<double>>> x_field_;
86 vector<vector<vector<double>>> y_field_;
87 vector<vector<vector<double>>> z_field_;
88
89 /*
90 * The dimensions of the table.
91 */
92 int nx_, ny_, nz_;
93
94 /*
95 * The physical limits of the defined region.
96 */
97 double minx_, maxx_, miny_, maxy_, minz_, maxz_;
98
99 /*
100 * The physical extent of the defined region.
101 */
102 double dx_, dy_, dz_;
103
104 /*
105 * Offsets if field map is not in global coordinates
106 */
107 double x_offset_;
108 double y_offset_;
109 double z_offset_;
110
111 /*
112 * Flags for inverting dimensions.
113 */
114 bool invert_x_, invert_y_, invert_z_;
115
119 enableLogging("MagneticFieldMap3D")
120};
121
122} // namespace simcore
123// namespace
124
125#endif
A 3D B-field map defined as a grid of points with associated B-field values.
void GetFieldValue(const double point[4], double *bfield) const
Implementation of primary virtual method from G4MagneticField interface.
MagneticFieldMap3D(const char *filename, double xOffset, double yOffset, double zOffset)
Class constructor.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...