Belle II Software light-2607-kasei
BFieldComponentBeamline.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#include <string>
13
14namespace Belle2 {
21
32
33 public:
34
37
39 virtual ~BFieldComponentBeamline() override;
40
43
46
51 virtual void initialize() override;
52
59 virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector& point) const override;
68 bool isInRange(const ROOT::Math::XYZVector& point) const;
69
76
82 void setMapFilename(const std::string& filename_her, const std::string& filename_ler)
83 {
84 m_mapFilename_her = filename_her;
85 m_mapFilename_ler = filename_ler;
86 };
87
91 void setInterpolateFilename(const std::string& filename_her, const std::string& filename_ler)
92 {
93 m_interFilename_her = filename_her;
94 m_interFilename_ler = filename_ler;
95 };
96
103 void setMapRegionZ(double minZ, double maxZ, double offset = 0.)
104 {
105 m_mapRegionZ[0] = minZ;
106 m_mapRegionZ[1] = maxZ;
107 m_mapOffset = offset;
108 }
109
115 void setMapRegionR(double minR, double maxR)
116 {
117 m_mapRegionR[0] = minR;
118 m_mapRegionR[1] = maxR;
119 }
120
121 void setBeamAngle(double beamAngle)
122 {
123 sincos(beamAngle, &m_sinBeamCrossAngle, &m_cosBeamCrossAngle);
124 }
125
126
127 private:
129 std::string m_mapFilename_her{""};
131 std::string m_mapFilename_ler{""};
133 std::string m_interFilename_her{""};
135 std::string m_interFilename_ler{""};
137 double m_mapRegionZ[2] {0};
139 double m_mapOffset{0};
141 double m_mapRegionR[2] {0};
150 };
151
153} //end of namespace Belle2
BFieldComponentAbs()=default
The BFieldComponentAbs constructor.
void setInterpolateFilename(const std::string &filename_her, const std::string &filename_ler)
Sets the filename of the map for interpolation.
BFieldComponentBeamline(const BFieldComponentBeamline &)=delete
Singleton: copying is not allowed.
std::string m_mapFilename_ler
The filename of the magnetic field map.
void setMapRegionZ(double minZ, double maxZ, double offset=0.)
Sets the size of the magnetic field map.
BeamlineFieldMapInterpolation * m_ler
Actual magnetic field interpolation object for LER.
BeamlineFieldMapInterpolation * m_her
Actual magnetic field interpolation object for HER.
double m_sinBeamCrossAngle
The sin of the crossing angle of the beams.
double m_cosBeamCrossAngle
The cos of the crossing angle of the beams.
BFieldComponentBeamline & operator=(const BFieldComponentBeamline &)=delete
Singleton: assignment is not allowed.
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.
std::string m_interFilename_ler
The filename of the map for interpolation.
void setMapFilename(const std::string &filename_her, const std::string &filename_ler)
Sets the filename of the magnetic field map.
void setMapRegionR(double minR, double maxR)
Sets the size of the magnetic field map.
std::string m_mapFilename_her
Parameter to set Angle of the beam.
std::string m_interFilename_her
The filename of the map for interpolation.
double m_mapRegionR[2]
The min and max boundaries of the map region in r.
void setBeamAngle(double beamAngle)
Parameter to set Map Region.
The BeamlineFieldMapInterpolation class.
virtual void initialize() override
Initializes the magnetic field component.
virtual ~BFieldComponentBeamline() override
The BFieldComponentBeamline destructor.
bool isInRange(const ROOT::Math::XYZVector &point) const
Check presence of beamline field at the specific space point in the detector coordinate frame.
virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector &point) const override
Calculates the magnetic field vector at the specified space point.
static BFieldComponentBeamline & Instance()
BFieldComponentBeamline instance.
BFieldComponentBeamline()
The BFieldComponentBeamline constructor.
Abstract base class for different kinds of events.