Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScalableBField.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ScalableBField.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 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
10 
14 
15 namespace ActsExamples {
16 
20 };
21 
24  public:
25  struct Cache {
27 
30  scalor = mctx.get<const ScalableBFieldContext>().scalor;
31  }
32  };
33 
37  explicit ScalableBField(Acts::Vector3 B) : m_BField(std::move(B)) {}
38 
45  Acts::ActsScalar Bz = 0)
46  : m_BField(Bx, By, Bz) {}
47 
57  const Acts::Vector3& /*position*/,
58  MagneticFieldProvider::Cache& gCache) const override {
59  Cache& cache = gCache.get<Cache>();
61  }
62 
76  const Acts::Vector3& /*position*/, Acts::ActsMatrix<3, 3>& /*derivative*/,
77  MagneticFieldProvider::Cache& gCache) const override {
78  Cache& cache = gCache.get<Cache>();
80  }
81 
83  const Acts::MagneticFieldContext& mctx) const override {
84  return Acts::MagneticFieldProvider::Cache::make<Cache>(mctx);
85  }
86 
93  bool isInside(const Acts::Vector3& /*position*/) const { return true; }
94 
100  void setField(double Bx, double By, double Bz) { m_BField << Bx, By, Bz; }
101 
105  void setField(const Acts::Vector3& B) { m_BField = B; }
106 
107  private:
110 }; // namespace BField
111 
112 } // namespace ActsExamples