Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 08:28:01

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
0013 
0014 #include <memory>
0015 
0016 namespace dd4hep {
0017 class OverlayedField;
0018 }
0019 
0020 namespace Acts {
0021 
0022 class DD4hepFieldAdapter : public Acts::MagneticFieldProvider {
0023   struct Cache {};
0024 
0025  public:
0026   explicit DD4hepFieldAdapter(dd4hep::OverlayedField field);
0027 
0028   MagneticFieldProvider::Cache makeCache(
0029       const Acts::MagneticFieldContext& mctx) const override;
0030 
0031   Result<Vector3> getField(const Vector3& position,
0032                            MagneticFieldProvider::Cache& cache) const override;
0033 
0034  private:
0035   double m_fieldConversionFactor;
0036   double m_lengthConversionFactor;
0037   std::unique_ptr<dd4hep::OverlayedField> m_field;
0038 };
0039 
0040 }  // namespace Acts