Belle II Software development
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 {
20 class BeamlineFieldMapInterpolation;
21
32
33 public:
34
37
40
45 virtual void initialize() override;
46
53 virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector& point) const override;
54
59 virtual void terminate() override;
60
69 bool isInRange(const ROOT::Math::XYZVector& point) const;
70
77
83 void setMapFilename(const std::string& filename_her, const std::string& filename_ler)
84 {
85 m_mapFilename_her = filename_her;
86 m_mapFilename_ler = filename_ler;
87 };
88
92 void setInterpolateFilename(const std::string& filename_her, const std::string& filename_ler)
93 {
94 m_interFilename_her = filename_her;
95 m_interFilename_ler = filename_ler;
96 };
97
104 void setMapRegionZ(double minZ, double maxZ, double offset = 0.)
105 {
106 m_mapRegionZ[0] = minZ;
107 m_mapRegionZ[1] = maxZ;
108 m_mapOffset = offset;
109 }
110
116 void setMapRegionR(double minR, double maxR)
117 {
118 m_mapRegionR[0] = minR;
119 m_mapRegionR[1] = maxR;
120 }
122 void setBeamAngle(double beamAngle)
123 {
124 sincos(beamAngle, &m_sinBeamCrossAngle, &m_cosBeamCrossAngle);
125 }
128 private:
130 std::string m_mapFilename_her{""};
132 std::string m_mapFilename_ler{""};
134 std::string m_interFilename_her{""};
136 std::string m_interFilename_ler{""};
138 double m_mapRegionZ[2] {0};
140 double m_mapOffset{0};
142 double m_mapRegionR[2] {0};
151 };
152
154} //end of namespace Belle2
The BFieldComponentAbs class.
The BFieldComponentBeamline class.
void setInterpolateFilename(const std::string &filename_her, const std::string &filename_ler)
Sets the filename of the map for interpolation.
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
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.
bool isInRange(const ROOT::Math::XYZVector &point) const
Check presence of beamline field at the specific space point in the detector coordinate frame.
virtual void terminate() override
Terminates the magnetic field component.
virtual ROOT::Math::XYZVector calculate(const ROOT::Math::XYZVector &point) const override
Calculates the magnetic field vector at the specified space point.
virtual ~BFieldComponentBeamline()
The BFieldComponentBeamline destructor.
static BFieldComponentBeamline & Instance()
BFieldComponentBeamline instance.
BFieldComponentBeamline()
The BFieldComponentBeamline constructor.
Abstract base class for different kinds of events.