![]() |
Belle II Software
release-06-01-15
|
The BFieldComponent3d class. More...
#include <BFieldComponent3d.h>
Public Member Functions | |
BFieldComponent3d ()=default | |
The BFieldComponent3d constructor. | |
virtual | ~BFieldComponent3d ()=default |
The BFieldComponent3d destructor. | |
virtual void | initialize () override |
Initializes the magnetic field component. More... | |
virtual B2Vector3D | calculate (const B2Vector3D &point) const override |
Calculates the magnetic field vector at the specified space point. More... | |
virtual void | terminate () override |
Terminates the magnetic field component. More... | |
void | setMapFilename (const std::string &filename) |
Sets the filename of the magnetic field map. More... | |
void | setMapSize (int sizeR, int sizePhi, int sizeZ) |
Sets the size of the magnetic field map. More... | |
void | setMapRegionZ (double minZ, double maxZ, double offset) |
Sets the size of the magnetic field map. More... | |
void | setMapRegionR (double minR, double maxR) |
Sets the size of the magnetic field map. More... | |
void | setGridPitch (double pitchR, double pitchPhi, double pitchZ) |
Sets the grid pitch of the magnetic field map. More... | |
void | setExcludeRegionZ (double minZ, double maxZ) |
Sets the size of the magnetic field map to exclude. More... | |
void | setExcludeRegionR (double minR, double maxR) |
Sets the size of the magnetic field map to exclude. More... | |
void | setErrorRegionR (double minR=-1., double maxR=-1., double errBr=0.0, double errBphi=0.0, double errBz=0.0) |
Sets the size of the magnetic field map to apply error on B. More... | |
void | mirrorPhi (bool mirrorPhi=0.) |
void | doInterpolation (bool interpolate=true) |
void | enableCoordinate (const std::string &mapEnable="rphiz") |
Optino to reduce 3D to 2D map (in coordinates, NOT Br, Bphi, Bz components) More... | |
Private Member Functions | |
B2Vector3D | interpolate (unsigned int ir, unsigned int iphi, unsigned int iz, double wr, double wphi, double wz) const |
Interpolate the value of B-field between (ir, iphi, iz) and (ir+1, iphi+1, iz+1) using weights (wr, wphi, wz) | |
Private Attributes | |
std::string | m_mapFilename {""} |
The filename of the magnetic field map. | |
std::vector< B2Vector3F > | m_bmap |
The memory buffer for the magnetic field map. | |
std::string | m_mapEnable {"rphiz"} |
Enable different dimension, "rphiz", "rphi", "phiz" or "rz" > | |
bool | m_interpolate {true} |
Flag to switch on/off interpolation > | |
int | m_mapSize [3] |
The size of the map in r, phi and z. | |
double | m_mapRegionZ [2] {0} |
The min and max boundaries of the map region in z. | |
double | m_mapOffset {0} |
Offset required because the accelerator group defines the Belle center as zero. | |
double | m_mapRegionR [2] {0} |
The min and max boundaries of the map region in r. | |
double | m_gridPitch [3] {0} |
The grid pitch in r,phi,z. | |
double | m_igridPitch [3] {0} |
The inverted grid pitch in r,phi,z. | |
double | m_exRegionZ [2] {0} |
The min and max boundaries of the excluded region in z. | |
double | m_exRegionR [2] {0} |
The min and max boundaries of the excluded region in r. | |
bool | m_exRegion {true} |
Flag to indicate whether there is a region to exclude. More... | |
bool | m_mirrorPhi {true} |
Flag to indicate whether there is a region to exclude. More... | |
double | m_errRegionR [2] {0} |
The min and max boundaries of the region in r to apply error. | |
double | m_errB [3] {0} |
The error Br, Bphi, Bz as a scale factor (B_new = m_errB * B_old). | |
The BFieldComponent3d class.
This class represents a 3d magnetic field map. The magnetic field map is stored as a grid in cylindrical coordinates. It is defined by a minimum radius and a maximum radius, a minimum z and a maximum z value (phi is assumed to be in 360 degrees range, option to mirror about the x-y plane exist), a pitch size in both, r, z and phi and the number of grid points. The ZOffset is used to account for the fact that the acceleration group defines 0 to be in the center of the detector, while the detector group defines the IP to be the center. The filename points to the zip file containing the magnetic field map.
Definition at line 35 of file BFieldComponent3d.h.
|
overridevirtual |
Calculates the magnetic field vector at the specified space point.
point | The space point in [cm] at which the magnetic field vector should be calculated. |
Implements BFieldComponentAbs.
Definition at line 187 of file BFieldComponent3d.cc.
|
inline |
interpolate | Flag to switch on/off interpolation |
Definition at line 136 of file BFieldComponent3d.h.
|
inline |
Optino to reduce 3D to 2D map (in coordinates, NOT Br, Bphi, Bz components)
mapEnable | List of dimensions to enable: "rphiz", "rphi", "phiz" or "rz" |
Definition at line 142 of file BFieldComponent3d.h.
|
overridevirtual |
Initializes the magnetic field component.
This method opens the magnetic field map file.
Reimplemented from BFieldComponentAbs.
Definition at line 27 of file BFieldComponent3d.cc.
|
inline |
mirrorPhi | Flag to enable mirroring in phi about x-z plane |
Definition at line 131 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map to apply error on B.
minR | The left (min) border of the magnetic field map region in r [m] -> [cm]. |
maxR | The right (max) border of the magnetic field map region in r [m] -> [cm]. |
errBr | The size of the error on Br, Br_new = errBr*Br [fraction]. |
errBphi | The size of the error on Bphi, Bphi_new = errBphi*Bphi [fraction]. |
errBz | The size of the error on Bz, Bz_new = errBz*Bz [fraction]. |
Definition at line 125 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map to exclude.
minR | The left (min) border of the magnetic field map region in r [m] -> [cm]. |
maxR | The right (max) border of the magnetic field map region in r [m] -> [cm]. |
Definition at line 115 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map to exclude.
minZ | The left (min) border of the magnetic field map region in z [m] -> [cm]. |
maxZ | The right (max) border of the magnetic field map region in z [m] -> [cm]. |
Definition at line 108 of file BFieldComponent3d.h.
|
inline |
Sets the grid pitch of the magnetic field map.
pitchR | The pitch of the grid in r [m] -> [cm]. |
pitchPhi | The pitch of the grid in phi [degrees] -> [rad] converted back to degrees in the code. |
pitchZ | The pitch of the grid in z [m] -> [cm]. |
Definition at line 101 of file BFieldComponent3d.h.
|
inline |
Sets the filename of the magnetic field map.
filename | The filname of the magnetic field map. |
Definition at line 70 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map.
minR | The left (min) border of the magnetic field map region in r [m] -> [cm]. |
maxR | The right (max) border of the magnetic field map region in r [m] -> [cm]. |
Definition at line 93 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map.
minZ | The left (min) border of the magnetic field map region in z [m] -> [cm]. |
maxZ | The right (max) border of the magnetic field map region in z [m] -> [cm]. |
offset | The offset in z [m] -> [cm] which is required because the accelerator group defines the Belle center as zero. |
Definition at line 86 of file BFieldComponent3d.h.
|
inline |
Sets the size of the magnetic field map.
sizeR | The number of points in the r direction. |
sizePhi | The number of points in the phi direction. |
sizeZ | The number of points in the z direction. |
Definition at line 78 of file BFieldComponent3d.h.
|
overridevirtual |
Terminates the magnetic field component.
This method closes the magnetic field map file.
Reimplemented from BFieldComponentAbs.
Definition at line 255 of file BFieldComponent3d.cc.
|
private |
Flag to indicate whether there is a region to exclude.
>
Definition at line 177 of file BFieldComponent3d.h.
|
private |
Flag to indicate whether there is a region to exclude.
>
Definition at line 179 of file BFieldComponent3d.h.