File indexing completed on 2025-01-18 09:27:41
0001
0002
0003
0004
0005
0006
0007
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 }