Belle II Software  release-05-01-25
BFieldComponentRadial.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2011 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll, Hiroyuki Nakayama *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef BFIELDCOMPONENTRADIAL_H
12 #define BFIELDCOMPONENTRADIAL_H
13 
14 #include <geometry/bfieldmap/BFieldComponentAbs.h>
15 
16 #include <string>
17 
18 namespace Belle2 {
36  class BFieldComponentRadial : public BFieldComponentAbs {
37 
38  public:
39 
41  struct BFieldPoint {
42  double r;
43  double z;
44  };
45 
47  BFieldComponentRadial() = default;
48 
50  virtual ~BFieldComponentRadial() = default;
51 
56  virtual void initialize() override;
57 
64  virtual B2Vector3D calculate(const B2Vector3D& point) const override;
65 
70  virtual void terminate() override;
71 
76  void setMapFilename(const std::string& filename) { m_mapFilename = filename; };
77 
83  void setMapSize(int sizeR, int sizeZ) { m_mapSize[0] = sizeR; m_mapSize[1] = sizeZ; }
84 
91  void setMapRegionZ(double minZ, double maxZ, double offset) { m_mapRegionZ[0] = minZ; m_mapRegionZ[1] = maxZ; m_mapOffset = offset; }
92 
98  void setMapRegionR(double minR, double maxR) { m_mapRegionR[0] = minR; m_mapRegionR[1] = maxR; }
99 
105  void setGridPitch(double pitchR, double pitchZ) { m_gridPitchR = pitchR; m_gridPitchZ = pitchZ; }
106 
107 
115  void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
116  {
117  m_slotRMin = srmin, m_endyokeZMin = zyoke; m_gapHeight = gaph; m_ironPlateThickness = iront;
118  }
119 
120  protected:
121 
122  private:
123 
124  std::string m_mapFilename{""};
125  std::vector<BFieldPoint> m_mapBuffer;
126  int m_mapSize[2] {0};
127  double m_mapRegionZ[2] {0};
128  double m_mapOffset{0};
129  double m_mapRegionR[2] {0};
130  double m_gridPitchR{0};
131  double m_gridPitchZ{0};
132  double m_igridPitchR{0};
133  double m_igridPitchZ{0};
135  double m_slotRMin{0};
136  double m_endyokeZMin{0};
137  double m_gapHeight{0};
139  double m_Layer{0};
140  double m_iLayer{0};
141  };
142 
144 } //end of namespace Belle2
145 
146 #endif /* BFIELDCOMPONENTRADIAL_H */
Belle2::BFieldComponentRadial::m_Layer
double m_Layer
height of the layer (gap + iron plate) in endyoke
Definition: BFieldComponentRadial.h:147
Belle2::BFieldComponentRadial::setMapSize
void setMapSize(int sizeR, int sizeZ)
Sets the size of the magnetic field map.
Definition: BFieldComponentRadial.h:91
Belle2::BFieldComponentRadial::m_gridPitchZ
double m_gridPitchZ
The grid pitch in z.
Definition: BFieldComponentRadial.h:139
Belle2::BFieldComponentRadial::calculate
virtual B2Vector3D calculate(const B2Vector3D &point) const override
Calculates the magnetic field vector at the specified space point.
Definition: BFieldComponentRadial.cc:88
Belle2::BFieldComponentRadial::m_igridPitchR
double m_igridPitchR
The reciprocal of grid pitch in r.
Definition: BFieldComponentRadial.h:140
Belle2::BFieldComponentRadial::setKlmParameters
void setKlmParameters(double srmin, double zyoke, double gaph, double iront)
Sets prameter for EKLM.
Definition: BFieldComponentRadial.h:123
Belle2::BFieldComponentRadial::initialize
virtual void initialize() override
Initializes the magnetic field component.
Definition: BFieldComponentRadial.cc:27
Belle2::BFieldComponentRadial::setMapFilename
void setMapFilename(const std::string &filename)
Sets the filename of the magnetic field map.
Definition: BFieldComponentRadial.h:84
Belle2::BFieldComponentRadial::m_gridPitchR
double m_gridPitchR
The grid pitch in r.
Definition: BFieldComponentRadial.h:138
Belle2::BFieldComponentRadial::m_mapSize
int m_mapSize[2]
The size of the map in r and z.
Definition: BFieldComponentRadial.h:134
Belle2::BFieldComponentRadial::BFieldPoint::r
double r
Magnetic field in r direction.
Definition: BFieldComponentRadial.h:50
Belle2::BFieldComponentRadial::setGridPitch
void setGridPitch(double pitchR, double pitchZ)
Sets the grid pitch of the magnetic field map.
Definition: BFieldComponentRadial.h:113
Belle2::BFieldComponentRadial::m_mapOffset
double m_mapOffset
Offset required because the accelerator group defines the Belle center as zero.
Definition: BFieldComponentRadial.h:136
Belle2::B2Vector3< double >
Belle2::BFieldComponentRadial::m_iLayer
double m_iLayer
reciprocal of height of the layer (gap + iron plate) in endyoke
Definition: BFieldComponentRadial.h:148
Belle2::BFieldComponentRadial::~BFieldComponentRadial
virtual ~BFieldComponentRadial()=default
The BFieldComponentRadial destructor.
Belle2::BFieldComponentRadial::BFieldComponentRadial
BFieldComponentRadial()=default
The BFieldComponentRadial constructor.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BFieldComponentRadial::m_mapRegionZ
double m_mapRegionZ[2]
The min and max boundaries of the map region in z.
Definition: BFieldComponentRadial.h:135
Belle2::BFieldComponentRadial::m_slotRMin
double m_slotRMin
minimum radius for the gap in endyoke
Definition: BFieldComponentRadial.h:143
Belle2::BFieldComponentRadial::m_gapHeight
double m_gapHeight
height of the gap in endyoke
Definition: BFieldComponentRadial.h:145
Belle2::BFieldComponentRadial::setMapRegionR
void setMapRegionR(double minR, double maxR)
Sets the size of the magnetic field map.
Definition: BFieldComponentRadial.h:106
Belle2::BFieldComponentRadial::setMapRegionZ
void setMapRegionZ(double minZ, double maxZ, double offset)
Sets the size of the magnetic field map.
Definition: BFieldComponentRadial.h:99
Belle2::BFieldComponentRadial::m_ironPlateThickness
double m_ironPlateThickness
thickness of iron plate in endyoke
Definition: BFieldComponentRadial.h:146
Belle2::BFieldComponentRadial::m_mapFilename
std::string m_mapFilename
The filename of the magnetic field map.
Definition: BFieldComponentRadial.h:132
Belle2::BFieldComponentRadial::BFieldPoint::z
double z
Magnetic field in z direction.
Definition: BFieldComponentRadial.h:51
Belle2::BFieldComponentRadial::m_mapRegionR
double m_mapRegionR[2]
The min and max boundaries of the map region in r.
Definition: BFieldComponentRadial.h:137
Belle2::BFieldComponentRadial::m_mapBuffer
std::vector< BFieldPoint > m_mapBuffer
The memory buffer for the magnetic field map.
Definition: BFieldComponentRadial.h:133
Belle2::BFieldComponentRadial::terminate
virtual void terminate() override
Terminates the magnetic field component.
Definition: BFieldComponentRadial.cc:166
Belle2::BFieldComponentRadial::m_endyokeZMin
double m_endyokeZMin
minimum Z of endyoke
Definition: BFieldComponentRadial.h:144
Belle2::BFieldComponentRadial::m_igridPitchZ
double m_igridPitchZ
The reciprocal of grid pitch in z.
Definition: BFieldComponentRadial.h:141