Belle II Software  release-06-02-00
BFieldComponentRadial.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <geometry/bfieldmap/BFieldComponentAbs.h>
12 
13 #include <string>
14 
15 namespace Belle2 {
34 
35  public:
36 
38  struct BFieldPoint {
39  double r;
40  double z;
41  };
42 
44  BFieldComponentRadial() = default;
45 
47  virtual ~BFieldComponentRadial() = default;
48 
53  virtual void initialize() override;
54 
61  virtual B2Vector3D calculate(const B2Vector3D& point) const override;
62 
67  virtual void terminate() override;
68 
73  void setMapFilename(const std::string& filename) { m_mapFilename = filename; };
74 
80  void setMapSize(int sizeR, int sizeZ) { m_mapSize[0] = sizeR; m_mapSize[1] = sizeZ; }
81 
88  void setMapRegionZ(double minZ, double maxZ, double offset) { m_mapRegionZ[0] = minZ; m_mapRegionZ[1] = maxZ; m_mapOffset = offset; }
89 
95  void setMapRegionR(double minR, double maxR) { m_mapRegionR[0] = minR; m_mapRegionR[1] = maxR; }
96 
102  void setGridPitch(double pitchR, double pitchZ) { m_gridPitchR = pitchR; m_gridPitchZ = pitchZ; }
103 
104 
112  void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
113  {
114  m_slotRMin = srmin, m_endyokeZMin = zyoke; m_gapHeight = gaph; m_ironPlateThickness = iront;
115  }
116 
117  protected:
118 
119  private:
120 
121  std::string m_mapFilename{""};
122  std::vector<BFieldPoint> m_mapBuffer;
123  int m_mapSize[2] {0};
124  double m_mapRegionZ[2] {0};
125  double m_mapOffset{0};
126  double m_mapRegionR[2] {0};
127  double m_gridPitchR{0};
128  double m_gridPitchZ{0};
129  double m_igridPitchR{0};
130  double m_igridPitchZ{0};
132  double m_slotRMin{0};
133  double m_endyokeZMin{0};
134  double m_gapHeight{0};
136  double m_Layer{0};
137  double m_iLayer{0};
138  };
139 
141 } //end of namespace Belle2
The BFieldComponentAbs class.
The BFieldComponentRadial class.
double m_iLayer
reciprocal of height of the layer (gap + iron plate) in endyoke
double m_slotRMin
minimum radius for the gap in endyoke
virtual void initialize() override
Initializes the magnetic field component.
double m_gridPitchZ
The grid pitch in z.
void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
Sets prameter for EKLM.
std::string m_mapFilename
The filename of the magnetic field map.
double m_Layer
height of the layer (gap + iron plate) in endyoke
virtual void terminate() override
Terminates the magnetic field component.
double m_mapRegionZ[2]
The min and max boundaries of the map region in z.
double m_mapOffset
Offset required because the accelerator group defines the Belle center as zero.
double m_ironPlateThickness
thickness of iron plate in endyoke
void setMapRegionR(double minR, double maxR)
Sets the size of the magnetic field map.
void setGridPitch(double pitchR, double pitchZ)
Sets the grid pitch of the magnetic field map.
void setMapFilename(const std::string &filename)
Sets the filename of the magnetic field map.
double m_gridPitchR
The grid pitch in r.
virtual ~BFieldComponentRadial()=default
The BFieldComponentRadial destructor.
double m_mapRegionR[2]
The min and max boundaries of the map region in r.
void setMapSize(int sizeR, int sizeZ)
Sets the size of the magnetic field map.
virtual B2Vector3D calculate(const B2Vector3D &point) const override
Calculates the magnetic field vector at the specified space point.
double m_endyokeZMin
minimum Z of endyoke
std::vector< BFieldPoint > m_mapBuffer
The memory buffer for the magnetic field map.
BFieldComponentRadial()=default
The BFieldComponentRadial constructor.
void setMapRegionZ(double minZ, double maxZ, double offset)
Sets the size of the magnetic field map.
double m_gapHeight
height of the gap in endyoke
double m_igridPitchZ
The reciprocal of grid pitch in z.
int m_mapSize[2]
The size of the map in r and z.
double m_igridPitchR
The reciprocal of grid pitch in r.
Abstract base class for different kinds of events.
double r
Magnetic field in r direction.
double z
Magnetic field in z direction.