Belle II Software development
|
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. | |
virtual ROOT::Math::XYZVector | calculate (const ROOT::Math::XYZVector &point) const override |
Calculates the magnetic field vector at the specified space point. | |
virtual void | terminate () override |
Terminates the magnetic field component. | |
void | setMapFilename (const std::string &filename) |
Sets the filename of the magnetic field map. | |
void | setMapSize (int sizeR, int sizePhi, int sizeZ) |
Sets the size of the magnetic field map. | |
void | setMapRegionZ (double minZ, double maxZ, double offset) |
Sets the size of the magnetic field map. | |
void | setMapRegionR (double minR, double maxR) |
Sets the size of the magnetic field map. | |
void | setGridPitch (double pitchR, double pitchPhi, double pitchZ) |
Sets the grid pitch of the magnetic field map. | |
void | setExcludeRegionZ (double minZ, double maxZ) |
Sets the size of the magnetic field map to exclude. | |
void | setExcludeRegionR (double minR, double maxR) |
Sets the size of the magnetic field map to exclude. | |
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. | |
void | mirrorPhi (bool mirrorPhi=0.) |
void | doInterpolation (bool interpolate=true) |
void | enableCoordinate (const std::string &mapEnable="rphiz") |
Option to reduce 3D to 2D map (in coordinates, NOT Br, Bphi, Bz components) | |
Private Member Functions | |
ROOT::Math::XYZVector | 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< ROOT::Math::XYZVector > | 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. | |
bool | m_mirrorPhi {true} |
Flag to indicate whether there is a region to exclude. | |
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 36 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 137 of file BFieldComponent3d.h.
|
inline |
Option 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 143 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.
|
private |
Interpolate the value of B-field between (ir, iphi, iz) and (ir+1, iphi+1, iz+1) using weights (wr, wphi, wz)
Definition at line 259 of file BFieldComponent3d.cc.
|
inline |
mirrorPhi | Flag to enable mirroring in phi about x-z plane |
Definition at line 132 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 126 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 116 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 109 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 102 of file BFieldComponent3d.h.
|
inline |
Sets the filename of the magnetic field map.
filename | The filename of the magnetic field map. |
Definition at line 71 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 94 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 87 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 79 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 |
The memory buffer for the magnetic field map.
Definition at line 156 of file BFieldComponent3d.h.
|
private |
The error Br, Bphi, Bz as a scale factor (B_new = m_errB * B_old).
Definition at line 184 of file BFieldComponent3d.h.
|
private |
The min and max boundaries of the region in r to apply error.
Definition at line 182 of file BFieldComponent3d.h.
|
private |
Flag to indicate whether there is a region to exclude.
>
Definition at line 178 of file BFieldComponent3d.h.
|
private |
The min and max boundaries of the excluded region in r.
Definition at line 176 of file BFieldComponent3d.h.
|
private |
The min and max boundaries of the excluded region in z.
Definition at line 174 of file BFieldComponent3d.h.
|
private |
The grid pitch in r,phi,z.
Definition at line 170 of file BFieldComponent3d.h.
|
private |
The inverted grid pitch in r,phi,z.
Definition at line 172 of file BFieldComponent3d.h.
|
private |
Flag to switch on/off interpolation >
Definition at line 160 of file BFieldComponent3d.h.
|
private |
Enable different dimension, "rphiz", "rphi", "phiz" or "rz" >
Definition at line 158 of file BFieldComponent3d.h.
|
private |
The filename of the magnetic field map.
Definition at line 154 of file BFieldComponent3d.h.
|
private |
Offset required because the accelerator group defines the Belle center as zero.
Definition at line 166 of file BFieldComponent3d.h.
|
private |
The min and max boundaries of the map region in r.
Definition at line 168 of file BFieldComponent3d.h.
|
private |
The min and max boundaries of the map region in z.
Definition at line 164 of file BFieldComponent3d.h.
|
private |
The size of the map in r, phi and z.
Definition at line 162 of file BFieldComponent3d.h.
|
private |
Flag to indicate whether there is a region to exclude.
>
Definition at line 180 of file BFieldComponent3d.h.