SND@LHC Software
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 26 of file ShipConstField.h.

Constructor & Destructor Documentation

◆ ShipConstField() [1/3]

ShipConstField::ShipConstField ( )

Default constructor

Definition at line 20 of file ShipConstField.cxx.

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

◆ 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 
)

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.

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

◆ ShipConstField() [3/3]

ShipConstField::ShipConstField ( ShipFieldPar fieldPar)

Constructor from ShipFieldPar

Definition at line 62 of file ShipConstField.cxx.

63 : FairField(),
64 fXmin(0.),
65 fXmax(0.),
66 fYmin(0.),
67 fYmax(0.),
68 fZmin(0.),
69 fZmax(0.),
70 fBx(0.),
71 fBy(0.),
72 fBz(0.)
73{
74 if ( ! fieldPar ) {
75 cerr << "-W- ShipConstField::ShipConstField: empty parameter container!"
76 << endl;
77 fType=0;
78 }
79 else {
80 fXmin = fieldPar->GetXmin();
81 fXmax = fieldPar->GetXmax();
82 fYmin = fieldPar->GetYmin();
83 fYmax = fieldPar->GetYmax();
84 fZmin = fieldPar->GetZmin();
85 fZmax = fieldPar->GetZmax();
86 fBx = fieldPar->GetBx();
87 fBy = fieldPar->GetBy();
88 fBz = fieldPar->GetBz();
89 fType = fieldPar->GetType();
90 }
91}
Double_t GetZmax() const
Double_t GetYmin() const
Double_t GetYmax() const
Double_t GetXmax() const
Double_t GetBx() const
Double_t GetBz() const
Int_t GetType() const
Double_t GetBy() const
Double_t GetXmin() const
Double_t GetZmin() const

◆ ~ShipConstField()

ShipConstField::~ShipConstField ( )
virtual

Destructor

Definition at line 97 of file ShipConstField.cxx.

97{ }

Member Function Documentation

◆ ClassDef()

ShipConstField::ClassDef ( ShipConstField  ,
 
)
private

◆ GetBx() [1/2]

Double_t ShipConstField::GetBx ( ) const
inline

Accessors to field values

Definition at line 88 of file ShipConstField.h.

88{ 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 128 of file ShipConstField.cxx.

128 {
129 if ( x < fXmin || x > fXmax ||
130 y < fYmin || y > fYmax ||
131 z < fZmin || z > fZmax ) return 0.;
132 return fBx;
133}

◆ GetBy() [1/2]

Double_t ShipConstField::GetBy ( ) const
inline

Definition at line 89 of file ShipConstField.h.

89{ return fBy; }

◆ GetBy() [2/2]

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

Definition at line 139 of file ShipConstField.cxx.

139 {
140 if ( x < fXmin || x > fXmax ||
141 y < fYmin || y > fYmax ||
142 z < fZmin || z > fZmax ) return 0.;
143 return fBy;
144}

◆ GetBz() [1/2]

Double_t ShipConstField::GetBz ( ) const
inline

Definition at line 90 of file ShipConstField.h.

90{ return fBz; }

◆ GetBz() [2/2]

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

Definition at line 150 of file ShipConstField.cxx.

150 {
151 if ( x < fXmin || x > fXmax ||
152 y < fYmin || y > fYmax ||
153 z < fZmin || z > fZmax ) return 0.;
154 return fBz;
155}

◆ GetXmax()

Double_t ShipConstField::GetXmax ( ) const
inline

Definition at line 80 of file ShipConstField.h.

80{ return fXmax; }

◆ GetXmin()

Double_t ShipConstField::GetXmin ( ) const
inline

Accessors to field region

Definition at line 79 of file ShipConstField.h.

79{ return fXmin; }

◆ GetYmax()

Double_t ShipConstField::GetYmax ( ) const
inline

Definition at line 82 of file ShipConstField.h.

82{ return fYmax; }

◆ GetYmin()

Double_t ShipConstField::GetYmin ( ) const
inline

Definition at line 81 of file ShipConstField.h.

81{ return fYmin; }

◆ GetZmax()

Double_t ShipConstField::GetZmax ( ) const
inline

Definition at line 84 of file ShipConstField.h.

84{ return fZmax; }

◆ GetZmin()

Double_t ShipConstField::GetZmin ( ) const
inline

Definition at line 83 of file ShipConstField.h.

83{ return fZmin; }

◆ Print()

void ShipConstField::Print ( )
virtual

Screen output

Definition at line 161 of file ShipConstField.cxx.

161 {
162 cout << "======================================================" << endl;
163 cout << "---- " << fTitle << " : " << fName << endl;
164 cout << "----" << endl;
165 cout << "---- Field type : constant" << endl;
166 cout << "----" << endl;
167 cout << "---- Field regions : " << endl;
168 cout << "---- x = " << setw(4) << fXmin << " to " << setw(4)
169 << fXmax << " cm" << endl;
170 cout << "---- y = " << setw(4) << fYmin << " to " << setw(4)
171 << fYmax << " cm" << endl;
172 cout << "---- z = " << setw(4) << fZmin << " to " << setw(4)
173 << fZmax << " cm" << endl;
174 cout.precision(4);
175 cout << "---- B = ( " << fBx << ", " << fBy << ", " << fBz << " ) kG"
176 << endl;
177 cout << "======================================================" << endl;
178}

◆ 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 118 of file ShipConstField.cxx.

118 {
119 fBx = bX;
120 fBy = bY;
121 fBz = bZ;
122}

◆ 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 103 of file ShipConstField.cxx.

105 {
106 fXmin = xMin;
107 fXmax = xMax;
108 fYmin = yMin;
109 fYmax = yMax;
110 fZmin = zMin;
111 fZmax = zMax;
112}

Member Data Documentation

◆ fBx

Double_t ShipConstField::fBx
private

Field components inside the field region

Definition at line 108 of file ShipConstField.h.

◆ fBy

Double_t ShipConstField::fBy
private

Definition at line 109 of file ShipConstField.h.

◆ fBz

Double_t ShipConstField::fBz
private

Definition at line 110 of file ShipConstField.h.

◆ fXmax

Double_t ShipConstField::fXmax
private

Definition at line 101 of file ShipConstField.h.

◆ fXmin

Double_t ShipConstField::fXmin
private

Limits of the field region

Definition at line 100 of file ShipConstField.h.

◆ fYmax

Double_t ShipConstField::fYmax
private

Definition at line 103 of file ShipConstField.h.

◆ fYmin

Double_t ShipConstField::fYmin
private

Definition at line 102 of file ShipConstField.h.

◆ fZmax

Double_t ShipConstField::fZmax
private

Definition at line 105 of file ShipConstField.h.

◆ fZmin

Double_t ShipConstField::fZmin
private

Definition at line 104 of file ShipConstField.h.


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