Belle II Software  release-06-02-00
BFieldComponentKlm1.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 {
40  double r;
42  double z;
43  };
44 
46  BFieldComponentKlm1() = default;
47 
49  virtual ~BFieldComponentKlm1() = default;
50 
55  virtual void initialize() override;
56 
63  virtual B2Vector3D calculate(const B2Vector3D& point) const override;
64 
68  virtual void terminate() override;
69 
74  void setMapFilename(const std::string& filename) { m_mapFilename = filename; };
75 
80  void setNLayers(int b, int e) {m_nBarrelLayers = b; m_nEndcapLayers = e;}
81 
87  void setBarrelRegion(double minR, double maxZ, double offset) { m_barrelRMin = minR; m_barrelZMax = maxZ; m_mapOffset = offset; }
88 
93  void setEndcapRegion(double minR, double minZ) { m_endcapRMin = minR; m_endcapZMin = minZ;}
94 
101  void setLayerParam(double bgapl0, double bironth, double egap, double dl)
102  {
104  m_endcapGapHeight = egap; m_dLayer = dl;
105  }
106 
107  private:
109  double m_cospi8{cos(M_PI / 8)};
111  double m_cos3pi8{cos(3 * M_PI / 8)};
113  double m_cospi4{cos(M_PI / 4)};
114 
116  std::string m_mapFilename{""};
118  double m_mapOffset{0};
119 
121  double m_barrelRMin{0};
123  double m_barrelZMax{0};
125  double m_endcapRMin{0};
127  double m_endcapZMin{0};
128 
133 
137  double m_endcapGapHeight{0};
139  double m_dLayer{0};
142 
145  double m_barrelZBreakpoint[15] {0};
148  double m_barrelRBreakpoint[15] {0};
151  double m_barrelFieldZSlope1[15] {0};
154  double m_barrelFieldZIntercept1[15] {0};
157  double m_barrelFieldZSlope2[15] {0};
160  double m_barrelFieldZIntercept2[15] {0};
163  double m_barrelFieldRSlope1[15] {0};
166  double m_barrelFieldRIntercept1[15] {0};
169  double m_barrelFieldRSlope2[15] {0};
172  double m_barrelFieldRIntercept2[15] {0};
173 
178  double m_endcapZBreakpoint[2][15][5] {{{0}}};
183  double m_endcapRBreakpoint[2][15][5] {{{0}}};
184 
189  double m_endcapFieldZSlope[2][15][5] {{{0}}};
194  double m_endcapFieldZIntercept[2][15][5] {{{0}}};
199  double m_endcapFieldRSlope[2][15][5] {{{0}}};
204  double m_endcapFieldRIntercept[2][15][5] {{{0}}};
205  };
206 
208 } //end of namespace Belle2
The BFieldComponentAbs class.
The Bfieldcomponentklm1 class.
double m_endcapFieldZSlope[2][15][5]
Slopes of the linear approximation of Bz in the endcap.
double m_endcapGapHeight
Gap height of BKLM layer1-14.
double m_barrelFieldRIntercept1[15]
Intercept of Br before the beackpoint in the barrel.
int m_nBarrelLayers
The number of layers per 1 sector for BKLM.
virtual void initialize() override
Initializes the magnetic field Component.
double m_barrelFieldZSlope1[15]
Slope of Bz before the breakpoint in the barrel.
double m_endcapFieldRIntercept[2][15][5]
Intercepts of the linear approximation of Br in the endcap.
double m_barrelZMax
The maximum boundaries of BKLM region in r.
double m_barrelIronThickness
Thickness of Barrel iron plate.
double m_barrelFieldZIntercept1[15]
Intercept of Bz before the beackpoint in the barrel.
std::string m_mapFilename
The filename of the magnetic field map.
virtual void terminate() override
Terminates the magnetic field Component.
void setNLayers(int b, int e)
Sets the number of barrel and endcap layers.
double m_mapOffset
Offset required because the accelerator group defines the Belle center as zero.
double m_endcapRMin
The minimum boundaries of EKLM region in r.
void setLayerParam(double bgapl0, double bironth, double egap, double dl)
Set the layer parameters @bgapl0 barrel gap height for layer 0 @bironth barrel iron thickness @egap e...
void setMapFilename(const std::string &filename)
Sets the filename of the magnetic field map.
double m_barrelFieldRSlope2[15]
Slope of Br after the breakpoint in the barrel.
double m_endcapRBreakpoint[2][15][5]
r position of breakpoints between linear functions in the endcap First index indicates whether or not...
double m_barrelRBreakpoint[15]
z position of breakpoints between the two linear approximations of Br in the barrel.
BFieldComponentKlm1()=default
The BFieldComponentklm1 constructor.
double m_barrelGapHeightLayer0
Gap height of BKLM layer0.
void setBarrelRegion(double minR, double maxZ, double offset)
Sets the dimensions of the barrel region.
double m_barrelRMin
The minimum boundaries of BKLM region in r.
virtual B2Vector3D calculate(const B2Vector3D &point) const override
Calculates the magnetic field vector at the specified space point.
double m_endcapFieldRSlope[2][15][5]
Slopes of the linear approximation of Br in the endcap.
int m_nEndcapLayers
The number of layers per 1 sector for EKLM.
void setEndcapRegion(double minR, double minZ)
Set the dimensions of the endcap region.
double m_barrelFieldZIntercept2[15]
Intercept of Bz after the beackpoint in the barrel.
double m_barrelZBreakpoint[15]
z position of breakpoints between the two linear approximations of Bz in the barrel.
double m_barrelFieldZSlope2[15]
Slope of Bz after the breakpoint in the barrel.
double m_barrelFieldRSlope1[15]
Slope of Br before the breakpoint in the barrel.
double m_endcapZBreakpoint[2][15][5]
z position of breakpoints between linear functions in the endcap.
virtual ~BFieldComponentKlm1()=default
The BFieldComponentklm1 destructor.
double m_endcapFieldZIntercept[2][15][5]
Intercepts of the linear approximation of Bz in the endcap.
double m_endcapZMin
The minimum boundaries of EKLM region in z.
double m_barrelFieldRIntercept2[15]
Intercept of Br after the beackpoint in the barrel.
double m_dLayer
deppth of BKLM module?
Abstract base class for different kinds of events.
Trivial struct representing rz coordinate.
double r
r coordinate of the point
double z
z coordinate of the point