Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:41

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
0012 
0013 #include <memory>
0014 
0015 namespace dd4hep {
0016 class OverlayedField;
0017 }
0018 
0019 namespace Acts {
0020 
0021 class DD4hepFieldAdapter : public Acts::MagneticFieldProvider {
0022   struct Cache {};
0023 
0024  public:
0025   DD4hepFieldAdapter(dd4hep::OverlayedField field);
0026 
0027   MagneticFieldProvider::Cache makeCache(
0028       const Acts::MagneticFieldContext& mctx) const override;
0029 
0030   Result<Vector3> getField(const Vector3& position,
0031                            MagneticFieldProvider::Cache& cache) const override;
0032 
0033   Result<Vector3> getFieldGradient(
0034       const Vector3& position, ActsMatrix<3, 3>& derivative,
0035       MagneticFieldProvider::Cache& cache) const override;
0036 
0037  private:
0038   double m_fieldConversionFactor;
0039   double m_lengthConversionFactor;
0040   std::unique_ptr<dd4hep::OverlayedField> m_field;
0041 };
0042 
0043 }  // namespace Acts