Belle II Software light-2406-ragdoll
|
The BFieldComponentQuad class. More...
#include <BFieldComponentQuad.h>
Classes | |
struct | ApertPoint |
Aperture data structure. More... | |
struct | irange_t |
start and stop indicies to narrow search in array More... | |
struct | ParamPoint3 |
Quadrupole lense data structure. More... | |
struct | range_t |
Range data structure. More... | |
Public Types | |
typedef std::vector< range_t > | ranges_t |
vector of Range data structure. | |
Public Member Functions | |
BFieldComponentQuad ()=default | |
The BFieldComponentQuad constructor. | |
virtual | ~BFieldComponentQuad ()=default |
The BFieldComponentQuad 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. | |
double | getApertureHER (double s) const |
Returns the HER beam pipe aperture at given position. | |
double | getApertureLER (double s) const |
Returns the LER beam pipe aperture at given position. | |
void | setMapFilename (const std::string &filenameHER, const std::string &filenameLER, const std::string &filenameHERleak) |
Sets the filename of the magnetic field map. | |
void | setApertFilename (const std::string &filenameHER, const std::string &filenameLER) |
Sets the filename of aperture definition file. | |
void | setMapSize (int sizeHER, int sizeLER, int sizeHERleak) |
Sets the size of the magnetic field map. | |
void | setApertSize (int sizeHER, int sizeLER) |
Sets the size of the aperture map. | |
virtual void | terminate () |
Terminates the magnetic field component. | |
Private Member Functions | |
int | getRange (double a, const ranges_t &b) const |
Search for range occupied by optics since now only for ranges are present use linear search. | |
double | getAperture (double s, std::vector< ApertPoint >::const_iterator hint) const |
Returns the beam pipe aperture at given position. | |
Private Attributes | |
std::string | m_mapFilenameHER {""} |
Magnetic field map of HER | |
std::string | m_mapFilenameLER {""} |
Magnetic field map of LER | |
std::string | m_mapFilenameHERleak {""} |
The filename of the magnetic field map. | |
std::string | m_apertFilenameHER {""} |
Filename of the aperture for HER. | |
std::string | m_apertFilenameLER {""} |
The filename of the aperture for LER. | |
int | m_mapSizeHER {0} |
The size of the map for HER. | |
int | m_mapSizeLER {0} |
The size of the map for LER. | |
int | m_mapSizeHERleak {0} |
The size of the map. | |
int | m_apertSizeHER {0} |
The size of the aperture for HER. | |
int | m_apertSizeLER {0} |
The size of the aperture for LER. | |
double | m_maxr2 {0} |
The square of maximal aperture for fast rejection. | |
ranges_t | m_ranges_her |
ranges vector for HER | |
ranges_t | m_ranges_ler |
ranges vector for LER | |
std::vector< ApertPoint > | m_ah |
The the aperture parameters for HER. | |
std::vector< ApertPoint > | m_al |
The the aperture parameters for LER. | |
std::vector< ParamPoint3 > | m_h3 |
The map for HER. | |
std::vector< ParamPoint3 > | m_l3 |
The map for LER. | |
std::vector< std::vector< ParamPoint3 >::const_iterator > | m_offset_pp_her |
The vector of pointer to accelerate search in maps for her. | |
std::vector< std::vector< ParamPoint3 >::const_iterator > | m_offset_pp_ler |
The vector of pointer to accelerate search in maps for ler. | |
std::vector< std::vector< ApertPoint >::const_iterator > | m_offset_ap_her |
The vector of pointer to accelerate search in aperture for her. | |
std::vector< std::vector< ApertPoint >::const_iterator > | m_offset_ap_ler |
The vector of pointer to accelerate search in aperture for ler. | |
The BFieldComponentQuad class.
This class represents a magnetic field map from quadrupole magnets QC[1/2]*. Only the field from QC[1/2]* inside beam pipes is described. Leak field inside the beam pipe from the quadruple magnet on the other beam line is also included, however, leak field outside both beam pipe are not described. Therefore, we should turn on this field component only when we use TouschekTURTLEReader and Synchrotron radiation study, which needs accurate propagation of beam particles. Field strength are calculated from the magnet parameters (K0,K1,SK0,SK1) used in accelerator simulation. These parameters are provided for each 4cm slice in the beam direction.
Definition at line 35 of file BFieldComponentQuad.h.
vector of Range data structure.
Definition at line 44 of file BFieldComponentQuad.h.
|
overridevirtual |
Calculates the magnetic field vector at the specified space point.
point | The space point in Cartesian coordinates (x,y,z) in [cm] at which the magnetic field vector should be calculated. |
Implements BFieldComponentAbs.
Definition at line 347 of file BFieldComponentQuad.cc.
|
inlineprivate |
Returns the beam pipe aperture at given position.
Small number of points again linear search.
s | The position in beam-axis coordinate. |
hint | Start search from this position |
Definition at line 340 of file BFieldComponentQuad.cc.
double getApertureHER | ( | double | s | ) | const |
Returns the HER beam pipe aperture at given position.
s | The position in HER beam-axis coordinate. |
Definition at line 318 of file BFieldComponentQuad.cc.
double getApertureLER | ( | double | s | ) | const |
Returns the LER beam pipe aperture at given position.
s | The position in LER beam-axis coordinate. |
Definition at line 325 of file BFieldComponentQuad.cc.
|
inlineprivate |
Search for range occupied by optics since now only for ranges are present use linear search.
a | coordinate along beamline |
b | vector with ranges with sentinel at the beginning and the end |
Definition at line 332 of file BFieldComponentQuad.cc.
|
overridevirtual |
Initializes the magnetic field component.
This method opens the magnetic field map file.
Magnetic field data structure.
< s in [m]
< element length in [m]
< dipole component in [dimensionless]
< quadrupole component in [1/m]
< skew dipole component in [dimensionless]
< skew quadrupole component in [1/m]
< rotation in [radian]
< horizontal displacement in [m]
< vertical displacement in [m]
fold rotation to/from lense frame to a single matrix multiplicaton and vector addition
in | map with angle inside |
p0 | normalization constant |
In case several maps in the same position we can simply sum up all matricies since magnetic field has superposition properties as well as keep only one vector of parameters for each beamline
v | first map |
a | map to add to the first map |
calculate ranges where quadrupole lenses continously fill the beamline
v | lense vector |
associate ranges with the vector of aperture points
ap | the vector of aperture points |
v | the vector of ranges |
associate ranges with the vector of lenses
ap | the vector of lenses |
v | the vector of ranges |
Reimplemented from BFieldComponentAbs.
Definition at line 43 of file BFieldComponentQuad.cc.
|
inline |
Sets the filename of aperture definition file.
filenameHER | The filename of the aperture definition for HER. |
filenameLER | The filename of the aperture definition for LER. |
Definition at line 153 of file BFieldComponentQuad.h.
|
inline |
Sets the size of the aperture map.
sizeHER | The number of points in the HER aperture file. |
sizeLER | The number of points in the LER aperture file. |
Definition at line 168 of file BFieldComponentQuad.h.
|
inline |
Sets the filename of the magnetic field map.
filenameHER | The filename of the magnetic field map for HER. |
filenameLER | The filename of the magnetic field map for LER. |
filenameHERleak | The filename of the magnetic field map for HER (leak field from LER). |
Definition at line 146 of file BFieldComponentQuad.h.
|
inline |
Sets the size of the magnetic field map.
sizeHER | The number of points in the HER field parameters. |
sizeLER | The number of points in the LER field parameters. |
sizeHERleak | The number of points in the HER field parameters (leak field from LER). |
Definition at line 161 of file BFieldComponentQuad.h.
|
inlinevirtualinherited |
Terminates the magnetic field component.
This method should be used to close files that have been opened in the initialize() method.
Reimplemented in BFieldComponent3d, BFieldComponentBeamline, BFieldComponentKlm1, and BFieldComponentRadial.
Definition at line 66 of file BFieldComponentAbs.h.
|
private |
The the aperture parameters for HER.
Definition at line 214 of file BFieldComponentQuad.h.
|
private |
The the aperture parameters for LER.
Definition at line 216 of file BFieldComponentQuad.h.
|
private |
Filename of the aperture for HER.
Definition at line 194 of file BFieldComponentQuad.h.
|
private |
The filename of the aperture for LER.
Definition at line 196 of file BFieldComponentQuad.h.
|
private |
The size of the aperture for HER.
Definition at line 204 of file BFieldComponentQuad.h.
|
private |
The size of the aperture for LER.
Definition at line 206 of file BFieldComponentQuad.h.
|
private |
The map for HER.
Definition at line 219 of file BFieldComponentQuad.h.
|
private |
The map for LER.
Definition at line 221 of file BFieldComponentQuad.h.
|
private |
Magnetic field map of HER
Definition at line 188 of file BFieldComponentQuad.h.
|
private |
The filename of the magnetic field map.
Definition at line 192 of file BFieldComponentQuad.h.
|
private |
Magnetic field map of LER
Definition at line 190 of file BFieldComponentQuad.h.
|
private |
The size of the map for HER.
Definition at line 198 of file BFieldComponentQuad.h.
|
private |
The size of the map.
Definition at line 202 of file BFieldComponentQuad.h.
|
private |
The size of the map for LER.
Definition at line 200 of file BFieldComponentQuad.h.
|
private |
The square of maximal aperture for fast rejection.
Definition at line 208 of file BFieldComponentQuad.h.
|
private |
The vector of pointer to accelerate search in aperture for her.
Definition at line 228 of file BFieldComponentQuad.h.
|
private |
The vector of pointer to accelerate search in aperture for ler.
Definition at line 230 of file BFieldComponentQuad.h.
|
private |
The vector of pointer to accelerate search in maps for her.
Definition at line 224 of file BFieldComponentQuad.h.
|
private |
The vector of pointer to accelerate search in maps for ler.
Definition at line 226 of file BFieldComponentQuad.h.
|
private |
ranges vector for HER
Definition at line 210 of file BFieldComponentQuad.h.
|
private |
ranges vector for LER
Definition at line 211 of file BFieldComponentQuad.h.