EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndFieldMap Class Reference

#include <EicRoot/blob/master/field/PndFieldMap.h>

+ Inheritance diagram for PndFieldMap:
+ Collaboration diagram for PndFieldMap:

Public Member Functions

 PndFieldMap ()
 
 PndFieldMap (const char *mapName, const char *fileType="R")
 
 PndFieldMap (PndFieldPar *fieldPar)
 
virtual ~PndFieldMap ()
 
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)
 
void SetPosition (Double_t x, Double_t y, Double_t z)
 
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 GetUnit () 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 ()
 

Protected Member Functions

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

Protected Attributes

TString fFileName
 
Double_t fScale
 
Double_t funit
 
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)
 

Private Member Functions

 PndFieldMap (const PndFieldMap &L)
 
PndFieldMapoperator= (const PndFieldMap &)
 

Detailed Description

Definition at line 23 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 23 of file PndFieldMap.h

Constructor & Destructor Documentation

PndFieldMap::PndFieldMap ( )

Default constructor

Definition at line 23 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 23 of file PndFieldMap.cxx

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

Standard constructor

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

Definition at line 43 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 43 of file PndFieldMap.cxx

References fFileName.

PndFieldMap::PndFieldMap ( PndFieldPar fieldPar)

Constructor from PndFieldPar

Definition at line 67 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 67 of file PndFieldMap.cxx

References FairLogger::Error(), fFileName, fPosX, fPosY, fPosZ, fScale, PndFieldPar::GetPositionX(), PndFieldPar::GetPositionY(), PndFieldPar::GetPositionZ(), PndFieldPar::GetScale(), PndFieldPar::GetType(), gLogger, PndFieldPar::MapName(), MESSAGE_ORIGIN, and configureMap::Name.

+ Here is the call graph for this function:

PndFieldMap::~PndFieldMap ( )
virtual

Destructor

Definition at line 102 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 102 of file PndFieldMap.cxx

References fBx, fBy, and fBz.

PndFieldMap::PndFieldMap ( const PndFieldMap L)
inlineprivate

Definition at line 127 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 127 of file PndFieldMap.h

Member Function Documentation

Double_t PndFieldMap::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 127 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 127 of file PndFieldMap.cxx

References dx, dy, dz, fBx, fHa, fNy, fNz, Interpolate(), and IsInside().

+ Here is the call graph for this function:

TArrayF* PndFieldMap::GetBx ( ) const
inline

Accessors to the field value arrays

Definition at line 114 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 114 of file PndFieldMap.h

References fBx.

Referenced by Print().

+ Here is the caller graph for this function:

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

Definition at line 160 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 160 of file PndFieldMap.cxx

References dx, dy, dz, fBy, fHa, fNy, fNz, Interpolate(), and IsInside().

+ Here is the call graph for this function:

TArrayF* PndFieldMap::GetBy ( ) const
inline

Definition at line 115 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 115 of file PndFieldMap.h

References fBy.

Referenced by Print().

+ Here is the caller graph for this function:

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

Definition at line 193 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 193 of file PndFieldMap.cxx

References dx, dy, dz, fBz, fHa, fNy, fNz, Interpolate(), and IsInside().

+ Here is the call graph for this function:

TArrayF* PndFieldMap::GetBz ( ) const
inline

Definition at line 116 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 116 of file PndFieldMap.h

References fBz.

Referenced by Print().

+ Here is the caller graph for this function:

const char* PndFieldMap::GetFileName ( void  )
inline

Accessor to field map file

Definition at line 120 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 120 of file PndFieldMap.h

References fFileName.

Int_t PndFieldMap::GetNx ( ) const
inline

Definition at line 97 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 97 of file PndFieldMap.h

References fNx.

Int_t PndFieldMap::GetNy ( ) const
inline

Definition at line 98 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 98 of file PndFieldMap.h

References fNy.

Int_t PndFieldMap::GetNz ( ) const
inline

Definition at line 99 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 99 of file PndFieldMap.h

References fNz.

Double_t PndFieldMap::GetPositionX ( ) const
inline

Accessor to field centre position in global system

Definition at line 104 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 104 of file PndFieldMap.h

References fPosX.

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

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetPositionY ( ) const
inline

Definition at line 105 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 105 of file PndFieldMap.h

References fPosY.

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

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetPositionZ ( ) const
inline

Definition at line 106 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 106 of file PndFieldMap.h

References fPosZ.

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

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetScale ( ) const
inline

Accessor to global scaling factor

Definition at line 110 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 110 of file PndFieldMap.h

References fScale.

Referenced by PndFieldMapData::PndFieldMapData(), PndFieldPar::SetParameters(), and PndMapPar::SetParameters().

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetUnit ( ) const
inline

Definition at line 101 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 101 of file PndFieldMap.h

References funit.

Double_t PndFieldMap::GetXmax ( ) const
inline

Definition at line 91 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 91 of file PndFieldMap.h

References fXmax.

Double_t PndFieldMap::GetXmin ( ) const
inline

Accessors to field parameters in local coordinate system

Definition at line 88 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 88 of file PndFieldMap.h

References fXmin.

Double_t PndFieldMap::GetXstep ( ) const
inline

Definition at line 94 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 94 of file PndFieldMap.h

References fXstep.

Double_t PndFieldMap::GetYmax ( ) const
inline

Definition at line 92 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 92 of file PndFieldMap.h

References fYmax.

Double_t PndFieldMap::GetYmin ( ) const
inline

Definition at line 89 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 89 of file PndFieldMap.h

References fYmin.

Double_t PndFieldMap::GetYstep ( ) const
inline

Definition at line 95 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 95 of file PndFieldMap.h

References fYstep.

Double_t PndFieldMap::GetZmax ( ) const
inline

Definition at line 93 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 93 of file PndFieldMap.h

References fZmax.

Referenced by PndMultiField::Init().

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetZmin ( ) const
inline

Definition at line 90 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 90 of file PndFieldMap.h

References fZmin.

Referenced by PndMultiField::Init().

+ Here is the caller graph for this function:

Double_t PndFieldMap::GetZstep ( ) const
inline

Definition at line 96 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 96 of file PndFieldMap.h

References fZstep.

void PndFieldMap::Init ( void  )
virtual

Initialisation (read map from file)

Definition at line 114 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 114 of file PndFieldMap.cxx

References FairLogger::Error(), fFileName, gLogger, MESSAGE_ORIGIN, ReadAsciiFile(), and ReadRootFile().

Referenced by df2root(), f2ascii(), PndMultiField::Init(), EicPndFieldMap::Initialize(), and sf2root().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Double_t PndFieldMap::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 592 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 592 of file PndFieldMap.cxx

References fHa, fHb, and fHc.

Referenced by GetBx(), PndTransMap::GetBxyz(), PndSolenoidMap::GetBxyz(), PndDipoleMap::GetBxyz(), GetBy(), and GetBz().

+ Here is the caller graph for this function:

Bool_t PndFieldMap::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

Reimplemented in PndDipoleMap, PndSolenoidMap, and PndTransMap.

Definition at line 226 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 226 of file PndFieldMap.cxx

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

Referenced by EicPndFieldMap::Contains(), GetBx(), GetBy(), and GetBz().

+ Here is the caller graph for this function:

PndFieldMap& PndFieldMap::operator= ( const PndFieldMap )
inlineprivate

Definition at line 128 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 128 of file PndFieldMap.h

void PndFieldMap::Print ( )
virtual

Screen output

Definition at line 348 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 348 of file PndFieldMap.cxx

References fNx, fNy, fNz, fPosX, fPosY, fPosZ, fScale, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, GetBx(), GetBy(), and GetBz().

+ Here is the call graph for this function:

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

Read the field map from an ASCII file

Definition at line 401 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 401 of file PndFieldMap.cxx

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

Referenced by Init().

+ Here is the caller graph for this function:

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

Read field map from a ROOT file

Definition at line 507 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 507 of file PndFieldMap.cxx

References data, FairLogger::Error(), exit(), eicpy.qaplots::file, gLogger, FairLogger::Info(), MESSAGE_ORIGIN, and SetField().

Referenced by Init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PndFieldMap::Reset ( )
protected

Reset the field parameters and data

Definition at line 384 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 384 of file PndFieldMap.cxx

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

void PndFieldMap::SetField ( const PndFieldMapData data)
protected

Set field parameters and data

Definition at line 544 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 544 of file PndFieldMap.cxx

References FairLogger::Error(), fBx, fBy, fBz, fNx, fNy, fNz, fScale, funit, fXmax, fXmin, fXstep, fYmax, fYmin, fYstep, fZmax, fZmin, fZstep, PndFieldMapData::GetBx(), PndFieldMapData::GetBy(), PndFieldMapData::GetBz(), PndFieldMapData::GetNx(), PndFieldMapData::GetNy(), PndFieldMapData::GetNz(), PndFieldMapData::GetType(), PndFieldMapData::GetXmax(), PndFieldMapData::GetXmin(), PndFieldMapData::GetYmax(), PndFieldMapData::GetYmin(), PndFieldMapData::GetZmax(), PndFieldMapData::GetZmin(), gLogger, and MESSAGE_ORIGIN.

Referenced by ReadRootFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Set the position of the field centre

Definition at line 338 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 338 of file PndFieldMap.cxx

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

void PndFieldMap::SetScale ( Double_t  factor)
inline

Set a global field scaling factor

Definition at line 84 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 84 of file PndFieldMap.h

References fScale.

void PndFieldMap::WriteAsciiFile ( const char *  fileName)

Write the field map to an ASCII file

Definition at line 262 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 262 of file PndFieldMap.cxx

References FairLogger::Error(), fBx, fBy, fBz, fNx, fNy, fNz, fScale, funit, fXmax, fXmin, fYmax, fYmin, fZmax, fZmin, gLogger, FairLogger::Info(), and MESSAGE_ORIGIN.

Referenced by f2ascii().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Write field map data to a ROOT file

Definition at line 322 of file PndFieldMap.cxx.

View newest version in sPHENIX GitHub at line 322 of file PndFieldMap.cxx

References data, and eicpy.qaplots::file.

Referenced by df2root(), and sf2root().

+ Here is the caller graph for this function:

Member Data Documentation

TArrayF* PndFieldMap::fBx
protected

Arrays with the field values

Definition at line 182 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 182 of file PndFieldMap.h

Referenced by GetBx(), PndTransMap::GetBxyz(), PndSolenoidMap::GetBxyz(), PndDipoleMap::GetBxyz(), PndDipoleMap::PndDipoleMap(), PndTransMap::PndTransMap(), ReadAsciiFile(), Reset(), SetField(), WriteAsciiFile(), and ~PndFieldMap().

TArrayF* PndFieldMap::fBy
protected
TArrayF* PndFieldMap::fBz
protected
TString PndFieldMap::fFileName
protected

Map file name

Definition at line 157 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 157 of file PndFieldMap.h

Referenced by GetFileName(), Init(), PndDipoleMap::PndDipoleMap(), PndFieldMap(), PndSolenoidMap::PndSolenoidMap(), and PndTransMap::PndTransMap().

Double_t PndFieldMap::fHa[2][2][2]
protected

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

Definition at line 189 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 189 of file PndFieldMap.h

Referenced by GetBx(), PndTransMap::GetBxyz(), PndDipoleMap::GetBxyz(), PndSolenoidMap::GetBxyz(), GetBy(), GetBz(), and Interpolate().

Double_t PndFieldMap::fHb[2][2]
protected

Field at corners of a grid cell.

Definition at line 190 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 190 of file PndFieldMap.h

Referenced by Interpolate().

Double_t PndFieldMap::fHc[2]
protected

Interpolated field (2-dim)

Definition at line 191 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 191 of file PndFieldMap.h

Referenced by Interpolate().

Int_t PndFieldMap::fNx
protected

Number of grid points

Definition at line 178 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 178 of file PndFieldMap.h

Referenced by GetNx(), PndDipoleMap::PndDipoleMap(), PndTransMap::PndTransMap(), Print(), ReadAsciiFile(), Reset(), SetField(), and WriteAsciiFile().

Int_t PndFieldMap::fNy
protected
Int_t PndFieldMap::fNz
protected
Double_t PndFieldMap::fPosX
protected

Field centre position in global coordinates

Definition at line 168 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 168 of file PndFieldMap.h

Referenced by GetPositionX(), PndDipoleMap::IsInside(), PndSolenoidMap::IsInside(), PndTransMap::IsInside(), IsInside(), PndDipoleMap::PndDipoleMap(), PndFieldMap(), PndSolenoidMap::PndSolenoidMap(), PndTransMap::PndTransMap(), Print(), Reset(), and SetPosition().

Double_t PndFieldMap::fScale
protected

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

Definition at line 161 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 161 of file PndFieldMap.h

Referenced by GetScale(), PndDipoleMap::PndDipoleMap(), PndFieldMap(), PndSolenoidMap::PndSolenoidMap(), PndTransMap::PndTransMap(), Print(), ReadAsciiFile(), Reset(), SetField(), SetScale(), and WriteAsciiFile().

Double_t PndFieldMap::funit
protected

Units used in map file

Definition at line 164 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 164 of file PndFieldMap.h

Referenced by GetUnit(), PndDipoleMap::PndDipoleMap(), PndTransMap::PndTransMap(), ReadAsciiFile(), Reset(), SetField(), and WriteAsciiFile().

Double_t PndFieldMap::fXmax
protected

Definition at line 172 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 172 of file PndFieldMap.h

Referenced by GetXmax(), PndDipoleMap::PndDipoleMap(), PndTransMap::PndTransMap(), Print(), ReadAsciiFile(), Reset(), SetField(), and WriteAsciiFile().

Double_t PndFieldMap::fXmin
protected

Field limits in local coordinate system

Definition at line 172 of file PndFieldMap.h.

View newest version in sPHENIX GitHub at line 172 of file PndFieldMap.h

Referenced by GetXmin(), PndDipoleMap::IsInside(), PndSolenoidMap::IsInside(), PndTransMap::IsInside(), IsInside(), PndDipoleMap::PndDipoleMap(), PndTransMap::PndTransMap(), Print(), ReadAsciiFile(), Reset(), SetField(), and WriteAsciiFile().

Double_t PndFieldMap::fXstep
protected
Double_t PndFieldMap::fYmax
protected
Double_t PndFieldMap::fYmin
protected
Double_t PndFieldMap::fYstep
protected
Double_t PndFieldMap::fZmax
protected
Double_t PndFieldMap::fZmin
protected
Double_t PndFieldMap::fZstep
protected

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