EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SolenoidBField.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SolenoidBField.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-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
10 
13 
14 namespace Acts {
15 
17 //
66  public:
67  struct Cache {
71  Cache(std::reference_wrapper<const MagneticFieldContext> /*mcfg*/) {}
72  };
73 
75  struct Config {
77  double radius;
80  double length;
82  size_t nCoils;
85  double bMagCenter;
86  };
87 
92 
98  Vector3D getField(const Vector3D& position) const;
99 
104  Vector3D getField(const Vector3D& position, Cache& /*cache*/) const;
105 
109  Vector2D getField(const Vector2D& position) const;
110 
120  ActsMatrixD<3, 3>& /*derivative*/) const;
121 
132  ActsMatrixD<3, 3>& /*derivative*/,
133  Cache& /*cache*/) const;
134 
135  private:
137  double m_scale;
138  double m_dz;
139  double m_R2;
140 
141  Vector2D multiCoilField(const Vector2D& pos, double scale) const;
142 
143  Vector2D singleCoilField(const Vector2D& pos, double scale) const;
144 
145  double B_r(const Vector2D& pos, double scale) const;
146 
147  double B_z(const Vector2D& pos, double scale) const;
148 
149  double k2(double r, double z) const;
150 };
151 
152 } // namespace Acts