Belle II Software development
MagneticFieldComponent3D Class Referencefinal

Describe one component of the Geometry. More...

#include <MagneticFieldComponent3D.h>

Inheritance diagram for MagneticFieldComponent3D:
MagneticFieldComponent

Public Member Functions

 MagneticFieldComponent3D ()
 empty constructor for ROOT
 
 MagneticFieldComponent3D (double minR, double maxR, double minZ, double maxZ, int nR, int nPhi, int nZ, std::vector< ROOT::Math::XYZVector > &&fieldmap)
 Full constructor to create an object from data.
 
bool inside (const ROOT::Math::XYZVector &pos) const override
 return whether we are inside the active region for this component
 
ROOT::Math::XYZVector getField (const ROOT::Math::XYZVector &pos) const override
 return the field assuming we are inside the active region as returned by inside()
 
void setExclusive (bool exclusive)
 set the state of the exclusive flag
 
bool isExclusive () const
 returns whether the field is set to exclusive mode
 
 ClassDef (MagneticFieldComponent, 1)
 ROOT Dictionary.
 

Private Member Functions

ROOT::Math::XYZVector interpolate (unsigned int ir, unsigned int iphi, unsigned int iz, double wr, double wphi, double wz) const
 Linear interpolate the magnetic field inside a bin.
 
 ClassDefOverride (MagneticFieldComponent3D, 2)
 ROOT dictionary.
 

Private Attributes

float m_minR {0}
 minimal R=sqrt(x^2+y^2) for which this field is present
 
float m_maxR {0}
 maximal R=sqrt(x^2+y^2) for which this field is present
 
float m_minZ {0}
 minimal Z for which this field is present
 
float m_maxZ {0}
 maximal Z for which this field is present
 
int m_mapSize [3] {0}
 number of bins in r, phi and z
 
float m_gridPitch [3] {0}
 grid pitch in r, phi and z
 
float m_invgridPitch [3] {0}
 inverted grid pitch in r, phi and z
 
std::vector< ROOT::Math::XYZVector > m_bmap
 magnetic field strength
 
bool m_exclusive {false}
 whether or not the component is exclusive
 

Detailed Description

Describe one component of the Geometry.

Definition at line 22 of file MagneticFieldComponent3D.h.

Constructor & Destructor Documentation

◆ MagneticFieldComponent3D() [1/2]

empty constructor for ROOT

Definition at line 25 of file MagneticFieldComponent3D.h.

25: MagneticFieldComponent(false) {};
MagneticFieldComponent(bool exclusive)
Constructor.

◆ MagneticFieldComponent3D() [2/2]

MagneticFieldComponent3D ( double  minR,
double  maxR,
double  minZ,
double  maxZ,
int  nR,
int  nPhi,
int  nZ,
std::vector< ROOT::Math::XYZVector > &&  fieldmap 
)
inline

Full constructor to create an object from data.

Definition at line 27 of file MagneticFieldComponent3D.h.

29 :
30 MagneticFieldComponent(true), m_minR(minR), m_maxR(maxR), m_minZ(minZ), m_maxZ(maxZ), m_mapSize{nR, nPhi, nZ},
31 m_gridPitch{static_cast<float>((maxR - minR) / (nR - 1)), static_cast<float>(M_PI / (nPhi - 1)), static_cast<float>((maxZ - minZ) / (nZ - 1))},
32 m_invgridPitch{static_cast<float>(1. / m_gridPitch[0]), static_cast<float>(1. / m_gridPitch[1]), static_cast<float>(1. / m_gridPitch[2])},
33 m_bmap(fieldmap)
34 {}
float m_maxR
maximal R=sqrt(x^2+y^2) for which this field is present
float m_gridPitch[3]
grid pitch in r, phi and z
int m_mapSize[3]
number of bins in r, phi and z
float m_maxZ
maximal Z for which this field is present
std::vector< ROOT::Math::XYZVector > m_bmap
magnetic field strength
float m_invgridPitch[3]
inverted grid pitch in r, phi and z
float m_minZ
minimal Z for which this field is present
float m_minR
minimal R=sqrt(x^2+y^2) for which this field is present

Member Function Documentation

◆ inside()

bool inside ( const ROOT::Math::XYZVector &  pos) const
inlineoverridevirtual

return whether we are inside the active region for this component

Implements MagneticFieldComponent.

Definition at line 37 of file MagneticFieldComponent3D.h.

38 {
39 const float z = pos.Z();
40 if (z < m_minZ || z > m_maxZ) return false;
41 const float r = pos.Rho();
42 return (r >= m_minR && r <= m_maxR);
43 }

◆ isExclusive()

bool isExclusive ( ) const
inlineinherited

returns whether the field is set to exclusive mode

Definition at line 39 of file MagneticFieldComponent.h.

39{ return m_exclusive; }
bool m_exclusive
whether or not the component is exclusive

◆ setExclusive()

void setExclusive ( bool  exclusive)
inlineinherited

set the state of the exclusive flag

Definition at line 37 of file MagneticFieldComponent.h.

37{ m_exclusive = exclusive; }

Member Data Documentation

◆ m_bmap

std::vector<ROOT::Math::XYZVector> m_bmap
private

magnetic field strength

Definition at line 71 of file MagneticFieldComponent3D.h.

◆ m_exclusive

bool m_exclusive {false}
privateinherited

whether or not the component is exclusive

Definition at line 51 of file MagneticFieldComponent.h.

◆ m_gridPitch

float m_gridPitch[3] {0}
private

grid pitch in r, phi and z

Definition at line 67 of file MagneticFieldComponent3D.h.

◆ m_invgridPitch

float m_invgridPitch[3] {0}
private

inverted grid pitch in r, phi and z

Definition at line 69 of file MagneticFieldComponent3D.h.

◆ m_mapSize

int m_mapSize[3] {0}
private

number of bins in r, phi and z

Definition at line 65 of file MagneticFieldComponent3D.h.

◆ m_maxR

float m_maxR {0}
private

maximal R=sqrt(x^2+y^2) for which this field is present

Definition at line 59 of file MagneticFieldComponent3D.h.

◆ m_maxZ

float m_maxZ {0}
private

maximal Z for which this field is present

Definition at line 63 of file MagneticFieldComponent3D.h.

◆ m_minR

float m_minR {0}
private

minimal R=sqrt(x^2+y^2) for which this field is present

Definition at line 57 of file MagneticFieldComponent3D.h.

◆ m_minZ

float m_minZ {0}
private

minimal Z for which this field is present

Definition at line 61 of file MagneticFieldComponent3D.h.


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