Belle II Software  release-08-01-10
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 #include <vector>
15 
16 namespace Belle2 {
35 
36  public:
37 
39  struct BFieldPoint {
40  double r;
41  double z;
42  };
43 
45  BFieldComponentRadial() = default;
46 
48  virtual ~BFieldComponentRadial() = default;
49 
54  virtual void initialize() override;
55 
62  virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector& point) const override;
63 
68  virtual void terminate() override;
69 
74  void setMapFilename(const std::string& filename) { m_mapFilename = filename; };
75 
81  void setMapSize(int sizeR, int sizeZ) { m_mapSize[0] = sizeR; m_mapSize[1] = sizeZ; }
82 
89  void setMapRegionZ(double minZ, double maxZ, double offset) { m_mapRegionZ[0] = minZ; m_mapRegionZ[1] = maxZ; m_mapOffset = offset; }
90 
96  void setMapRegionR(double minR, double maxR) { m_mapRegionR[0] = minR; m_mapRegionR[1] = maxR; }
97 
103  void setGridPitch(double pitchR, double pitchZ) { m_gridPitchR = pitchR; m_gridPitchZ = pitchZ; }
104 
105 
113  void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
114  {
115  m_slotRMin = srmin, m_endyokeZMin = zyoke; m_gapHeight = gaph; m_ironPlateThickness = iront;
116  }
117 
118  protected:
119 
120  private:
121 
122  std::string m_mapFilename{""};
123  std::vector<BFieldPoint> m_mapBuffer;
124  int m_mapSize[2] {0};
125  double m_mapRegionZ[2] {0};
126  double m_mapOffset{0};
127  double m_mapRegionR[2] {0};
128  double m_gridPitchR{0};
129  double m_gridPitchZ{0};
130  double m_igridPitchR{0};
131  double m_igridPitchZ{0};
133  double m_slotRMin{0};
134  double m_endyokeZMin{0};
135  double m_gapHeight{0};
137  double m_Layer{0};
138  double m_iLayer{0};
139  };
140 
142 } //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 parameter 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.
virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector &point) const override
Calculates the magnetic field vector at the specified space point.
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.
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.