FairShip
Loading...
Searching...
No Matches
ShipConstField Class Reference

#include <ShipConstField.h>

Inheritance diagram for ShipConstField:
Collaboration diagram for ShipConstField:

Public Member Functions

 ShipConstField ()
 
 ShipConstField (const char *name, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Double_t bX, Double_t bY, Double_t bZ)
 
 ShipConstField (ShipFieldPar *fieldPar)
 
virtual ~ShipConstField ()
 
void SetFieldRegion (Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
 
void SetField (Double_t bX, Double_t bY, Double_t bZ)
 
virtual Double_t GetBx (Double_t x, Double_t y, Double_t z)
 
virtual Double_t GetBy (Double_t x, Double_t y, Double_t z)
 
virtual Double_t GetBz (Double_t x, Double_t y, Double_t z)
 
Double_t GetXmin () const
 
Double_t GetXmax () const
 
Double_t GetYmin () const
 
Double_t GetYmax () const
 
Double_t GetZmin () const
 
Double_t GetZmax () const
 
Double_t GetBx () const
 
Double_t GetBy () const
 
Double_t GetBz () const
 
virtual void Print ()
 

Private Member Functions

 ClassDef (ShipConstField, 1)
 

Private Attributes

Double_t fXmin
 
Double_t fXmax
 
Double_t fYmin
 
Double_t fYmax
 
Double_t fZmin
 
Double_t fZmax
 
Double_t fBx
 
Double_t fBy
 
Double_t fBz
 

Detailed Description

Definition at line 25 of file ShipConstField.h.

Constructor & Destructor Documentation

◆ ShipConstField() [1/3]

ShipConstField::ShipConstField ( )

Default constructor

Definition at line 23 of file ShipConstField.cxx.

24 : FairField(),
25 fXmin(0.),
26 fXmax(0.),
27 fYmin(0.),
28 fYmax(0.),
29 fZmin(0.),
30 fZmax(0.),
31 fBx(0.),
32 fBy(0.),
33 fBz(0.) {
34 fType = 0;
35}

◆ ShipConstField() [2/3]

ShipConstField::ShipConstField ( const char *  name,
Double_t  xMin,
Double_t  xMax,
Double_t  yMin,
Double_t  yMax,
Double_t  zMin,
Double_t  zMax,
Double_t  bX,
Double_t  bY,
Double_t  bZ 
)
explicit

Standard constructor

Parameters
nameObject name
xMin,xMaxx region of field (global coordinates)
yMin,yMaxy region of field (global coordinates)
zMin,zMaxz region of field (global coordinates)
bX,bY,bZField values [kG]

Definition at line 39 of file ShipConstField.cxx.

43 : FairField(name),
44 fXmin(xMin),
45 fXmax(xMax),
46 fYmin(yMin),
47 fYmax(yMax),
48 fZmin(zMin),
49 fZmax(zMax),
50 fBx(bX),
51 fBy(bY),
52 fBz(bZ) {
53 fType = 0;
54}

◆ ShipConstField() [3/3]

ShipConstField::ShipConstField ( ShipFieldPar fieldPar)
explicit

Constructor from ShipFieldPar

Definition at line 58 of file ShipConstField.cxx.

59 : FairField(),
60 fXmin(0.),
61 fXmax(0.),
62 fYmin(0.),
63 fYmax(0.),
64 fZmin(0.),
65 fZmax(0.),
66 fBx(0.),
67 fBy(0.),
68 fBz(0.) {
69 if (!fieldPar) {
70 cerr << "-W- ShipConstField::ShipConstField: empty parameter container!"
71 << endl;
72 fType = 0;
73 } else {
74 fXmin = fieldPar->GetXmin();
75 fXmax = fieldPar->GetXmax();
76 fYmin = fieldPar->GetYmin();
77 fYmax = fieldPar->GetYmax();
78 fZmin = fieldPar->GetZmin();
79 fZmax = fieldPar->GetZmax();
80 fBx = fieldPar->GetBx();
81 fBy = fieldPar->GetBy();
82 fBz = fieldPar->GetBz();
83 fType = fieldPar->GetType();
84 }
85}
Double_t GetZmax() const
Definition: ShipFieldPar.h:42
Double_t GetYmin() const
Definition: ShipFieldPar.h:39
Double_t GetYmax() const
Definition: ShipFieldPar.h:40
Double_t GetXmax() const
Definition: ShipFieldPar.h:38
Double_t GetBx() const
Definition: ShipFieldPar.h:43
Double_t GetBz() const
Definition: ShipFieldPar.h:45
Int_t GetType() const
Definition: ShipFieldPar.h:36
Double_t GetBy() const
Definition: ShipFieldPar.h:44
Double_t GetXmin() const
Definition: ShipFieldPar.h:37
Double_t GetZmin() const
Definition: ShipFieldPar.h:41

◆ ~ShipConstField()

ShipConstField::~ShipConstField ( )
virtual

Destructor

Definition at line 89 of file ShipConstField.cxx.

89{}

Member Function Documentation

◆ ClassDef()

ShipConstField::ClassDef ( ShipConstField  ,
 
)
private

◆ GetBx() [1/2]

Double_t ShipConstField::GetBx ( ) const
inline

Accessors to field values

Definition at line 76 of file ShipConstField.h.

76{ return fBx; }

◆ GetBx() [2/2]

Double_t ShipConstField::GetBx ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Get components of field at a given point

Parameters
x,y,zPoint coordinates [cm]

Definition at line 114 of file ShipConstField.cxx.

114 {
115 if (x < fXmin || x > fXmax || y < fYmin || y > fYmax || z < fZmin ||
116 z > fZmax)
117 return 0.;
118 return fBx;
119}

◆ GetBy() [1/2]

Double_t ShipConstField::GetBy ( ) const
inline

Definition at line 77 of file ShipConstField.h.

77{ return fBy; }

◆ GetBy() [2/2]

Double_t ShipConstField::GetBy ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Definition at line 123 of file ShipConstField.cxx.

123 {
124 if (x < fXmin || x > fXmax || y < fYmin || y > fYmax || z < fZmin ||
125 z > fZmax)
126 return 0.;
127 return fBy;
128}

◆ GetBz() [1/2]

Double_t ShipConstField::GetBz ( ) const
inline

Definition at line 78 of file ShipConstField.h.

78{ return fBz; }

◆ GetBz() [2/2]

Double_t ShipConstField::GetBz ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Definition at line 132 of file ShipConstField.cxx.

132 {
133 if (x < fXmin || x > fXmax || y < fYmin || y > fYmax || z < fZmin ||
134 z > fZmax)
135 return 0.;
136 return fBz;
137}

◆ GetXmax()

Double_t ShipConstField::GetXmax ( ) const
inline

Definition at line 69 of file ShipConstField.h.

69{ return fXmax; }

◆ GetXmin()

Double_t ShipConstField::GetXmin ( ) const
inline

Accessors to field region

Definition at line 68 of file ShipConstField.h.

68{ return fXmin; }

◆ GetYmax()

Double_t ShipConstField::GetYmax ( ) const
inline

Definition at line 71 of file ShipConstField.h.

71{ return fYmax; }

◆ GetYmin()

Double_t ShipConstField::GetYmin ( ) const
inline

Definition at line 70 of file ShipConstField.h.

70{ return fYmin; }

◆ GetZmax()

Double_t ShipConstField::GetZmax ( ) const
inline

Definition at line 73 of file ShipConstField.h.

73{ return fZmax; }

◆ GetZmin()

Double_t ShipConstField::GetZmin ( ) const
inline

Definition at line 72 of file ShipConstField.h.

72{ return fZmin; }

◆ Print()

void ShipConstField::Print ( )
virtual

Screen output

Definition at line 141 of file ShipConstField.cxx.

141 {
142 cout << "======================================================" << endl;
143 cout << "---- " << fTitle << " : " << fName << endl;
144 cout << "----" << endl;
145 cout << "---- Field type : constant" << endl;
146 cout << "----" << endl;
147 cout << "---- Field regions : " << endl;
148 cout << "---- x = " << setw(4) << fXmin << " to " << setw(4) << fXmax
149 << " cm" << endl;
150 cout << "---- y = " << setw(4) << fYmin << " to " << setw(4) << fYmax
151 << " cm" << endl;
152 cout << "---- z = " << setw(4) << fZmin << " to " << setw(4) << fZmax
153 << " cm" << endl;
154 cout.precision(4);
155 cout << "---- B = ( " << fBx << ", " << fBy << ", " << fBz << " ) kG"
156 << endl;
157 cout << "======================================================" << endl;
158}

◆ SetField()

void ShipConstField::SetField ( Double_t  bX,
Double_t  bY,
Double_t  bZ 
)

Set the field values

Parameters
bX,bY,bZField values [kG]

Definition at line 106 of file ShipConstField.cxx.

106 {
107 fBx = bX;
108 fBy = bY;
109 fBz = bZ;
110}

◆ SetFieldRegion()

void ShipConstField::SetFieldRegion ( Double_t  xMin,
Double_t  xMax,
Double_t  yMin,
Double_t  yMax,
Double_t  zMin,
Double_t  zMax 
)

Set the field region

Parameters
xMin,xMaxx region of field (global coordinates)
yMin,yMaxy region of field (global coordinates)
zMin,zMaxz region of field (global coordinates)

Definition at line 93 of file ShipConstField.cxx.

95 {
96 fXmin = xMin;
97 fXmax = xMax;
98 fYmin = yMin;
99 fYmax = yMax;
100 fZmin = zMin;
101 fZmax = zMax;
102}

Member Data Documentation

◆ fBx

Double_t ShipConstField::fBx
private

Field components inside the field region

Definition at line 93 of file ShipConstField.h.

◆ fBy

Double_t ShipConstField::fBy
private

Definition at line 94 of file ShipConstField.h.

◆ fBz

Double_t ShipConstField::fBz
private

Definition at line 95 of file ShipConstField.h.

◆ fXmax

Double_t ShipConstField::fXmax
private

Definition at line 86 of file ShipConstField.h.

◆ fXmin

Double_t ShipConstField::fXmin
private

Limits of the field region

Definition at line 85 of file ShipConstField.h.

◆ fYmax

Double_t ShipConstField::fYmax
private

Definition at line 88 of file ShipConstField.h.

◆ fYmin

Double_t ShipConstField::fYmin
private

Definition at line 87 of file ShipConstField.h.

◆ fZmax

Double_t ShipConstField::fZmax
private

Definition at line 90 of file ShipConstField.h.

◆ fZmin

Double_t ShipConstField::fZmin
private

Definition at line 89 of file ShipConstField.h.


The documentation for this class was generated from the following files: