EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NullBField.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file NullBField.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
12 
13 namespace Acts {
14 
17 class NullBField final {
18  public:
19  struct Cache {
21  Cache(std::reference_wrapper<const MagneticFieldContext> /*mcfg*/) {}
22  };
23 
25  NullBField() = default;
26 
34  Vector3D getField(const Vector3D& /*position*/) const { return m_BField; }
35 
44  Vector3D getField(const Vector3D& /*position*/, Cache& /*cache*/) const {
45  return m_BField;
46  }
47 
58  Vector3D getFieldGradient(const Vector3D& /*position*/,
59  ActsMatrixD<3, 3>& /*derivative*/) const {
60  return m_BField;
61  }
62 
74  Vector3D getFieldGradient(const Vector3D& /*position*/,
75  ActsMatrixD<3, 3>& /*derivative*/,
76  Cache& /*cache*/) const {
77  return m_BField;
78  }
79 
86  bool isInside(const Vector3D& /*position*/) const { return true; }
87 
88  private:
90  const Vector3D m_BField = Vector3D::Zero();
91 };
92 } // namespace Acts