Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ScalableBFieldService.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ScalableBFieldService.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2019-2020 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include "
ActsExamples/MagneticField/ScalableBFieldService.hpp
"
10
11
#include "
Acts/MagneticField/MagneticFieldContext.hpp
"
12
#include "
ActsExamples/Framework/AlgorithmContext.hpp
"
13
#include "
ActsExamples/MagneticField/ScalableBField.hpp
"
14
15
#include <any>
16
#include <cmath>
17
18
namespace
{
19
const
std::string
s_name =
"ScalableBFieldService"
;
20
}
21
22
ActsExamples::ScalableBFieldService::ScalableBFieldService
(
23
const
Config
&
cfg
,
Acts::Logging::Level
lvl)
24
:
m_cfg
(cfg),
m_logger
(Acts::
getDefaultLogger
(s_name, lvl)) {}
25
26
const
std::string
&
ActsExamples::ScalableBFieldService::name
()
const
{
27
return
s_name;
28
}
29
30
ActsExamples::ProcessCode
ActsExamples::ScalableBFieldService::decorate
(
31
AlgorithmContext
& ctx) {
32
ScalableBFieldContext
magCtx
;
33
magCtx.
scalor
= std::pow(
m_cfg
.scalor, ctx.
eventNumber
);
34
ctx.
magFieldContext
= std::make_any<ScalableBFieldContext>(
magCtx
);
35
return
ProcessCode::SUCCESS
;
36
}
acts
blob
sPHENIX
Examples
Detectors
MagneticField
src
ScalableBFieldService.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:37
using
1.8.2 with
sPHENIX GitHub integration