er  dev
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ERFieldMap Class Reference
Inheritance diagram for ERFieldMap:
Inheritance graph
[legend]
Collaboration diagram for ERFieldMap:
Collaboration graph
[legend]

Public Member Functions

 ERFieldMap ()
 
 ERFieldMap (const char *mapName, const char *fileType="R")
 
 ERFieldMap (ERFieldPar *fieldPar)
 
virtual ~ERFieldMap ()
 
virtual void Init ()
 
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 Bool_t IsInside (Double_t x, Double_t y, Double_t z, Int_t &ix, Int_t &iy, Int_t &iz, Double_t &dx, Double_t &dy, Double_t &dz)
 
void WriteAsciiFile (const char *fileName)
 
void WriteRootFile (const char *fileName, const char *mapName)
 
virtual void SetPosition (Double_t x, Double_t y, Double_t z)
 
void SetVolume (TString localMagFieldVolName)
 
virtual void SetScale (Double_t factor)
 
Double_t GetXmin () const
 
Double_t GetYmin () const
 
Double_t GetZmin () const
 
Double_t GetXmax () const
 
Double_t GetYmax () const
 
Double_t GetZmax () const
 
Double_t GetXstep () const
 
Double_t GetYstep () const
 
Double_t GetZstep () const
 
Int_t GetNx () const
 
Int_t GetNy () const
 
Int_t GetNz () const
 
Double_t GetPositionX () const
 
Double_t GetPositionY () const
 
Double_t GetPositionZ () const
 
Double_t GetScale () const
 
TArrayF * GetBx () const
 
TArrayF * GetBy () const
 
TArrayF * GetBz () const
 
const char * GetFileName ()
 
virtual void Print (Option_t *="") const
 

Protected Member Functions

void Reset ()
 
void ReadAsciiFile (const char *fileName)
 
void ReadRootFile (const char *fileName, const char *mapName)
 
Double_t Interpolate (Double_t dx, Double_t dy, Double_t dz)
 

Protected Attributes

TString fFileName
 
Double_t fScale
 
Double_t fPosX
 
Double_t fPosY
 
Double_t fPosZ
 
Double_t fXmin
 
Double_t fXmax
 
Double_t fXstep
 
Double_t fYmin
 
Double_t fYmax
 
Double_t fYstep
 
Double_t fZmin
 
Double_t fZmax
 
Double_t fZstep
 
Int_t fNx
 
Int_t fNy
 
Int_t fNz
 
TArrayF * fBx
 
TArrayF * fBy
 
TArrayF * fBz
 
Double_t fHa [2][2][2]
 
Double_t fHb [2][2]
 Field at corners of a grid cell.
 
Double_t fHc [2]
 Interpolated field (2-dim)
 
Double_t fBxOrigin
 Interpolated field (1-dim)
 
Double_t fByOrigin
 x-component of the field at the origin
 
Double_t fBzOrigin
 y-component of the field at the origin
 
TGeoNode * fLocalMagFieldNode
 z-component of the field at the origin
 
TString fLocalMagFieldVolName
 

Private Member Functions

 ERFieldMap (const ERFieldMap &)
 
ERFieldMapoperator= (const ERFieldMap &)
 

Detailed Description

Definition at line 21 of file ERFieldMap.h.

Constructor & Destructor Documentation

ERFieldMap::ERFieldMap ( )

Default constructor

Definition at line 26 of file ERFieldMap.cxx.

ERFieldMap::ERFieldMap ( const char *  mapName,
const char *  fileType = "R" 
)

Standard constructor

Parameters
nameName of field map
fileTypeR = ROOT file, A = ASCII

Definition at line 73 of file ERFieldMap.cxx.

ERFieldMap::ERFieldMap ( ERFieldPar fieldPar)

Constructor from ERFieldPar

Definition at line 128 of file ERFieldMap.cxx.

ERFieldMap::~ERFieldMap ( )
virtual

Destructor

Definition at line 189 of file ERFieldMap.cxx.

Member Function Documentation

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

Get the field components at a certain point

Parameters
x,y,zPoint coordinates (global) [cm] Bx,By,Bz Field components [kG]

Definition at line 240 of file ERFieldMap.cxx.

TArrayF* ERFieldMap::GetBx ( ) const
inline

Accessors to the field value arrays

Definition at line 85 of file ERFieldMap.h.

const char* ERFieldMap::GetFileName ( )
inline

Accessor to field map file

Definition at line 89 of file ERFieldMap.h.

Double_t ERFieldMap::GetPositionX ( ) const
inline

Accessor to field centre position in global system

Definition at line 79 of file ERFieldMap.h.

Double_t ERFieldMap::GetScale ( ) const
inline

Accessor to global scaling factor

Definition at line 83 of file ERFieldMap.h.

Double_t ERFieldMap::GetXmin ( ) const
inline

Accessors to field parameters in local coordinate system

Definition at line 66 of file ERFieldMap.h.

void ERFieldMap::Init ( )
virtual

Initialisation (read map from file)

Definition at line 196 of file ERFieldMap.cxx.

Double_t ERFieldMap::Interpolate ( Double_t  dx,
Double_t  dy,
Double_t  dz 
)
protected

Set field parameters and data Get field values by interpolation of the grid.

Parameters
dx,dy,dzRelative distance from grid point [cell units]

Definition at line 614 of file ERFieldMap.cxx.

Bool_t ERFieldMap::IsInside ( Double_t  x,
Double_t  y,
Double_t  z,
Int_t &  ix,
Int_t &  iy,
Int_t &  iz,
Double_t &  dx,
Double_t &  dy,
Double_t &  dz 
)
virtual

Determine whether a point is inside the field map

Parameters
x,y,zPoint coordinates (global) [cm]
ix,iy,iz(return) Grid cell
dx,dy,dz(return) Distance from grid point [cm] if inside kTRUE if inside map, else kFALSE

Definition at line 363 of file ERFieldMap.cxx.

void ERFieldMap::Print ( Option_t *  = "") const
virtual

Screen output

Definition at line 456 of file ERFieldMap.cxx.

void ERFieldMap::ReadAsciiFile ( const char *  fileName)
protected

Read the field map from an ASCII file

Definition at line 498 of file ERFieldMap.cxx.

void ERFieldMap::ReadRootFile ( const char *  fileName,
const char *  mapName 
)
protected

Read field map from a ROOT file

Definition at line 583 of file ERFieldMap.cxx.

void ERFieldMap::Reset ( )
protected

Reset the field parameters and data

Definition at line 485 of file ERFieldMap.cxx.

void ERFieldMap::SetPosition ( Double_t  x,
Double_t  y,
Double_t  z 
)
virtual

Set the position of the field centre

Definition at line 449 of file ERFieldMap.cxx.

virtual void ERFieldMap::SetScale ( Double_t  factor)
inlinevirtual

Set a global field scaling factor

Definition at line 64 of file ERFieldMap.h.

void ERFieldMap::WriteAsciiFile ( const char *  fileName)

Write the field map to an ASCII file

Definition at line 390 of file ERFieldMap.cxx.

void ERFieldMap::WriteRootFile ( const char *  fileName,
const char *  mapName 
)

Write field map data to a ROOT file

Definition at line 436 of file ERFieldMap.cxx.

Member Data Documentation

TArrayF* ERFieldMap::fBx
protected

Arrays with the field values

Definition at line 120 of file ERFieldMap.h.

TString ERFieldMap::fFileName
protected

Map file name

Definition at line 108 of file ERFieldMap.h.

Double_t ERFieldMap::fHa[2][2][2]
protected

Variables for temporary storage Used in the very frequently called method GetFieldValue

Definition at line 125 of file ERFieldMap.h.

Int_t ERFieldMap::fNx
protected

Number of grid points

Definition at line 118 of file ERFieldMap.h.

Double_t ERFieldMap::fPosX
protected

Field centre position in global coordinates

Definition at line 112 of file ERFieldMap.h.

Double_t ERFieldMap::fScale
protected

Global scaling factor (w.r.t. map on file)

Definition at line 110 of file ERFieldMap.h.

Double_t ERFieldMap::fXmin
protected

Field limits in local coordinate system

Definition at line 114 of file ERFieldMap.h.


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