EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BeastMagneticField.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BeastMagneticField.h
1 
2 #include <vector>
3 
4 #include <math.h>
5 
6 #ifndef _BEAST_MAGNETIC_FIELD_
7 #define _BEAST_MAGNETIC_FIELD_
8 
10 public:
11  BeastMagneticFieldCell(float r, float z, float br, float bz): mR(r), mZ(z), mBR(br), mBZ(bz) {};
13 
14  float mR, mZ, mBR, mBZ;
15 };
16 
18 public:
19  // Argument is the ASCII file name with the Elmer map;
20  BeastMagneticField(const char *fname, bool enforce_axial_symmetry = true);
22 
23  bool ValidMapImported( void ) const { return mFieldMap; };
24 
25  // Ignore the z-coordinate I guess?;
26  //bool IsInsideTheBore(double x, double y/*, double z*/) const;
27 
28  void UseInterpolation( void ) { mUseInterpolation = true; };
29  void SetScale(double scale) { mScale = scale; };
30  bool GetFieldValue(double x, double y, double z, double &bx, double &by, double &bz) const;
31  // Field has an axial symmetry -> provide a simplified call as well;
32  bool GetFieldValue(double r, double z, double &br, double &bz) const;
33 
34  private:
35  // Input map grid cell size; assume a square in {RZ}; may want to extract
36  // this value from the data later, so make it a variable;
37  double mCellSize;
38 
39  // Add some means to rescale the field internally; 1.0 per default;
40  double mScale;
41 
42  // Grid size in radial distance from the solenoid symmetry axis and
43  // along the symmetry axis;
44  unsigned mRdim, mZdim;
45 
46  // Map edge (min. radius and min. Z; well, mRmin should better be 0.0;
47  double mRmin, mZmin;
48 
49  // Default: no interpolation, return the grid values;
51  std::pair<double, double> *mFieldMap;
52 };
53 
54 #endif