Belle II Software light-2607-kasei
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
16namespace Belle2 {
21
35
36 public:
37
39 struct BFieldPoint {
40 double r;
41 double z;
42 };
43
46
48 virtual ~BFieldComponentRadial() override = default;
49
54 virtual void initialize() override;
55
62 virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector& point) const override;
67 void setMapFilename(const std::string& filename) { m_mapFilename = filename; };
68
74 void setMapSize(int sizeR, int sizeZ) { m_mapSize[0] = sizeR; m_mapSize[1] = sizeZ; }
75
82 void setMapRegionZ(double minZ, double maxZ, double offset) { m_mapRegionZ[0] = minZ; m_mapRegionZ[1] = maxZ; m_mapOffset = offset; }
83
89 void setMapRegionR(double minR, double maxR) { m_mapRegionR[0] = minR; m_mapRegionR[1] = maxR; }
90
96 void setGridPitch(double pitchR, double pitchZ) { m_gridPitchR = pitchR; m_gridPitchZ = pitchZ; }
97
98
106 void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
107 {
108 m_slotRMin = srmin, m_endyokeZMin = zyoke; m_gapHeight = gaph; m_ironPlateThickness = iront;
109 }
110
111 protected:
112
113 private:
114
115 std::string m_mapFilename{""};
116 std::vector<BFieldPoint> m_mapBuffer;
117 int m_mapSize[2] {0};
118 double m_mapRegionZ[2] {0};
119 double m_mapOffset{0};
120 double m_mapRegionR[2] {0};
121 double m_gridPitchR{0};
122 double m_gridPitchZ{0};
123 double m_igridPitchR{0};
124 double m_igridPitchZ{0};
125
126 double m_slotRMin{0};
127 double m_endyokeZMin{0};
128 double m_gapHeight{0};
130 double m_Layer{0};
131 double m_iLayer{0};
132 };
133
135} //end of namespace Belle2
BFieldComponentAbs()=default
The BFieldComponentAbs constructor.
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
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.
virtual ~BFieldComponentRadial() override=default
The BFieldComponentRadial destructor.
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.
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.