PandaRoot
PndFieldMap Class Reference

#include <PndFieldMap.h>

Inheritance diagram for PndFieldMap:
PndDipoleMap PndSolenoidMap PndTransMap

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. More...
 
Double_t fHc [2]
 Interpolated field (2-dim) More...
 

Detailed Description

Definition at line 21 of file PndFieldMap.h.

Constructor & Destructor Documentation

◆ PndFieldMap() [1/3]

PndFieldMap::PndFieldMap ( )

Default constructor

Referenced by GetFileName().

◆ PndFieldMap() [2/3]

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

Standard constructor

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

◆ PndFieldMap() [3/3]

PndFieldMap::PndFieldMap ( PndFieldPar fieldPar)

Constructor from PndFieldPar

◆ ~PndFieldMap()

virtual PndFieldMap::~PndFieldMap ( )
virtual

Destructor

Member Function Documentation

◆ GetBx() [1/2]

virtual 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]

◆ GetBx() [2/2]

TArrayF* PndFieldMap::GetBx ( ) const
inline

Accessors to the field value arrays

Definition at line 95 of file PndFieldMap.h.

References fBx.

95 { return fBx; }
TArrayF * fBx
Definition: PndFieldMap.h:148

◆ GetBy() [1/2]

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

◆ GetBy() [2/2]

TArrayF* PndFieldMap::GetBy ( ) const
inline

Definition at line 96 of file PndFieldMap.h.

References fBy.

96 { return fBy; }
TArrayF * fBy
Definition: PndFieldMap.h:149

◆ GetBz() [1/2]

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

◆ GetBz() [2/2]

TArrayF* PndFieldMap::GetBz ( ) const
inline

Definition at line 97 of file PndFieldMap.h.

References fBz.

97 { return fBz; }
TArrayF * fBz
Definition: PndFieldMap.h:150

◆ GetFileName()

const char* PndFieldMap::GetFileName ( )
inline

Accessor to field map file

Definition at line 100 of file PndFieldMap.h.

References fFileName, Interpolate(), PndFieldMap(), Print(), ReadAsciiFile(), ReadRootFile(), Reset(), and SetField().

100 { return fFileName.Data(); }
TString fFileName
Definition: PndFieldMap.h:128

◆ GetNx()

Int_t PndFieldMap::GetNx ( ) const
inline

Definition at line 80 of file PndFieldMap.h.

References fNx.

80 { return fNx; }

◆ GetNy()

Int_t PndFieldMap::GetNy ( ) const
inline

Definition at line 81 of file PndFieldMap.h.

References fNy.

81 { return fNy; }

◆ GetNz()

Int_t PndFieldMap::GetNz ( ) const
inline

Definition at line 82 of file PndFieldMap.h.

References fNz.

82 { return fNz; }

◆ GetPositionX()

Double_t PndFieldMap::GetPositionX ( ) const
inline

Accessor to field centre position in global system

Definition at line 87 of file PndFieldMap.h.

References fPosX.

87 { return fPosX; }
Double_t fPosX
Definition: PndFieldMap.h:137

◆ GetPositionY()

Double_t PndFieldMap::GetPositionY ( ) const
inline

Definition at line 88 of file PndFieldMap.h.

References fPosY.

88 { return fPosY; }
Double_t fPosY
Definition: PndFieldMap.h:137

◆ GetPositionZ()

Double_t PndFieldMap::GetPositionZ ( ) const
inline

Definition at line 89 of file PndFieldMap.h.

References fPosZ.

89 { return fPosZ; }
Double_t fPosZ
Definition: PndFieldMap.h:137

◆ GetScale()

Double_t PndFieldMap::GetScale ( ) const
inline

Accessor to global scaling factor

Definition at line 92 of file PndFieldMap.h.

References fScale.

92 { return fScale; }
Double_t fScale
Definition: PndFieldMap.h:131

◆ GetUnit()

Double_t PndFieldMap::GetUnit ( ) const
inline

Definition at line 84 of file PndFieldMap.h.

References funit.

84 { return funit; }
Double_t funit
Definition: PndFieldMap.h:134

◆ GetXmax()

Double_t PndFieldMap::GetXmax ( ) const
inline

Definition at line 74 of file PndFieldMap.h.

References fXmax.

74 { return fXmax; }
Double_t fXmax
Definition: PndFieldMap.h:140

◆ GetXmin()

Double_t PndFieldMap::GetXmin ( ) const
inline

Accessors to field parameters in local coordinate system

Definition at line 71 of file PndFieldMap.h.

References fXmin.

71 { return fXmin; }
Double_t fXmin
Definition: PndFieldMap.h:140

◆ GetXstep()

Double_t PndFieldMap::GetXstep ( ) const
inline

Definition at line 77 of file PndFieldMap.h.

References fXstep.

77 { return fXstep; }
Double_t fXstep
Definition: PndFieldMap.h:140

◆ GetYmax()

Double_t PndFieldMap::GetYmax ( ) const
inline

Definition at line 75 of file PndFieldMap.h.

References fYmax.

75 { return fYmax; }
Double_t fYmax
Definition: PndFieldMap.h:141

◆ GetYmin()

Double_t PndFieldMap::GetYmin ( ) const
inline

Definition at line 72 of file PndFieldMap.h.

References fYmin.

72 { return fYmin; }
Double_t fYmin
Definition: PndFieldMap.h:141

◆ GetYstep()

Double_t PndFieldMap::GetYstep ( ) const
inline

Definition at line 78 of file PndFieldMap.h.

References fYstep.

78 { return fYstep; }
Double_t fYstep
Definition: PndFieldMap.h:141

◆ GetZmax()

Double_t PndFieldMap::GetZmax ( ) const
inline

Definition at line 76 of file PndFieldMap.h.

References fZmax.

76 { return fZmax; }
Double_t fZmax
Definition: PndFieldMap.h:142

◆ GetZmin()

Double_t PndFieldMap::GetZmin ( ) const
inline

Definition at line 73 of file PndFieldMap.h.

References fZmin.

73 { return fZmin; }
Double_t fZmin
Definition: PndFieldMap.h:142

◆ GetZstep()

Double_t PndFieldMap::GetZstep ( ) const
inline

Definition at line 79 of file PndFieldMap.h.

References fZstep.

79 { return fZstep; }
Double_t fZstep
Definition: PndFieldMap.h:142

◆ Init()

virtual void PndFieldMap::Init ( )
virtual

Initialisation (read map from file)

◆ Interpolate()

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]

Referenced by GetFileName().

◆ IsInside()

virtual 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 PndSolenoidMap, PndDipoleMap, and PndTransMap.

◆ Print()

virtual void PndFieldMap::Print ( )
virtual

Screen output

Referenced by GetFileName().

◆ ReadAsciiFile()

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

Read the field map from an ASCII file

Referenced by GetFileName().

◆ ReadRootFile()

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

Read field map from a ROOT file

Referenced by GetFileName().

◆ Reset()

void PndFieldMap::Reset ( )
protected

Reset the field parameters and data

Referenced by GetFileName().

◆ SetField()

void PndFieldMap::SetField ( const PndFieldMapData data)
protected

Set field parameters and data

Referenced by GetFileName().

◆ SetPosition()

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

Set the position of the field centre

◆ SetScale()

void PndFieldMap::SetScale ( Double_t  factor)
inline

Set a global field scaling factor

Definition at line 68 of file PndFieldMap.h.

References fScale.

68 { fScale = factor; }
Double_t fScale
Definition: PndFieldMap.h:131

◆ WriteAsciiFile()

void PndFieldMap::WriteAsciiFile ( const char *  fileName)

Write the field map to an ASCII file

◆ WriteRootFile()

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

Write field map data to a ROOT file

Member Data Documentation

◆ fBx

TArrayF* PndFieldMap::fBx
protected

Arrays with the field values

Definition at line 148 of file PndFieldMap.h.

Referenced by GetBx().

◆ fBy

TArrayF* PndFieldMap::fBy
protected

Definition at line 149 of file PndFieldMap.h.

Referenced by GetBy().

◆ fBz

TArrayF* PndFieldMap::fBz
protected

Definition at line 150 of file PndFieldMap.h.

Referenced by GetBz().

◆ fFileName

TString PndFieldMap::fFileName
protected

Map file name

Definition at line 128 of file PndFieldMap.h.

Referenced by GetFileName().

◆ fHa

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

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

Definition at line 154 of file PndFieldMap.h.

◆ fHb

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

Field at corners of a grid cell.

Definition at line 155 of file PndFieldMap.h.

◆ fHc

Double_t PndFieldMap::fHc[2]
protected

Interpolated field (2-dim)

Definition at line 156 of file PndFieldMap.h.

◆ fNx

Int_t PndFieldMap::fNx
protected

Number of grid points

Definition at line 145 of file PndFieldMap.h.

Referenced by GetNx().

◆ fNy

Int_t PndFieldMap::fNy
protected

Definition at line 145 of file PndFieldMap.h.

Referenced by GetNy().

◆ fNz

Int_t PndFieldMap::fNz
protected

Definition at line 145 of file PndFieldMap.h.

Referenced by GetNz().

◆ fPosX

Double_t PndFieldMap::fPosX
protected

Field centre position in global coordinates

Definition at line 137 of file PndFieldMap.h.

Referenced by GetPositionX().

◆ fPosY

Double_t PndFieldMap::fPosY
protected

Definition at line 137 of file PndFieldMap.h.

Referenced by GetPositionY().

◆ fPosZ

Double_t PndFieldMap::fPosZ
protected

Definition at line 137 of file PndFieldMap.h.

Referenced by GetPositionZ().

◆ fScale

Double_t PndFieldMap::fScale
protected

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

Definition at line 131 of file PndFieldMap.h.

Referenced by GetScale(), and SetScale().

◆ funit

Double_t PndFieldMap::funit
protected

Units used in map file

Definition at line 134 of file PndFieldMap.h.

Referenced by GetUnit().

◆ fXmax

Double_t PndFieldMap::fXmax
protected

Definition at line 140 of file PndFieldMap.h.

Referenced by GetXmax().

◆ fXmin

Double_t PndFieldMap::fXmin
protected

Field limits in local coordinate system

Definition at line 140 of file PndFieldMap.h.

Referenced by GetXmin().

◆ fXstep

Double_t PndFieldMap::fXstep
protected

Definition at line 140 of file PndFieldMap.h.

Referenced by GetXstep().

◆ fYmax

Double_t PndFieldMap::fYmax
protected

Definition at line 141 of file PndFieldMap.h.

Referenced by GetYmax().

◆ fYmin

Double_t PndFieldMap::fYmin
protected

Definition at line 141 of file PndFieldMap.h.

Referenced by GetYmin().

◆ fYstep

Double_t PndFieldMap::fYstep
protected

Definition at line 141 of file PndFieldMap.h.

Referenced by GetYstep().

◆ fZmax

Double_t PndFieldMap::fZmax
protected

Definition at line 142 of file PndFieldMap.h.

Referenced by GetZmax().

◆ fZmin

Double_t PndFieldMap::fZmin
protected

Definition at line 142 of file PndFieldMap.h.

Referenced by GetZmin().

◆ fZstep

Double_t PndFieldMap::fZstep
protected

Definition at line 142 of file PndFieldMap.h.

Referenced by GetZstep().


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