Analysis Software
Documentation for sPHENIX simulation 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
13 
14 namespace Acts {
15 
18 class NullBField final : public MagneticFieldProvider {
19  public:
20  struct Cache {
22  Cache(const MagneticFieldContext& /*mcfg*/) {}
23  };
24 
26  NullBField() = default;
27 
33  MagneticFieldProvider::Cache& cache) const override {
34  (void)position;
35  (void)cache;
37  }
38 
46  const Vector3& position, ActsMatrix<3, 3>& derivative,
47  MagneticFieldProvider::Cache& cache) const override {
48  (void)position;
49  (void)derivative;
50  (void)cache;
52  }
53 
56  const Acts::MagneticFieldContext& mctx) const override {
57  return Acts::MagneticFieldProvider::Cache::make<Cache>(mctx);
58  }
59 
66  bool isInside(const Vector3& position) const {
67  (void)position;
68  return true;
69  }
70 
71  private:
73  const Vector3 m_BField = Vector3::Zero();
74 };
75 } // namespace Acts