BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnFieldConst.h
Go to the documentation of this file.
1/** @author M.Al-Turany <m.al/turany@gsi.de>
2 ** @since 30.01.2007
3 ** @version1.0
4 ** A constant magnetic field
5 **/
6
7#ifndef BMNFIELDCONST_H
8#define BMNFIELDCONST_H 1
9
10#include "FairField.h" // for FairField
11
12#include <Rtypes.h> // for Double_t, etc
13
14class BmnFieldPar;
15
17{
18 public:
19 /** Default constructor **/
21
22 /** Standard constructor
23 ** @param name Object name
24 ** @param xMin,xMax x region of field (global coordinates)
25 ** @param yMin,yMax y region of field (global coordinates)
26 ** @param zMin,zMax z region of field (global coordinates)
27 ** @param bX,bY,bZ Field values [kG]
28 **/
29 BmnFieldConst(const char* name,
30 Double_t xMin,
31 Double_t xMax,
32 Double_t yMin,
33 Double_t yMax,
34 Double_t zMin,
35 Double_t zMax,
36 Double_t bX,
37 Double_t bY,
38 Double_t bZ);
39
40 /** Constructor from BmnFieldPar **/
41 BmnFieldConst(BmnFieldPar* fieldPar);
42
43 /** Destructor **/
44 virtual ~BmnFieldConst();
45
46 void FillParContainer();
47
48 /** Set the field region
49 ** @param xMin,xMax x region of field (global coordinates)
50 ** @param yMin,yMax y region of field (global coordinates)
51 ** @param zMin,zMax z region of field (global coordinates)
52 **/
53 void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax);
54
55 /** Set the field values
56 ** @param bX,bY,bZ Field values [kG]
57 **/
58 void SetField(Double_t bX, Double_t bY, Double_t bZ);
59
60 /** Turn magnetic field off **/
61 void SetFieldOff(Bool_t is_off = kTRUE) { fIsOff = is_off; }
62
63 /** Get components of field at a given point
64 ** @param x,y,z Point coordinates [cm]
65 **/
66 virtual Double_t GetBx(Double_t x, Double_t y, Double_t z);
67 virtual Double_t GetBy(Double_t x, Double_t y, Double_t z);
68 virtual Double_t GetBz(Double_t x, Double_t y, Double_t z);
69
70 /** Accessors to field region **/
71 Double_t GetXmin() const { return fXmin; }
72 Double_t GetXmax() const { return fXmax; }
73 Double_t GetYmin() const { return fYmin; }
74 Double_t GetYmax() const { return fYmax; }
75 Double_t GetZmin() const { return fZmin; }
76 Double_t GetZmax() const { return fZmax; }
77
78 /** Accessors to field values **/
79 Double_t GetBx() const { return fBx; }
80 Double_t GetBy() const { return fBy; }
81 Double_t GetBz() const { return fBz; }
82
83 /** Whether magnetic field is off **/
84 Bool_t IsFieldOff() const { return fIsOff; }
85
86 /** Screen output **/
87 virtual void Print(Option_t*) const;
88
90
91 private:
92 /** Limits of the field region **/
99
100 /** Field components inside the field region **/
104
105 /** Whether magnetic field is off **/
107};
108
109#endif
bool Bool_t
double Double_t
constexpr Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
Double_t GetZmin() const
Double_t fXmin
Limits of the field region.
Double_t GetYmin() const
void SetField(Double_t bX, Double_t bY, Double_t bZ)
Set the field values.
Bool_t IsFieldOff() const
Whether magnetic field is off.
virtual ~BmnFieldConst()
Destructor.
Double_t GetZmax() const
Bool_t fIsOff
Whether magnetic field is off.
Double_t GetYmax() const
Double_t GetXmin() const
Accessors to field region.
virtual void Print(Option_t *) const
Screen output.
void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Set the field region.
Double_t GetBy() const
Double_t GetBz() const
Double_t fBx
Field components inside the field region.
Double_t GetBx() const
Accessors to field values.
void SetFieldOff(Bool_t is_off=kTRUE)
Turn magnetic field off.
Double_t GetXmax() const
BmnFieldConst()
Default constructor.