BmnRoot 26.10.0-233-gb9bbe585
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnFieldMap Class Referenceabstract

#include <BmnFieldMap.h>

Inheritance diagram for BmnFieldMap:
Collaboration diagram for BmnFieldMap:

Public Member Functions

 BmnFieldMap ()
 BmnFieldMap (const char *mapFileName)
 BmnFieldMap (BmnFieldPar *fieldPar)
virtual ~BmnFieldMap ()
virtual void Init ()
virtual Double_t GetBx (Double_t x, Double_t y, Double_t z)=0
virtual Double_t GetBy (Double_t x, Double_t y, Double_t z)=0
virtual Double_t GetBz (Double_t x, Double_t y, Double_t z)=0
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)=0
void WriteAsciiFile (const char *asciiFileName)
 Write the field map to an ASCII file.
void WriteRootFile (const char *rootFileName, const char *mapFileName)
 Write field map data to a ROOT file.
void SetPosition (Double_t x, Double_t y, Double_t z)
 Set the position of the field centre.
void SetScale (Double_t factor)
 Set a global field scaling factor.
void SetFieldOff (Bool_t is_off=kTRUE)
 Turn magnetic field off.
void SetFileName (const char *map_file_name)
 Set field map file path.
Double_t GetXmin () const
 Accessors to field parameters in local coordinate system.
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
 Accessor to field centre position in global system.
Double_t GetPositionY () const
Double_t GetPositionZ () const
Double_t GetScale () const
 Accessor to global scaling factor.
Bool_t IsFieldOff () const
 Whether magnetic field is off.
TArrayF * GetBx () const
 Accessors to the field value arrays.
TArrayF * GetBy () const
TArrayF * GetBz () const
const char * GetFileName ()
 Accessor to field map file.
virtual void Print (Option_t *) const
 Screen output.
virtual void FillParContainer ()=0
void Reset ()
 Reset the field parameters and data.

Static Public Member Functions

static TString GetMapFilePath (TString mapName)
 Get the expanded path to the field map file in the current installation.

Protected Member Functions

void ReadAsciiFile (const char *asciiFileName)
 Reset the field parameters and data.
void ReadRootFile (const char *rootFileName)
 Read field map from a ROOT file.
void ReadRootFileNewFormat (const char *rootFileName)
void ReadRootFileNewFormatExtrap (const char *rootFileName)
void SetField (const BmnFieldMapData *data)
 Set field parameters and data.
Double_t Interpolate (Double_t dx, Double_t dy, Double_t dz)
 Get field values by interpolation of the grid.

Protected Attributes

Double_t fScale
 Global scaling factor (w.r.t.
Double_t fPosX
 Field centre position in global coordinates.
Double_t fPosY
Double_t fPosZ
Double_t fPosBx
Double_t fPosBy
Double_t fPosBz
Double_t fXmin
 Field limits in local coordinate system.
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
 Number of grid points.
Int_t fNy
Int_t fNz
TArrayF * fBx
 Arrays with the field values.
TArrayF * fBy
TArrayF * fBz
Double_t fHa [2][2][2]
 Variables for temporary storage Used in the very frequently called method GetFieldValue.
Double_t fHb [2][2]
 Field at corners of a grid cell.
Double_t fHc [2]
 Interpolated field (2-dim).
Bool_t fDebugInfo
 Interpolated field (1-dim).
Bool_t fIsOff
 Whether magnetic field is off.

Private Member Functions

 BmnFieldMap (const BmnFieldMap &)=delete
BmnFieldMap & operator= (const BmnFieldMap &)=delete

Detailed Description

Definition at line 21 of file BmnFieldMap.h.

Constructor & Destructor Documentation

◆ BmnFieldMap() [1/4]

BmnFieldMap::BmnFieldMap ( )

Definition at line 18 of file BmnFieldMap.cxx.

References fBx, fBy, fBz, fDebugInfo, fHa, fHb, fHc, fIsOff, fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, and i.

Referenced by BmnFieldMap(), BmnFieldMap(), BmnFieldMap(), BmnFieldMapSym3::BmnFieldMapSym3(), BmnFieldMapSym3::BmnFieldMapSym3(), BmnFieldMapSym3::BmnFieldMapSym3(), BmnNewFieldMap::BmnNewFieldMap(), BmnNewFieldMap::BmnNewFieldMap(), BmnNewFieldMap::BmnNewFieldMap(), and operator=().

Here is the caller graph for this function:

◆ BmnFieldMap() [2/4]

BmnFieldMap::BmnFieldMap ( const char * mapFileName)

Definition at line 60 of file BmnFieldMap.cxx.

References BmnFieldMap().

Here is the call graph for this function:

◆ BmnFieldMap() [3/4]

BmnFieldMap::BmnFieldMap ( BmnFieldPar * fieldPar)

Definition at line 67 of file BmnFieldMap.cxx.

References BmnFieldMap(), fIsOff, fPosX, fPosY, fPosZ, fScale, BmnFieldPar::GetPositionX(), BmnFieldPar::GetPositionY(), BmnFieldPar::GetPositionZ(), BmnFieldPar::GetScale(), BmnFieldPar::GetType(), BmnFieldPar::IsFieldOff(), and BmnFieldPar::MapName().

Here is the call graph for this function:

◆ ~BmnFieldMap()

BmnFieldMap::~BmnFieldMap ( )
virtual

Definition at line 83 of file BmnFieldMap.cxx.

References fBx, fBy, and fBz.

◆ BmnFieldMap() [4/4]

BmnFieldMap::BmnFieldMap ( const BmnFieldMap & )
privatedelete

References BmnFieldMap().

Here is the call graph for this function:

Member Function Documentation

◆ FillParContainer()

virtual void BmnFieldMap::FillParContainer ( )
pure virtual

Implemented in BmnFieldMapSym3, and BmnNewFieldMap.

◆ GetBx() [1/2]

TArrayF * BmnFieldMap::GetBx ( ) const
inline

Definition at line 96 of file BmnFieldMap.h.

References fBx.

Referenced by Init(), and SetPosition().

Here is the caller graph for this function:

◆ GetBx() [2/2]

virtual Double_t BmnFieldMap::GetBx ( Double_t x,
Double_t y,
Double_t z )
pure virtual

Implemented in BmnFieldMapSym3, and BmnNewFieldMap.

References x, y, and z.

Referenced by CompareFieldMaps(), createRootMagField(), and TestField().

Here is the caller graph for this function:

◆ GetBy() [1/2]

TArrayF * BmnFieldMap::GetBy ( ) const
inline

Definition at line 97 of file BmnFieldMap.h.

References fBy.

Referenced by Init(), and SetPosition().

Here is the caller graph for this function:

◆ GetBy() [2/2]

virtual Double_t BmnFieldMap::GetBy ( Double_t x,
Double_t y,
Double_t z )
pure virtual

Implemented in BmnFieldMapSym3, and BmnNewFieldMap.

References x, y, and z.

Referenced by CompareFieldMaps(), createRootMagField(), FirstDerivative(), SecondDerivative(), smoothMap(), and TestField().

Here is the caller graph for this function:

◆ GetBz() [1/2]

TArrayF * BmnFieldMap::GetBz ( ) const
inline

Definition at line 98 of file BmnFieldMap.h.

References fBz.

Referenced by Init(), and SetPosition().

Here is the caller graph for this function:

◆ GetBz() [2/2]

virtual Double_t BmnFieldMap::GetBz ( Double_t x,
Double_t y,
Double_t z )
pure virtual

Implemented in BmnFieldMapSym3, and BmnNewFieldMap.

References x, y, and z.

Referenced by CompareFieldMaps(), createRootMagField(), and TestField().

Here is the caller graph for this function:

◆ GetFileName()

const char * BmnFieldMap::GetFileName ( )
inline

Definition at line 101 of file BmnFieldMap.h.

Referenced by GeoSetup::GetMagneticField().

Here is the caller graph for this function:

◆ GetMapFilePath()

TString BmnFieldMap::GetMapFilePath ( TString mapName)
static

Definition at line 95 of file BmnFieldMap.cxx.

References TString::Contains().

Referenced by Init(), and GeoSetup::ParseEditFieldMap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNx()

Int_t BmnFieldMap::GetNx ( ) const
inline

Definition at line 80 of file BmnFieldMap.h.

References fNx.

Referenced by createRootMagField(), and BmnSP41FieldMapCreator::Print().

Here is the caller graph for this function:

◆ GetNy()

Int_t BmnFieldMap::GetNy ( ) const
inline

Definition at line 81 of file BmnFieldMap.h.

References fNy.

Referenced by createRootMagField(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ GetNz()

Int_t BmnFieldMap::GetNz ( ) const
inline

Definition at line 82 of file BmnFieldMap.h.

References fNz.

Referenced by createRootMagField(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ GetPositionX()

Double_t BmnFieldMap::GetPositionX ( ) const
inline

Definition at line 85 of file BmnFieldMap.h.

References fPosX.

Referenced by BmnFieldPar::SetParameters(), and BmnMapPar::SetParameters().

Here is the caller graph for this function:

◆ GetPositionY()

Double_t BmnFieldMap::GetPositionY ( ) const
inline

Definition at line 86 of file BmnFieldMap.h.

References fPosY.

Referenced by BmnFieldPar::SetParameters(), and BmnMapPar::SetParameters().

Here is the caller graph for this function:

◆ GetPositionZ()

Double_t BmnFieldMap::GetPositionZ ( ) const
inline

Definition at line 87 of file BmnFieldMap.h.

References fPosZ.

Referenced by CbmKF::Propagate(), BmnFieldPar::SetParameters(), and BmnMapPar::SetParameters().

Here is the caller graph for this function:

◆ GetScale()

Double_t BmnFieldMap::GetScale ( ) const
inline

Definition at line 90 of file BmnFieldMap.h.

References fScale.

Referenced by BmnFieldMapData::BmnFieldMapData(), BmnFillDstTask::Init(), ResidOk_r7(), run_reco_gem_r7(), BmnFieldPar::SetParameters(), and BmnMapPar::SetParameters().

Here is the caller graph for this function:

◆ GetXmax()

Double_t BmnFieldMap::GetXmax ( ) const
inline

Definition at line 72 of file BmnFieldMap.h.

References fXmax.

Referenced by createRootMagField(), FirstDerivative(), and SecondDerivative().

Here is the caller graph for this function:

◆ GetXmin()

Double_t BmnFieldMap::GetXmin ( ) const
inline

Definition at line 68 of file BmnFieldMap.h.

References fXmin.

Referenced by createRootMagField(), FirstDerivative(), GetX(), BmnSP41FieldMapCreator::Print(), SecondDerivative(), and smoothMap().

Here is the caller graph for this function:

◆ GetXstep()

Double_t BmnFieldMap::GetXstep ( ) const
inline

Definition at line 76 of file BmnFieldMap.h.

References fXstep.

Referenced by FirstDerivative(), GetX(), BmnSP41FieldMapCreator::Print(), SecondDerivative(), and smoothMap().

Here is the caller graph for this function:

◆ GetYmax()

Double_t BmnFieldMap::GetYmax ( ) const
inline

Definition at line 73 of file BmnFieldMap.h.

References fYmax.

Referenced by createRootMagField().

Here is the caller graph for this function:

◆ GetYmin()

Double_t BmnFieldMap::GetYmin ( ) const
inline

Definition at line 69 of file BmnFieldMap.h.

References fYmin.

Referenced by createRootMagField(), GetY(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ GetYstep()

Double_t BmnFieldMap::GetYstep ( ) const
inline

Definition at line 77 of file BmnFieldMap.h.

References fYstep.

Referenced by GetY(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ GetZmax()

Double_t BmnFieldMap::GetZmax ( ) const
inline

Definition at line 74 of file BmnFieldMap.h.

References fZmax.

Referenced by createRootMagField(), BmnMultiField::Init(), and CbmKF::Propagate().

Here is the caller graph for this function:

◆ GetZmin()

Double_t BmnFieldMap::GetZmin ( ) const
inline

Definition at line 70 of file BmnFieldMap.h.

References fZmin.

Referenced by createRootMagField(), GetZ(), BmnMultiField::Init(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ GetZstep()

Double_t BmnFieldMap::GetZstep ( ) const
inline

Definition at line 78 of file BmnFieldMap.h.

References fZstep.

Referenced by GetZ(), BmnSP41FieldMapCreator::Print(), and smoothMap().

Here is the caller graph for this function:

◆ Init()

void BmnFieldMap::Init ( )
virtual

Definition at line 109 of file BmnFieldMap.cxx.

References TString::Contains(), fPosBx, fPosBy, fPosBz, fPosX, fPosY, fPosZ, GetBx(), GetBy(), GetBz(), GetMapFilePath(), ReadRootFileNewFormat(), and ReadRootFileNewFormatExtrap().

Referenced by checkBmnTrackExtrapolator(), CompareFieldMaps(), createRootMagField(), drawMatchingEffSRC(), drawTracks(), eventdisplay(), BmnMultiField::Init(), offlineQA(), ResidOk_r7(), run8_reco_bmn(), run_reco_bmn(), run_reco_bmn(), run_reco_gem_r7(), run_reco_src(), smoothMap(), and TestField().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Interpolate()

Double_t BmnFieldMap::Interpolate ( Double_t dx,
Double_t dy,
Double_t dz )
protected
Parameters
dx,dy,dzRelative distance from grid point [cell units]

Definition at line 660 of file BmnFieldMap.cxx.

References fHa, fHb, and fHc.

Referenced by BmnNewFieldMap::FieldInterpolate(), BmnFieldMapSym3::GetBx(), BmnFieldMapSym3::GetBy(), and BmnFieldMapSym3::GetBz().

Here is the caller graph for this function:

◆ IsFieldOff()

◆ IsInside()

virtual Bool_t BmnFieldMap::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 )
pure virtual

Implemented in BmnFieldMapSym3, and BmnNewFieldMap.

References x, y, and z.

◆ operator=()

BmnFieldMap & BmnFieldMap::operator= ( const BmnFieldMap & )
privatedelete

References BmnFieldMap().

Here is the call graph for this function:

◆ Print()

void BmnFieldMap::Print ( Option_t * ) const
virtual

Definition at line 201 of file BmnFieldMap.cxx.

References fIsOff, fNx, fNy, fNz, fPosBx, fPosBy, fPosBz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, and fZstep.

Referenced by checkBmnTrackExtrapolator(), run8_sim_bmn(), run_sim_bmn(), run_sim_bmn(), run_sim_bmn(), run_sim_filter(), run_sim_prefilter(), and run_sim_src().

Here is the caller graph for this function:

◆ ReadAsciiFile()

void BmnFieldMap::ReadAsciiFile ( const char * asciiFileName)
protected

Read the field map from an ASCII file

Definition at line 258 of file BmnFieldMap.cxx.

References TString::Data(), fBx, fBy, fBz, fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, and TMath::Nint().

Here is the call graph for this function:

◆ ReadRootFile()

void BmnFieldMap::ReadRootFile ( const char * rootFileName)
protected

Definition at line 521 of file BmnFieldMap.cxx.

References TString::Data(), TTree::Delete(), fBx, fBy, fBz, fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, TDirectoryFile::Get(), TTree::GetEntry(), TFile::IsOpen(), coordinate_info_t::max, coordinate_info_t::min, coordinate_info_t::N, TMath::Nint(), TFile::Open(), TTree::SetBranchAddress(), coordinate_info_t::step, and v.

Here is the call graph for this function:

◆ ReadRootFileNewFormat()

void BmnFieldMap::ReadRootFileNewFormat ( const char * rootFileName)
protected

Definition at line 350 of file BmnFieldMap.cxx.

References TString::Data(), fBx, fBy, fBz, fNx, fNy, fNz, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, TDirectoryFile::Get(), BmnFieldPoint::GetBx(), BmnFieldPoint::GetBy(), BmnFieldPoint::GetBz(), TTree::GetEntries(), TTree::GetEntry(), i, TFile::IsOpen(), TFile::Open(), and TTree::SetBranchAddress().

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadRootFileNewFormatExtrap()

void BmnFieldMap::ReadRootFileNewFormatExtrap ( const char * rootFileName)
protected

Definition at line 405 of file BmnFieldMap.cxx.

References TFile::Close(), TString::Data(), fBx, fBy, fBz, fNx, fNy, fNz, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, TDirectoryFile::Get(), BmnFieldPoint::GetBx(), BmnFieldPoint::GetBy(), BmnFieldPoint::GetBz(), TTree::GetEntries(), TTree::GetEntry(), i, TFile::IsOpen(), TFile::Open(), and TTree::SetBranchAddress().

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

void BmnFieldMap::Reset ( )

Definition at line 234 of file BmnFieldMap.cxx.

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

◆ SetField()

void BmnFieldMap::SetField ( const BmnFieldMapData * data)
protected

◆ SetFieldOff()

void BmnFieldMap::SetFieldOff ( Bool_t is_off = kTRUE)
inline

Definition at line 62 of file BmnFieldMap.h.

References fIsOff.

◆ SetFileName()

void BmnFieldMap::SetFileName ( const char * map_file_name)
inline

Definition at line 65 of file BmnFieldMap.h.

Referenced by GeoSetup::GetMagneticField().

Here is the caller graph for this function:

◆ SetPosition()

void BmnFieldMap::SetPosition ( Double_t x,
Double_t y,
Double_t z )

Definition at line 191 of file BmnFieldMap.cxx.

References fPosBx, fPosBy, fPosBz, fPosX, fPosY, fPosZ, GetBx(), GetBy(), GetBz(), x, y, and z.

Referenced by run_sim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetScale()

void BmnFieldMap::SetScale ( Double_t factor)
inline

◆ WriteAsciiFile()

void BmnFieldMap::WriteAsciiFile ( const char * asciiFileName)

Definition at line 127 of file BmnFieldMap.cxx.

References TString::Data(), fBx, fBy, fBz, fNx, fNy, fNz, fScale, fXmax, fXmin, fYmax, fYmin, fZmax, fZmin, and TMath::Nint().

Here is the call graph for this function:

◆ WriteRootFile()

void BmnFieldMap::WriteRootFile ( const char * rootFileName,
const char * mapFileName )

Definition at line 178 of file BmnFieldMap.cxx.

References TDirectoryFile::cd(), TFile::Open(), and TObject::Write().

Here is the call graph for this function:

Member Data Documentation

◆ fBx

◆ fBy

◆ fBz

◆ fDebugInfo

Bool_t BmnFieldMap::fDebugInfo
protected

Definition at line 160 of file BmnFieldMap.h.

Referenced by BmnFieldMap().

◆ fHa

◆ fHb

Double_t BmnFieldMap::fHb[2][2]
protected

Definition at line 157 of file BmnFieldMap.h.

Referenced by BmnFieldMap(), and Interpolate().

◆ fHc

Double_t BmnFieldMap::fHc[2]
protected

Definition at line 158 of file BmnFieldMap.h.

Referenced by BmnFieldMap(), and Interpolate().

◆ fIsOff

Bool_t BmnFieldMap::fIsOff
protected

Definition at line 162 of file BmnFieldMap.h.

Referenced by BmnFieldMap(), BmnFieldMap(), IsFieldOff(), Print(), Reset(), SetFieldOff(), and SetScale().

◆ fNx

◆ fNy

◆ fNz

◆ fPosBx

Double_t BmnFieldMap::fPosBx
protected

Definition at line 139 of file BmnFieldMap.h.

Referenced by Init(), Print(), Reset(), and SetPosition().

◆ fPosBy

Double_t BmnFieldMap::fPosBy
protected

Definition at line 139 of file BmnFieldMap.h.

Referenced by Init(), Print(), Reset(), and SetPosition().

◆ fPosBz

Double_t BmnFieldMap::fPosBz
protected

Definition at line 139 of file BmnFieldMap.h.

Referenced by Init(), Print(), Reset(), and SetPosition().

◆ fPosX

◆ fPosY

◆ fPosZ

◆ fScale

◆ fXmax

◆ fXmin

◆ fXstep

◆ fYmax

◆ fYmin

◆ fYstep

◆ fZmax

◆ fZmin

◆ fZstep


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