Belle II Software  release-08-01-10
BeamlineFieldMapInterpolation Class Reference

The BeamlineFieldMapInterpolation class. More...

Collaboration diagram for BeamlineFieldMapInterpolation:

Public Member Functions

const TriangularInterpolationgetTriangularInterpolation () const
 Expose the triangular interpolation to outside. More...
 
 BeamlineFieldMapInterpolation ()=default
 Default constructor.
 
 ~BeamlineFieldMapInterpolation ()=default
 Default destructor.
 
void init (const string &fieldmapname, const string &interpolname, double validRadius)
 Initializes the magnetic field component. More...
 
int zIndexAndWeight (double z, double &w1) const
 For a given Z coordinate calculate the index of Z slice and corresponding weight. More...
 
bool inRange (const ROOT::Math::XYZVector &v) const
 Check the space point if the interpolation exists. More...
 
ROOT::Math::XYZVector interpolateField (const ROOT::Math::XYZVector &v) const
 Interpolate the magnetic field vector at the specified space point. More...
 

Protected Attributes

vector< ROOT::Math::XYZVector > m_B
 Buffer for the magnetic field map.
 
TriangularInterpolation m_triInterpol
 Object to locate point in a triangular mesh.
 
int m_nxy {0}
 Number of field points in XY plane.
 
int m_nz {0}
 Number of field slices in Z direction.
 
int m_nz1 {0}
 Start Z slice number for the finer Z grid.
 
int m_nz2 {0}
 End Z slice number for the finer Z grid.
 
int m_nr {0}
 Number of grid points in R direction.
 
int m_nphi {0}
 Number of grid points in Phi direction.
 
double m_rj {0}
 Separation radius between triangular and cylindrical meshes.
 
double m_rj2 {0}
 Square of the separation radius between triangular and cylindrical meshes.
 
double m_zj {0}
 Z border of finer Z grid.
 
double m_dz0 {0}
 Coarse Z grid pitch.
 
double m_dz1 {0}
 Finer Z grid pitch.
 
double m_idz0 {0}
 Inverse of coarse Z grid pitch.
 
double m_idz1 {0}
 Inverse of finer Z grid pitch.
 
double m_idphi {0}
 Repciprocal of Phi grid.
 
double m_idr {0}
 Repciprocal of R grid.
 
double m_rmax {0}
 Maximal radius where interpolation is still valid.
 
double m_zmax {0}
 Maximal Z where interpolation is still valid.
 

Detailed Description

The BeamlineFieldMapInterpolation class.

This class interpolates a magnetic field map around beamline. The magnetic field map is stored as a grid in cylindrical coordinates for outer radiuses and triangular mesh for inner part It is defined by a maximum radius and a maximum z value, a pitch size in both, r and z, and the number of grid points.

Definition at line 285 of file BFieldComponentBeamline.cc.

Member Function Documentation

◆ getTriangularInterpolation()

const TriangularInterpolation& getTriangularInterpolation ( ) const
inline

Expose the triangular interpolation to outside.

Returns
constant reference to the interpolation

Definition at line 292 of file BFieldComponentBeamline.cc.

◆ init()

void init ( const string &  fieldmapname,
const string &  interpolname,
double  validRadius 
)
inline

Initializes the magnetic field component.

This method opens the magnetic field map file and triangular mesh.

Parameters
fieldmapnameFile name containing the field map
interpolnameFile name containing triangular mesh
validRadiusMaximum radius up to which interpolation is valid

Definition at line 310 of file BFieldComponentBeamline.cc.

◆ inRange()

bool inRange ( const ROOT::Math::XYZVector &  v) const
inline

Check the space point if the interpolation exists.

Parameters
vThe space point in Cartesian coordinates (x,y,z) in [cm] at which the interpolation exists.
Returns
The magnetic field vector at the given space point in [T]. Returns false if the space point lies outside the valid region.

Definition at line 527 of file BFieldComponentBeamline.cc.

◆ interpolateField()

ROOT::Math::XYZVector interpolateField ( const ROOT::Math::XYZVector &  v) const
inline

Interpolate the magnetic field vector at the specified space point.

Parameters
vThe space point in Cartesian coordinates (x,y,z) in [cm] at which the magnetic field vector should be calculated.
Returns
The magnetic field vector at the given space point in [T]. Returns a zero vector (0,0,0) if the space point lies outside the region described by the component.

Definition at line 544 of file BFieldComponentBeamline.cc.

◆ zIndexAndWeight()

int zIndexAndWeight ( double  z,
double &  w1 
) const
inline

For a given Z coordinate calculate the index of Z slice and corresponding weight.

Parameters
zZ coordinate
w1weight of the slice
Returns
the index of Z slice. Returns -1 if Z coordinate is outside valid region region.

Definition at line 494 of file BFieldComponentBeamline.cc.


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