FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
PndConstField Class Reference

#include <PndConstField.h>

Inheritance diagram for PndConstField:

Public Member Functions

 PndConstField ()
 
 PndConstField (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)
 
 PndConstField (PndConstPar *fieldPar)
 
virtual ~PndConstField ()
 
void FillParContainer ()
 
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)
 
virtual void GetBxyz (const Double_t point[3], Double_t *bField)
 
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 ()
 
 ClassDef (PndConstField, 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 19 of file PndConstField.h.

Constructor & Destructor Documentation

PndConstField::PndConstField ( )

Default constructor

Definition at line 22 of file PndConstField.cxx.

23 : fXmin(0),
24  fXmax(0),
25  fYmin(0),
26  fYmax(0),
27  fZmin(0),
28  fZmax(0),
29  fBx(0),
30  fBy(0),
31  fBz(0)
32 {
33  fType = 0;
34 }
Double_t fYmin
Double_t fXmax
Double_t fZmin
Double_t fXmin
Double_t fYmax
Double_t fZmax
PndConstField::PndConstField ( 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 40 of file PndConstField.cxx.

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

Constructor from PndFieldPar

Definition at line 64 of file PndConstField.cxx.

References fBx, fBy, fBz, fXmax, fXmin, fYmax, fYmin, fZmax, fZmin, PndConstPar::GetBx(), PndConstPar::GetBy(), PndConstPar::GetBz(), PndMapPar::GetType(), PndMapPar::GetXmax(), PndMapPar::GetXmin(), PndMapPar::GetYmax(), PndMapPar::GetYmin(), PndMapPar::GetZmax(), and PndMapPar::GetZmin().

65  : FairField(),
66  fXmin(0),
67  fXmax(0),
68  fYmin(0),
69  fYmax(0),
70  fZmin(0),
71  fZmax(0),
72  fBx(0),
73  fBy(0),
74  fBz(0)
75  {
76  if ( ! fieldPar ) {
77  cerr << "-W- PndConstField::PndConstField: empty parameter container!"<< endl;
78  fType= -1;
79  }
80  else {
81  fXmin = fieldPar->GetXmin();
82  fXmax = fieldPar->GetXmax();
83  fYmin = fieldPar->GetYmin();
84  fYmax = fieldPar->GetYmax();
85  fZmin = fieldPar->GetZmin();
86  fZmax = fieldPar->GetZmax();
87  fBx = fieldPar->GetBx();
88  fBy = fieldPar->GetBy();
89  fBz = fieldPar->GetBz();
90  fType = fieldPar->GetType();
91  }
92 }
Double_t GetYmin() const
Definition: PndMapPar.h:54
Double_t fYmin
Double_t GetXmax() const
Definition: PndMapPar.h:53
Double_t fXmax
Double_t GetZmin() const
Definition: PndMapPar.h:56
Double_t GetZmax() const
Definition: PndMapPar.h:57
Double_t fZmin
Double_t GetBy() const
Definition: PndConstPar.h:42
Double_t GetBx() const
Definition: PndConstPar.h:41
Double_t GetXmin() const
Definition: PndMapPar.h:52
Double_t fXmin
Double_t fYmax
Double_t GetYmax() const
Definition: PndMapPar.h:55
Double_t fZmax
Double_t GetBz() const
Definition: PndConstPar.h:43
Int_t GetType() const
Definition: PndMapPar.h:51
PndConstField::~PndConstField ( )
virtual

Destructor

Definition at line 98 of file PndConstField.cxx.

98 { }

Member Function Documentation

PndConstField::ClassDef ( PndConstField  ,
 
)
void PndConstField::FillParContainer ( )

Definition at line 196 of file PndConstField.cxx.

References fRun, Par, rtdb, PndConstPar::SetParameters(), and TString.

197 {
198  TString MapName=GetName();
199 // cout << "PndConstField::FillParContainer() " << endl;
200  FairRun *fRun=FairRun::Instance();
201  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
202  PndConstPar* Par = (PndConstPar*) rtdb->getContainer("PndConstPar");
203  Par->SetParameters(this);
204  Par->setInputVersion(fRun->GetRunId(),1);
205  Par->setChanged();
206 
207 }
FairRunAna * fRun
Definition: hit_dirc.C:58
void SetParameters(FairField *field)
Definition: PndConstPar.cxx:54
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
PndMultiFieldPar * Par
Definition: sim_emc_apd.C:115
Double_t PndConstField::GetBx ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Get X component of field at a given point

Parameters
x,y,zPoint coordinates [cm]

Definition at line 129 of file PndConstField.cxx.

References fBx, fXmax, fYmax, and fZmax.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

129  {
130  if ( x < fXmin || x > fXmax ||
131  y < fYmin || y > fYmax ||
132  z < fZmin || z > fZmax ) return 0.;
133  return fBx;
134 }
Double_t fXmax
Double_t fYmax
Double_t fZmax
Double_t PndConstField::GetBx ( ) const
inline

Accessors to field values

Definition at line 95 of file PndConstField.h.

References fBx.

95 { return fBx; }
void PndConstField::GetBxyz ( const Double_t  point[3],
Double_t bField 
)
virtual

Get all components of field at a given point

Parameters
x,y,zPoint coordinates [cm]

Definition at line 160 of file PndConstField.cxx.

References fBx, fBy, fBz, fXmax, fXmin, fYmax, fYmin, fZmax, and fZmin.

160  {
161  //This method is added for comatibility with the field maps and to be able to use a mixture of
162  // of maps and constant fields
163 
164 
165  if ( point [0] < fXmin || point [0] > fXmax ||
166  point [1] < fYmin || point [1] > fYmax ||
167  point [2] < fZmin || point [2] > fZmax ) {
168  bField[0]=0; bField[1]=0; bField[2]=0;
169  }
170  else{
171  bField[0]=fBx; bField[1]=fBy; bField[2]=fBz;
172  }
173 }
Double_t fYmin
Double_t fXmax
TClonesArray * point
Definition: anaLmdDigi.C:29
Double_t fZmin
Double_t fXmin
Double_t fYmax
Double_t fZmax
Double_t PndConstField::GetBy ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Get Y component of field at a given point

Parameters
x,y,zPoint coordinates [cm]

Definition at line 140 of file PndConstField.cxx.

References fBy, fXmax, fYmax, and fZmax.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

140  {
141  if ( x < fXmin || x > fXmax ||
142  y < fYmin || y > fYmax ||
143  z < fZmin || z > fZmax ) return 0.;
144  return fBy;
145 }
Double_t fXmax
Double_t fYmax
Double_t fZmax
Double_t PndConstField::GetBy ( ) const
inline

Definition at line 96 of file PndConstField.h.

References fBy.

96 { return fBy; }
Double_t PndConstField::GetBz ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Get Z component of field at a given point

Parameters
x,y,zPoint coordinates [cm]

Definition at line 151 of file PndConstField.cxx.

References fBz, fXmax, fYmax, and fZmax.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

151  {
152  if ( x < fXmin || x > fXmax ||
153  y < fYmin || y > fYmax ||
154  z < fZmin || z > fZmax ) return 0.;
155  return fBz;
156 }
Double_t fXmax
Double_t fYmax
Double_t fZmax
Double_t PndConstField::GetBz ( ) const
inline

Definition at line 97 of file PndConstField.h.

References fBz.

97 { return fBz; }
Double_t PndConstField::GetXmax ( ) const
inline

Definition at line 87 of file PndConstField.h.

References fXmax.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

87 { return fXmax; }
Double_t fXmax
Double_t PndConstField::GetXmin ( ) const
inline

Accessors to field region

Definition at line 86 of file PndConstField.h.

References fXmin.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

86 { return fXmin; }
Double_t fXmin
Double_t PndConstField::GetYmax ( ) const
inline

Definition at line 89 of file PndConstField.h.

References fYmax.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

89 { return fYmax; }
Double_t fYmax
Double_t PndConstField::GetYmin ( ) const
inline

Definition at line 88 of file PndConstField.h.

References fYmin.

Referenced by PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

88 { return fYmin; }
Double_t fYmin
Double_t PndConstField::GetZmax ( ) const
inline

Definition at line 91 of file PndConstField.h.

References fZmax.

Referenced by PndMultiField::Init(), PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

91 { return fZmax; }
Double_t fZmax
Double_t PndConstField::GetZmin ( ) const
inline

Definition at line 90 of file PndConstField.h.

References fZmin.

Referenced by PndMultiField::Init(), PndFieldPar::SetParameters(), and PndConstPar::SetParameters().

90 { return fZmin; }
Double_t fZmin
void PndConstField::Print ( )
virtual

Screen output

Definition at line 176 of file PndConstField.cxx.

References fBx, fBy, fBz, fXmax, fXmin, fYmax, fYmin, fZmax, and fZmin.

176  {
177  cout << "======================================================" << endl;
178  cout << "---- " << fTitle << " : " << fName << endl;
179  cout << "----" << endl;
180  cout << "---- Field type : constant" << endl;
181  cout << "----" << endl;
182  cout << "---- Field regions : " << endl;
183  cout << "---- x = " << setw(4) << fXmin << " to " << setw(4)
184  << fXmax << " cm" << endl;
185  cout << "---- y = " << setw(4) << fYmin << " to " << setw(4)
186  << fYmax << " cm" << endl;
187  cout << "---- z = " << setw(4) << fZmin << " to " << setw(4)
188  << fZmax << " cm" << endl;
189  cout.precision(4);
190  cout << "---- B = ( " << fBx << ", " << fBy << ", " << fBz << " ) kG"
191  << endl;
192  cout << "======================================================" << endl;
193 }
Double_t fYmin
Double_t fXmax
Double_t fZmin
Double_t fXmin
Double_t fYmax
Double_t fZmax
void PndConstField::SetField ( Double_t  bX,
Double_t  bY,
Double_t  bZ 
)

Set the field values

Parameters
bX,bY,bZField values [kG]

Definition at line 119 of file PndConstField.cxx.

References fBx, fBy, and fBz.

Referenced by run(), run_test(), runMC(), runMC_dpm(), runSimHF_GiB_DC(), sim_hypGe_extparameters_urqmd(), and sim_pid_runSimHF_GiB_DC().

119  {
120  fBx = bX;
121  fBy = bY;
122  fBz = bZ;
123 }
void PndConstField::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 104 of file PndConstField.cxx.

References fXmax, fXmin, fYmax, fYmin, fZmax, and fZmin.

Referenced by run(), run_test(), runMC(), runMC_dpm(), runSimHF_GiB_DC(), sim_hypGe_extparameters_urqmd(), and sim_pid_runSimHF_GiB_DC().

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

Member Data Documentation

Double_t PndConstField::fBx
private

Field components inside the field region

Definition at line 116 of file PndConstField.h.

Referenced by GetBx(), GetBxyz(), PndConstField(), Print(), and SetField().

Double_t PndConstField::fBy
private

Definition at line 117 of file PndConstField.h.

Referenced by GetBxyz(), GetBy(), PndConstField(), Print(), and SetField().

Double_t PndConstField::fBz
private

Definition at line 118 of file PndConstField.h.

Referenced by GetBxyz(), GetBz(), PndConstField(), Print(), and SetField().

Double_t PndConstField::fXmax
private

Definition at line 109 of file PndConstField.h.

Referenced by GetBx(), GetBxyz(), GetBy(), GetBz(), GetXmax(), PndConstField(), Print(), and SetFieldRegion().

Double_t PndConstField::fXmin
private

Limits of the field region

Definition at line 108 of file PndConstField.h.

Referenced by GetBxyz(), GetXmin(), PndConstField(), Print(), and SetFieldRegion().

Double_t PndConstField::fYmax
private

Definition at line 111 of file PndConstField.h.

Referenced by GetBx(), GetBxyz(), GetBy(), GetBz(), GetYmax(), PndConstField(), Print(), and SetFieldRegion().

Double_t PndConstField::fYmin
private

Definition at line 110 of file PndConstField.h.

Referenced by GetBxyz(), GetYmin(), PndConstField(), Print(), and SetFieldRegion().

Double_t PndConstField::fZmax
private

Definition at line 113 of file PndConstField.h.

Referenced by GetBx(), GetBxyz(), GetBy(), GetBz(), GetZmax(), PndConstField(), Print(), and SetFieldRegion().

Double_t PndConstField::fZmin
private

Definition at line 112 of file PndConstField.h.

Referenced by GetBxyz(), GetZmin(), PndConstField(), Print(), and SetFieldRegion().


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