Belle II Software  release-05-01-25
BFieldComponentBeamline.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, Kazutaka. Sumisawa *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef BFIELDCOMPONENTBEAMLINE_H
12 #define BFIELDCOMPONENTBEAMLINE_H
13 
14 #include <geometry/bfieldmap/BFieldComponentAbs.h>
15 #include <string>
16 
17 namespace Belle2 {
23  class BeamlineFieldMapInterpolation;
24 
34  class BFieldComponentBeamline : public BFieldComponentAbs {
35 
36  public:
37 
40 
43 
48  virtual void initialize() override;
49 
56  virtual B2Vector3D calculate(const B2Vector3D& point) const override;
57 
62  virtual void terminate() override;
63 
72  bool isInRange(const B2Vector3D& point) const;
73 
80 
85  void setMapFilename(const std::string& filename_her, const std::string& filename_ler)
86  {
87  m_mapFilename_her = filename_her;
88  m_mapFilename_ler = filename_ler;
89  };
90 
94  void setInterpolateFilename(const std::string& filename_her, const std::string& filename_ler)
95  {
96  m_interFilename_her = filename_her;
97  m_interFilename_ler = filename_ler;
98  };
99 
106  void setMapRegionZ(double minZ, double maxZ, double offset = 0.)
107  {
108  m_mapRegionZ[0] = minZ;
109  m_mapRegionZ[1] = maxZ;
110  m_mapOffset = offset;
111  }
112 
118  void setMapRegionR(double minR, double maxR)
119  {
120  m_mapRegionR[0] = minR;
121  m_mapRegionR[1] = maxR;
122  }
124  void setBeamAngle(double beamAngle)
125  {
127  }
130  private:
132  std::string m_mapFilename_her{""};
134  std::string m_mapFilename_ler{""};
136  std::string m_interFilename_her{""};
138  std::string m_interFilename_ler{""};
140  double m_mapRegionZ[2] {0};
142  double m_mapOffset{0};
144  double m_mapRegionR[2] {0};
153  };
154 
156 } //end of namespace Belle2
157 
158 #endif /* BFIELDCOMPONENTBEAMLINE_H */
Belle2::BFieldComponentBeamline::~BFieldComponentBeamline
virtual ~BFieldComponentBeamline()
The BFieldComponentBeamline destructor.
Definition: BFieldComponentBeamline.cc:646
Belle2::BFieldComponentBeamline::initialize
virtual void initialize() override
Initializes the magnetic field component.
Definition: BFieldComponentBeamline.cc:638
Belle2::BFieldComponentBeamline::m_mapFilename_her
std::string m_mapFilename_her
Parameter to set Angle of the beam.
Definition: BFieldComponentBeamline.h:140
Belle2::BFieldComponentBeamline::m_interFilename_ler
std::string m_interFilename_ler
The filename of the map for interpolation.
Definition: BFieldComponentBeamline.h:146
Belle2::BFieldComponentBeamline::m_mapRegionR
double m_mapRegionR[2]
The min and max boundaries of the map region in r.
Definition: BFieldComponentBeamline.h:152
Belle2::BFieldComponentBeamline::setBeamAngle
void setBeamAngle(double beamAngle)
Parameter to set Map Region
Definition: BFieldComponentBeamline.h:132
Belle2::BFieldComponentBeamline::m_mapOffset
double m_mapOffset
Offset required because the accelerator group defines the Belle center as zero.
Definition: BFieldComponentBeamline.h:150
Belle2::BFieldComponentBeamline::m_ler
BeamlineFieldMapInterpolation * m_ler
Actual magnetic field interpolation object for LER.
Definition: BFieldComponentBeamline.h:160
Belle2::BFieldComponentBeamline::m_mapRegionZ
double m_mapRegionZ[2]
The min and max boundaries of the map region in z.
Definition: BFieldComponentBeamline.h:148
Belle2::B2Vector3< double >
Belle2::BFieldComponentBeamline::isInRange
bool isInRange(const B2Vector3D &point) const
Check presence of beamline field at the specific space point in the detector coordinate frame.
Definition: BFieldComponentBeamline.cc:652
Belle2::BFieldComponentBeamline::calculate
virtual B2Vector3D calculate(const B2Vector3D &point) const override
Calculates the magnetic field vector at the specified space point.
Definition: BFieldComponentBeamline.cc:663
Belle2::BFieldComponentBeamline::m_sinBeamCrossAngle
double m_sinBeamCrossAngle
The sin of the crossing angle of the beams
Definition: BFieldComponentBeamline.h:154
Belle2::BeamlineFieldMapInterpolation
The BeamlineFieldMapInterpolation class.
Definition: BFieldComponentBeamline.cc:287
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BFieldComponentBeamline::Instance
static BFieldComponentBeamline & Instance()
BFieldComponentBeamline instance.
Definition: BFieldComponentBeamline.cc:699
Belle2::BFieldComponentBeamline::terminate
virtual void terminate() override
Terminates the magnetic field component.
Definition: BFieldComponentBeamline.cc:687
Belle2::BFieldComponentBeamline::m_her
BeamlineFieldMapInterpolation * m_her
Actual magnetic field interpolation object for HER.
Definition: BFieldComponentBeamline.h:158
Belle2::BFieldComponentBeamline::setMapRegionR
void setMapRegionR(double minR, double maxR)
Sets the size of the magnetic field map.
Definition: BFieldComponentBeamline.h:126
Belle2::BFieldComponentBeamline::m_mapFilename_ler
std::string m_mapFilename_ler
The filename of the magnetic field map.
Definition: BFieldComponentBeamline.h:142
Belle2::BFieldComponentBeamline::BFieldComponentBeamline
BFieldComponentBeamline()
The BFieldComponentBeamline constructor.
Definition: BFieldComponentBeamline.cc:709
Belle2::BFieldComponentBeamline::setMapRegionZ
void setMapRegionZ(double minZ, double maxZ, double offset=0.)
Sets the size of the magnetic field map.
Definition: BFieldComponentBeamline.h:114
Belle2::BFieldComponentBeamline::m_interFilename_her
std::string m_interFilename_her
The filename of the map for interpolation.
Definition: BFieldComponentBeamline.h:144
Belle2::BFieldComponentBeamline::m_cosBeamCrossAngle
double m_cosBeamCrossAngle
The cos of the crossing angle of the beams
Definition: BFieldComponentBeamline.h:156
Belle2::BFieldComponentBeamline::setInterpolateFilename
void setInterpolateFilename(const std::string &filename_her, const std::string &filename_ler)
Sets the filename of the map for interpolation.
Definition: BFieldComponentBeamline.h:102
Belle2::BFieldComponentBeamline
The BFieldComponentBeamline class.
Definition: BFieldComponentBeamline.h:42
Belle2::BFieldComponentBeamline::setMapFilename
void setMapFilename(const std::string &filename_her, const std::string &filename_ler)
Sets the filename of the magnetic field map.
Definition: BFieldComponentBeamline.h:93