ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHField3DCartesian.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHField3DCartesian.h
1 #ifndef PHFIELD_PHFIELD3DCARTESIAN_H
2 #define PHFIELD_PHFIELD3DCARTESIAN_H
3 
4 #include "PHField.h"
5 
6 #include <cmath>
7 #include <string>
8 
9 class PHField3DCartesian : public PHField
10 {
11  public:
12  PHField3DCartesian(const std::string &fname, const float magfield_rescale = 1.0);
13  ~PHField3DCartesian() override;
14 
19  void GetFieldValue(const double Point[4], double *Bfield) const override;
20 
21  private:
22  std::string filename;
23  double xmin = 1000000;
24  double xmax = -1000000;
25  double ymin = 1000000;
26  double ymax = -1000000;
27  double zmin = 1000000;
28  double zmax = -1000000;
29  double xstepsize = NAN;
30  double ystepsize = NAN;
31  double zstepsize = NAN;
32  // these are updated in a const method
33  // to cache previous values
34  mutable double xyz[2][2][2][3];
35  mutable double bf[2][2][2][3];
36  mutable double xkey_save = NAN;
37  mutable double ykey_save = NAN;
38  mutable double zkey_save = NAN;
39  mutable int cache_hits = 0;
40  mutable int cache_misses = 0;
41 };
42 
43 #endif