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

The BFieldComponentConstant class. More...

#include <BFieldComponentConstant.h>

Inheritance diagram for BFieldComponentConstant:
Collaboration diagram for BFieldComponentConstant:

Public Member Functions

 BFieldComponentConstant ()=default
 The BFieldComponentConstant constructor.
 
virtual ~BFieldComponentConstant ()=default
 The BFieldComponentConstant destructor.
 
virtual ROOT::Math::XYZVector calculate (const ROOT::Math::XYZVector &point) const override
 Calculates the magnetic field vector at the specified space point. More...
 
void setMagneticFieldValues (double x, double y, double z, double rmax, double zmin, double zmax)
 Sets the values for the homogeneous magnetic field vector. More...
 
virtual void initialize ()
 Initializes the magnetic field component. More...
 
virtual void terminate ()
 Terminates the magnetic field component. More...
 

Private Attributes

double m_magneticField [3] {0}
 The values for the homogeneous magnetic field vector.
 
double maxRadius4BField {0}
 The values for the maximum radius for the homogeneous field.
 
double minZ4BField {0}
 The values for the minimum z position for the homogeneous field.
 
double maxZ4BField {0}
 The values for the maximum z position for the homogeneous field.
 

Detailed Description

The BFieldComponentConstant class.

This class represents an homogeneous magnetic field.

Definition at line 24 of file BFieldComponentConstant.h.

Member Function Documentation

◆ calculate()

ROOT::Math::XYZVector calculate ( const ROOT::Math::XYZVector &  point) const
overridevirtual

Calculates the magnetic field vector at the specified space point.

Parameters
pointThe 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 XYZVector(0,0,0) if the space point lies outside the region described by the component.

Implements BFieldComponentAbs.

Definition at line 14 of file BFieldComponentConstant.cc.

15 {
16  if ((maxRadius4BField > 0.0 && maxRadius4BField < point.Rho()) ||
17  (point.Z() < minZ4BField || point.Z() > maxZ4BField)) return ROOT::Math::XYZVector(0, 0, 0);
18  return ROOT::Math::XYZVector(m_magneticField[0], m_magneticField[1], m_magneticField[2]);
19 }
double maxZ4BField
The values for the maximum z position for the homogeneous field.
double maxRadius4BField
The values for the maximum radius for the homogeneous field.
double m_magneticField[3]
The values for the homogeneous magnetic field vector.
double minZ4BField
The values for the minimum z position for the homogeneous field.

◆ initialize()

virtual void initialize ( void  )
inlinevirtualinherited

Initializes the magnetic field component.

This method should be used to open and load files containing the magnetic field data.

Reimplemented in BFieldComponentRadial, BFieldComponentQuad, BFieldComponentKlm1, BFieldComponentBeamline, and BFieldComponent3d.

Definition at line 45 of file BFieldComponentAbs.h.

◆ setMagneticFieldValues()

void setMagneticFieldValues ( double  x,
double  y,
double  z,
double  rmax,
double  zmin,
double  zmax 
)

Sets the values for the homogeneous magnetic field vector.

Parameters
xThe x component of the magnetic field vector.
yThe y component of the magnetic field vector.
zThe z component of the magnetic field vector.
rmaxMaximum radial coordinate.
zminMinimum z coordinate.
zmaxMaximum z coordinate.

Definition at line 22 of file BFieldComponentConstant.cc.

◆ terminate()

virtual void terminate ( void  )
inlinevirtualinherited

Terminates the magnetic field component.

This method should be used to close files that have been opened in the initialize() method.

Reimplemented in BFieldComponentRadial, BFieldComponentKlm1, BFieldComponentBeamline, and BFieldComponent3d.

Definition at line 66 of file BFieldComponentAbs.h.


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