CbmRoot
Loading...
Searching...
No Matches
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.
 
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
 

Private Member Functions

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

Detailed Description

Definition at line 38 of file CbmFieldMap.h.

Constructor & Destructor Documentation

◆ CbmFieldMap() [1/5]

CbmFieldMap::CbmFieldMap ( )

Default constructor

Definition at line 39 of file CbmFieldMap.cxx.

References fHa, fHb, and fHc.

Referenced by CbmFieldMapDistorted::CbmFieldMapDistorted(), and 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 86 of file CbmFieldMap.cxx.

References fFileName, fHa, fHb, and fHc.

◆ CbmFieldMap() [3/5]

◆ CbmFieldMap() [4/5]

◆ ~CbmFieldMap()

CbmFieldMap::~CbmFieldMap ( )
virtual

Destructor

Definition at line 267 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 145 of file CbmFieldMap.h.

References fBx.

Referenced by Init(), and 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 CbmBsField, CbmFieldMapDistorted, CbmFieldMapSym1, CbmFieldMapSym2, and CbmFieldMapSym3.

Definition at line 348 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 146 of file CbmFieldMap.h.

References fBy.

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

◆ GetBy() [2/2]

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

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

Definition at line 380 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 147 of file CbmFieldMap.h.

References fBz.

Referenced by Init(), and Init().

◆ GetBz() [2/2]

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

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

Definition at line 412 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 151 of file CbmFieldMap.h.

References fFileName.

◆ GetNx()

Int_t CbmFieldMap::GetNx ( ) const
inline

Definition at line 129 of file CbmFieldMap.h.

References fNx.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetNy()

Int_t CbmFieldMap::GetNy ( ) const
inline

Definition at line 130 of file CbmFieldMap.h.

References fNy.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetNz()

Int_t CbmFieldMap::GetNz ( ) const
inline

Definition at line 131 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 135 of file CbmFieldMap.h.

References fPosX.

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

◆ GetPositionY()

Double_t CbmFieldMap::GetPositionY ( ) const
inline

Definition at line 136 of file CbmFieldMap.h.

References fPosY.

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

◆ GetPositionZ()

Double_t CbmFieldMap::GetPositionZ ( ) const
inline

Definition at line 137 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 141 of file CbmFieldMap.h.

References fScale.

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

◆ GetXmax()

Double_t CbmFieldMap::GetXmax ( ) const
inline

Definition at line 123 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 120 of file CbmFieldMap.h.

References fXmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetXstep()

Double_t CbmFieldMap::GetXstep ( ) const
inline

Definition at line 126 of file CbmFieldMap.h.

References fXstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYmax()

Double_t CbmFieldMap::GetYmax ( ) const
inline

Definition at line 124 of file CbmFieldMap.h.

References fYmax.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYmin()

Double_t CbmFieldMap::GetYmin ( ) const
inline

Definition at line 121 of file CbmFieldMap.h.

References fYmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetYstep()

Double_t CbmFieldMap::GetYstep ( ) const
inline

Definition at line 127 of file CbmFieldMap.h.

References fYstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZmax()

Double_t CbmFieldMap::GetZmax ( ) const
inline

Definition at line 125 of file CbmFieldMap.h.

References fZmax.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZmin()

Double_t CbmFieldMap::GetZmin ( ) const
inline

Definition at line 122 of file CbmFieldMap.h.

References fZmin.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ GetZstep()

Double_t CbmFieldMap::GetZstep ( ) const
inline

Definition at line 128 of file CbmFieldMap.h.

References fZstep.

Referenced by CbmFieldMapDistorted::SetFromParent().

◆ Init() [1/2]

void CbmFieldMap::Init ( )
virtual

Initialisation (read map from file)

Reimplemented in CbmBsField, and CbmFieldMapDistorted.

Definition at line 277 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 298 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 789 of file CbmFieldMap.cxx.

References fHa, fHb, and fHc.

Referenced by GetBx(), CbmFieldMapSym1::GetBx(), CbmFieldMapSym2::GetBx(), CbmFieldMapSym3::GetBx(), GetBy(), CbmFieldMapSym1::GetBy(), CbmFieldMapSym2::GetBy(), CbmFieldMapSym3::GetBy(), GetBz(), CbmFieldMapSym1::GetBz(), CbmFieldMapSym2::GetBz(), and CbmFieldMapSym3::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 CbmFieldMapSym1, CbmFieldMapSym2, and CbmFieldMapSym3.

Definition at line 444 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 557 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(), Init(), 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

Save old global file and folder pointer to avoid messing with FairRoot

Restore old global file and folder pointer to avoid messing with FairRoot

Definition at line 697 of file CbmFieldMap.cxx.

References SetField().

Referenced by Init().

◆ Reset()

void CbmFieldMap::Reset ( )
protected

Reset the field parameters and data

Definition at line 590 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 547 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 116 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 477 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

Save old global file and folder pointer to avoid messing with FairRoot

Restore old global file and folder pointer to avoid messing with FairRoot

Definition at line 526 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 217 of file CbmFieldMap.h.

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

◆ fBy

◆ fByOrigin

Double_t CbmFieldMap::fByOrigin
protected

x-component of the field at the origin

Definition at line 218 of file CbmFieldMap.h.

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

◆ fBz

◆ fBzOrigin

Double_t CbmFieldMap::fBzOrigin
protected

y-component of the field at the origin

Definition at line 219 of file CbmFieldMap.h.

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

◆ fFileName

TString CbmFieldMap::fFileName
protected

Map file name

Definition at line 184 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), 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 214 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), CbmFieldMap(), CbmFieldMap(), CbmFieldMap(), and Interpolate().

◆ fHc

Double_t CbmFieldMap::fHc[2]
protected

Interpolated field (2-dim)

Definition at line 215 of file CbmFieldMap.h.

Referenced by CbmFieldMap(), CbmFieldMap(), CbmFieldMap(), 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: