Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MagneticFieldWrapper.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MagneticFieldWrapper.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 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 
12 
13 #include <memory>
14 
15 #include <G4MagneticField.hh>
16 
17 namespace Acts {
18 class MagneticFieldProvider;
19 }
20 
21 namespace ActsExamples {
22 
25 class MagneticFieldWrapper : public G4MagneticField {
26  public:
28  struct Config {
30  std::shared_ptr<const Acts::MagneticFieldProvider> magneticField = nullptr;
31  };
32 
38  std::unique_ptr<const Acts::Logger> logger =
39  Acts::getDefaultLogger("MagneticFieldWrapper",
41  ~MagneticFieldWrapper() override = default;
42 
48  void GetFieldValue(const G4double Point[4], G4double* Bfield) const final;
49 
50  protected:
52 
53  private:
55  const Acts::Logger& logger() const { return *m_logger; }
56 
58  std::unique_ptr<const Acts::Logger> m_logger;
59 };
60 
61 } // namespace ActsExamples