CbmRoot
CbmFieldMap Class Reference

#include <CbmFieldMap.h>

Inheritance diagram for CbmFieldMap:
[legend]
Collaboration diagram for CbmFieldMap:
[legend]

Public Member Functions

 CbmFieldMap ()
 
 CbmFieldMap (const char *mapName, const char *fileType="R")
 
 CbmFieldMap (CbmFieldPar *fieldPar)
 
 CbmFieldMap (CbmFieldMapCreator *creator)
 
virtual ~CbmFieldMap ()
 
virtual void Init ()
 
virtual void Init (Int_t nX, Double_t xMin, Double_t xMax, Int_t nY, Double_t yMin, Double_t yMax, Int_t nZ, Double_t zMin, Double_t zMax, TArrayF *bx, TArrayF *by, TArrayF *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 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)
 
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 ReadAsciiFile2018 (const char *fileName)
 
void ReadRootFile (const char *fileName, const char *mapName)
 
void SetField (const CbmFieldMapData *data)
 
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. More...
 
Double_t fHc [2]
 Interpolated field (2-dim) More...
 
Double_t fBxOrigin
 Interpolated field (1-dim) More...
 
Double_t fByOrigin
 x-component of the field at the origin More...
 
Double_t fBzOrigin
 y-component of the field at the origin More...
 

Private Member Functions

 CbmFieldMap (const CbmFieldMap &)
 z-component of the field at the origin More...
 
CbmFieldMapoperator= (const CbmFieldMap &)
 

Detailed Description

Definition at line 34 of file CbmFieldMap.h.

Constructor & Destructor Documentation

◆ CbmFieldMap() [1/5]

CbmFieldMap::CbmFieldMap ( )

Default constructor

Definition at line 34 of file CbmFieldMap.cxx.

References fHa, fHb, fHc, and i.

Referenced by CbmFieldMapDistorted::CbmFieldMapDistorted().

◆ CbmFieldMap() [2/5]

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

Standard constructor

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

Definition at line 80 of file CbmFieldMap.cxx.

References fFileName, fHa, fHb, fHc, and i.

◆ CbmFieldMap() [3/5]

◆ CbmFieldMap() [4/5]

◆ ~CbmFieldMap()

CbmFieldMap::~CbmFieldMap ( )
virtual

Destructor

Definition at line 262 of file CbmFieldMap.cxx.

References fBx, fBy, and fBz.

◆ CbmFieldMap() [5/5]

CbmFieldMap::CbmFieldMap ( const CbmFieldMap )
private

z-component of the field at the origin

Member Function Documentation

◆ GetBx() [1/2]

TArrayF* CbmFieldMap::GetBx ( ) const
inline

Accessors to the field value arrays

Definition at line 158 of file CbmFieldMap.h.

References fBx.

Referenced by Init().

◆ GetBx() [2/2]

Double_t CbmFieldMap::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] @value Bx,By,Bz Field components [kG]

Reimplemented in CbmFieldMapDistorted, CbmBsField, CbmFieldMapSym2, CbmFieldMapSym3, and CbmFieldMapSym1.

Definition at line 353 of file CbmFieldMap.cxx.

References fBx, fHa, fNy, fNz, Interpolate(), IsInside(), x, and y.

◆ GetBy() [1/2]

TArrayF* CbmFieldMap::GetBy ( ) const
inline

Definition at line 159 of file CbmFieldMap.h.

References fBy.

Referenced by Init(), and CbmFieldMapDistorted::PlotBy().

◆ GetBy() [2/2]

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

Reimplemented in CbmFieldMapDistorted, CbmBsField, CbmFieldMapSym2, CbmFieldMapSym3, and CbmFieldMapSym1.

Definition at line 384 of file CbmFieldMap.cxx.

References fBy, fHa, fNy, fNz, Interpolate(), IsInside(), x, and y.

◆ GetBz() [1/2]

TArrayF* CbmFieldMap::GetBz ( ) const
inline

Definition at line 160 of file CbmFieldMap.h.

References fBz.

Referenced by Init().

◆ GetBz() [2/2]

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

Reimplemented in CbmFieldMapDistorted, CbmBsField, CbmFieldMapSym2, CbmFieldMapSym3, and CbmFieldMapSym1.

Definition at line 415 of file CbmFieldMap.cxx.

References fBz, fHa, fNy, fNz, Interpolate(), IsInside(), x, and y.

◆ GetFileName()

const char* CbmFieldMap::GetFileName ( )
inline

Accessor to field map file

Definition at line 164 of file CbmFieldMap.h.

References fFileName.

◆ GetNx()

Int_t CbmFieldMap::GetNx ( ) const
inline

Definition at line 142 of file CbmFieldMap.h.

References fNx.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetNy()

Int_t CbmFieldMap::GetNy ( ) const
inline

Definition at line 143 of file CbmFieldMap.h.

References fNy.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetNz()

Int_t CbmFieldMap::GetNz ( ) const
inline

Definition at line 144 of file CbmFieldMap.h.

References fNz.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetPositionX()

Double_t CbmFieldMap::GetPositionX ( ) const
inline

Accessor to field centre position in global system

Definition at line 148 of file CbmFieldMap.h.

References fPosX.

Referenced by CbmFieldMapDistorted::SetFromParent(), and CbmFieldPar::SetParameters().

◆ GetPositionY()

Double_t CbmFieldMap::GetPositionY ( ) const
inline

Definition at line 149 of file CbmFieldMap.h.

References fPosY.

Referenced by CbmFieldMapDistorted::SetFromParent(), and CbmFieldPar::SetParameters().

◆ GetPositionZ()

Double_t CbmFieldMap::GetPositionZ ( ) const
inline

Definition at line 150 of file CbmFieldMap.h.

References fPosZ.

Referenced by CbmFieldMapDistorted::SetFromParent(), and CbmFieldPar::SetParameters().

◆ GetScale()

Double_t CbmFieldMap::GetScale ( ) const
inline

Accessor to global scaling factor

Definition at line 154 of file CbmFieldMap.h.

References fScale.

Referenced by CbmFieldMapData::CbmFieldMapData(), CbmFieldMapDistorted::SetFromParent(), and CbmFieldPar::SetParameters().

◆ GetXmax()

Double_t CbmFieldMap::GetXmax ( ) const
inline

Definition at line 136 of file CbmFieldMap.h.

References fXmax.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetXmin()

Double_t CbmFieldMap::GetXmin ( ) const
inline

Accessors to field parameters in local coordinate system

Definition at line 133 of file CbmFieldMap.h.

References fXmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetXstep()

Double_t CbmFieldMap::GetXstep ( ) const
inline

Definition at line 139 of file CbmFieldMap.h.

References fXstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYmax()

Double_t CbmFieldMap::GetYmax ( ) const
inline

Definition at line 137 of file CbmFieldMap.h.

References fYmax.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYmin()

Double_t CbmFieldMap::GetYmin ( ) const
inline

Definition at line 134 of file CbmFieldMap.h.

References fYmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYstep()

Double_t CbmFieldMap::GetYstep ( ) const
inline

Definition at line 140 of file CbmFieldMap.h.

References fYstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZmax()

Double_t CbmFieldMap::GetZmax ( ) const
inline

Definition at line 138 of file CbmFieldMap.h.

References fZmax.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZmin()

Double_t CbmFieldMap::GetZmin ( ) const
inline

Definition at line 135 of file CbmFieldMap.h.

References fZmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZstep()

Double_t CbmFieldMap::GetZstep ( ) const
inline

Definition at line 141 of file CbmFieldMap.h.

References fZstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ Init() [1/2]

void CbmFieldMap::Init ( )
virtual

Initialisation (read map from file)

Reimplemented in CbmFieldMapDistorted, and CbmBsField.

Definition at line 271 of file CbmFieldMap.cxx.

References fBxOrigin, fByOrigin, fBzOrigin, fFileName, GetBx(), GetBy(), GetBz(), Print(), ReadAsciiFile(), and ReadRootFile().

◆ Init() [2/2]

void CbmFieldMap::Init ( Int_t  nX,
Double_t  xMin,
Double_t  xMax,
Int_t  nY,
Double_t  yMin,
Double_t  yMax,
Int_t  nZ,
Double_t  zMin,
Double_t  zMax,
TArrayF *  bx,
TArrayF *  by,
TArrayF *  bz 
)
virtual

Initialisation with arrays. To be used e.g.for reading from ASCII.

Parameters
xMinMinimum x coordinate
xMaxMaximum x coordinate
yMinMinimum y coordinate
yMaxMaximum y coordinate
zMinMinimum z coordinate
zMaxMaximum z coordinate
bxPointer to array with Bx values [T]
byPointer to array with By values [T]
bzPointer to array with Bz values [T]

Definition at line 293 of file CbmFieldMap.cxx.

References fBx, fBxOrigin, fBy, fByOrigin, fBz, fBzOrigin, fNx, fNy, fNz, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, GetBx(), GetBy(), GetBz(), Print(), and Reset().

◆ Interpolate()

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

Get field values by interpolation of the grid.

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

Definition at line 786 of file CbmFieldMap.cxx.

References fHa, fHb, and fHc.

Referenced by CbmFieldMapSym1::GetBx(), CbmFieldMapSym3::GetBx(), CbmFieldMapSym2::GetBx(), GetBx(), CbmFieldMapSym1::GetBy(), CbmFieldMapSym2::GetBy(), CbmFieldMapSym3::GetBy(), GetBy(), CbmFieldMapSym1::GetBz(), CbmFieldMapSym2::GetBz(), CbmFieldMapSym3::GetBz(), and GetBz().

◆ IsInside()

Bool_t CbmFieldMap::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 @value kTRUE if inside map, else kFALSE

Reimplemented in CbmFieldMapSym2, CbmFieldMapSym3, and CbmFieldMapSym1.

Definition at line 446 of file CbmFieldMap.cxx.

References fPosX, fPosY, fPosZ, fXmin, fXstep, fYmin, fYstep, fZmax, fZmin, fZstep, x, and y.

Referenced by GetBx(), GetBy(), and GetBz().

◆ operator=()

CbmFieldMap& CbmFieldMap::operator= ( const CbmFieldMap )
private

◆ Print()

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

Screen output

Reimplemented in CbmFieldMapDistorted.

Definition at line 558 of file CbmFieldMap.cxx.

References fBxOrigin, fByOrigin, fBzOrigin, fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, and fZstep.

Referenced by CbmBsField::CalculateMapFromBs(), and Init().

◆ ReadAsciiFile()

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

Read the field map from an ASCII file

Definition at line 615 of file CbmFieldMap.cxx.

References fBx, fBy, fBz, fNx, fNy, fNz, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, and fZstep.

Referenced by Init().

◆ ReadAsciiFile2018()

void CbmFieldMap::ReadAsciiFile2018 ( const char *  fileName)
protected

Read the field map from an ASCII file. Updated version.

◆ ReadRootFile()

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

Read field map from a ROOT file

Definition at line 698 of file CbmFieldMap.cxx.

References SetField().

Referenced by Init().

◆ Reset()

void CbmFieldMap::Reset ( )
protected

Reset the field parameters and data

Definition at line 591 of file CbmFieldMap.cxx.

References fBx, fBy, fBz, fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, and fZstep.

Referenced by Init().

◆ SetField()

◆ SetPosition()

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

Set the position of the field centre

Reimplemented in CbmFieldMapDistorted.

Definition at line 549 of file CbmFieldMap.cxx.

References fPosX, fPosY, fPosZ, x, and y.

Referenced by CbmSetup::CreateFieldMap().

◆ SetScale()

virtual void CbmFieldMap::SetScale ( Double_t  factor)
inlinevirtual

Set a global field scaling factor

Reimplemented in CbmFieldMapDistorted.

Definition at line 129 of file CbmFieldMap.h.

References fScale.

Referenced by CbmSetup::CreateFieldMap().

◆ WriteAsciiFile()

void CbmFieldMap::WriteAsciiFile ( const char *  fileName)

Write the field map to an ASCII file

Definition at line 486 of file CbmFieldMap.cxx.

References fBx, fBy, fBz, fNx, fNy, fNz, fScale, fXmax, fXmin, fYmax, fYmin, fZmax, and fZmin.

◆ WriteRootFile()

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

Write field map data to a ROOT file

Definition at line 536 of file CbmFieldMap.cxx.

Referenced by CbmFieldMapCreator::CreateMap().

Member Data Documentation

◆ fBx

◆ fBxOrigin

Double_t CbmFieldMap::fBxOrigin
protected

Interpolated field (1-dim)

Definition at line 230 of file CbmFieldMap.h.

Referenced by Init(), CbmFieldMapDistorted::Init(), CbmFieldMapDistorted::Print(), and Print().

◆ fBy

◆ fByOrigin

Double_t CbmFieldMap::fByOrigin
protected

x-component of the field at the origin

Definition at line 231 of file CbmFieldMap.h.

Referenced by Init(), CbmFieldMapDistorted::Init(), CbmFieldMapDistorted::Print(), and Print().

◆ fBz

◆ fBzOrigin

Double_t CbmFieldMap::fBzOrigin
protected

y-component of the field at the origin

Definition at line 232 of file CbmFieldMap.h.

Referenced by Init(), CbmFieldMapDistorted::Init(), CbmFieldMapDistorted::Print(), and Print().

◆ fFileName

TString CbmFieldMap::fFileName
protected

Map file name

Definition at line 197 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), GetFileName(), and Init().

◆ fHa

Double_t CbmFieldMap::fHa[2][2][2]
protected

◆ fHb

Double_t CbmFieldMap::fHb[2][2]
protected

Field at corners of a grid cell.

Definition at line 227 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), and Interpolate().

◆ fHc

Double_t CbmFieldMap::fHc[2]
protected

Interpolated field (2-dim)

Definition at line 228 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), and Interpolate().

◆ fNx

Int_t CbmFieldMap::fNx
protected

◆ fNy

◆ fNz

◆ fPosX

◆ fPosY

◆ fPosZ

◆ fScale

Double_t CbmFieldMap::fScale
protected

◆ fXmax

◆ fXmin

◆ fXstep

◆ fYmax

Double_t CbmFieldMap::fYmax
protected

◆ fYmin

◆ fYstep

◆ fZmax

◆ fZmin

◆ fZstep


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