Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:45

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 #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 }  // namespace ActsExamples