MpdConstField.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // -------------------------------------------------------------------------
  2. // MpdContField header file -----
  3. // Created 23/07/13 by P. Batyuk (MPD) <batyuk@jinr.ru> -----
  4. // from MpdContField (PNDROOT) -----
  5. // -------------------------------------------------------------------------
  6. #ifndef MPDCONSTFIELD_H
  7. #define MPDCONSTFIELD_H 1
  8. #include "FairField.h"
  9. class MpdConstPar;
  10. class MpdConstField : public FairField
  11. {
  12. public:
  13. /** Default constructor **/
  14. MpdConstField();
  15. /** Standard constructor
  16. ** @param name Object name
  17. ** @param xMin,xMax x region of field (global coordinates)
  18. ** @param yMin,yMax y region of field (global coordinates)
  19. ** @param zMin,zMax z region of field (global coordinates)
  20. ** @param bX,bY,bZ Field values [kG]
  21. **/
  22. MpdConstField(const char* name, Double_t xMin, Double_t xMax,
  23. Double_t yMin, Double_t yMax, Double_t zMin,
  24. Double_t zMax, Double_t bX, Double_t bY, Double_t bZ);
  25. /** Constructor from MpdFieldPar **/
  26. MpdConstField(MpdConstPar* fieldPar);
  27. /** Destructor **/
  28. virtual ~MpdConstField();
  29. /** Set the field region
  30. ** @param xMin,xMax x region of field (global coordinates)
  31. ** @param yMin,yMax y region of field (global coordinates)
  32. ** @param zMin,zMax z region of field (global coordinates)
  33. **/
  34. void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin,
  35. Double_t yMax, Double_t zMin, Double_t zMax);
  36. /** Set the field values
  37. ** @param bX,bY,bZ Field values [kG]
  38. **/
  39. void SetField(Double_t bX, Double_t bY, Double_t bZ);
  40. /** Get components of field at a given point
  41. ** @param x,y,z Point coordinates [cm]
  42. **/
  43. virtual Double_t GetBx(Double_t x, Double_t y, Double_t z);
  44. virtual Double_t GetBy(Double_t x, Double_t y, Double_t z);
  45. virtual Double_t GetBz(Double_t x, Double_t y, Double_t z);
  46. void GetFieldValue(const Double_t point[3], Double_t* bField) ;
  47. void GetBxyz(const Double_t point[3], Double_t* bField);
  48. /** Accessors to field region **/
  49. Double_t GetXmin() const { return fXmin; }
  50. Double_t GetXmax() const { return fXmax; }
  51. Double_t GetYmin() const { return fYmin; }
  52. Double_t GetYmax() const { return fYmax; }
  53. Double_t GetZmin() const { return fZmin; }
  54. Double_t GetZmax() const { return fZmax; }
  55. /** Accessors to field values **/
  56. Double_t GetBx() const { return fBx; }
  57. Double_t GetBy() const { return fBy; }
  58. Double_t GetBz() const { return fBz; }
  59. /** Screen output **/
  60. virtual void Print();
  61. ClassDef(MpdConstField, 1);
  62. private:
  63. /** Limits of the field region **/
  64. Double_t fXmin;
  65. Double_t fXmax;
  66. Double_t fYmin;
  67. Double_t fYmax;
  68. Double_t fZmin;
  69. Double_t fZmax;
  70. /** Field components inside the field region **/
  71. Double_t fBx;
  72. Double_t fBy;
  73. Double_t fBz;
  74. };
  75. #endif