Belle II Software  release-06-01-15
GFGeant4Field.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 #pragma once
9 #include <framework/geometry/BFieldManager.h>
10 #include <framework/gearbox/Unit.h>
11 #include <genfit/AbsBField.h>
12 
16 public:
23  GFGeant4Field(): genfit::AbsBField() {}
24 
30  TVector3 get(const TVector3& position) const override
31  {
32  static double conversion{1. / Belle2::Unit::kGauss};
33  return Belle2::BFieldManager::getField(position) * conversion;
34  }
35 };
36 
static const double kGauss
[kilogauss]
Definition: Unit.h:123
Interface of the Belle II B-field with GenFit.
Definition: GFGeant4Field.h:15
TVector3 get(const TVector3 &position) const override
Getter for the magnetic field.
Definition: GFGeant4Field.h:30
GFGeant4Field()
Constructor.
Definition: GFGeant4Field.h:23
Abstract Interface to magnetic fields in GENFIT.
Definition: AbsBField.h:36
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Defines for I/O streams used for error and debug printing.