File indexing completed on 2025-08-06 08:10:42
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/MagneticField/ScalableBFieldService.hpp"
0010
0011 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0012 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0013 #include "ActsExamples/MagneticField/ScalableBField.hpp"
0014
0015 #include <any>
0016 #include <cmath>
0017
0018 namespace {
0019 const std::string s_name = "ScalableBFieldService";
0020 }
0021
0022 ActsExamples::ScalableBFieldService::ScalableBFieldService(
0023 const Config& cfg, Acts::Logging::Level lvl)
0024 : m_cfg(cfg), m_logger(Acts::getDefaultLogger(s_name, lvl)) {}
0025
0026 const std::string& ActsExamples::ScalableBFieldService::name() const {
0027 return s_name;
0028 }
0029
0030 ActsExamples::ProcessCode ActsExamples::ScalableBFieldService::decorate(
0031 AlgorithmContext& ctx) {
0032 ScalableBFieldContext magCtx;
0033 magCtx.scalor = std::pow(m_cfg.scalor, ctx.eventNumber);
0034 ctx.magFieldContext = std::make_any<ScalableBFieldContext>(magCtx);
0035 return ProcessCode::SUCCESS;
0036 }