File indexing completed on 2025-01-18 09:11:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/MagneticField/ScalableBFieldService.hpp"
0010
0011 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0012 #include "ActsExamples/MagneticField/ScalableBField.hpp"
0013
0014 #include <any>
0015 #include <cmath>
0016
0017 namespace {
0018 const std::string s_name = "ScalableBFieldService";
0019 }
0020
0021 namespace ActsExamples {
0022
0023 ScalableBFieldService::ScalableBFieldService(const Config& cfg,
0024 Acts::Logging::Level lvl)
0025 : m_cfg(cfg), m_logger(Acts::getDefaultLogger(s_name, lvl)) {}
0026
0027 const std::string& ScalableBFieldService::name() const {
0028 return s_name;
0029 }
0030
0031 ProcessCode ScalableBFieldService::decorate(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 }
0037
0038 }