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
SolenoidBField.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SolenoidBField.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 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
#pragma once
10
11
#include "
Acts/Definitions/Algebra.hpp
"
12
#include "
Acts/MagneticField/MagneticFieldContext.hpp
"
13
#include "
Acts/MagneticField/MagneticFieldProvider.hpp
"
14
#include "
Acts/Utilities/Result.hpp
"
15
16
#include <cstddef>
17
#include <functional>
18
19
namespace
Acts {
20
22
//
70
class
SolenoidBField
final :
public
MagneticFieldProvider
{
71
public
:
72
struct
Cache
{
76
Cache
(
const
MagneticFieldContext
& mctx) { (void)mctx; }
77
};
78
80
struct
Config
{
82
double
radius
;
85
double
length
;
87
size_t
nCoils
;
90
double
bMagCenter
;
91
};
92
96
SolenoidBField
(
Config
config
);
97
101
Vector2
getField
(
const
Vector2
&
position
)
const
;
102
104
MagneticFieldProvider::Cache
makeCache
(
105
const
MagneticFieldContext
& mctx)
const override
;
106
110
Vector3
getField
(
const
Vector3
&
position
)
const
;
111
113
Result<Vector3>
getField
(
const
Vector3
&
position
,
114
MagneticFieldProvider::Cache
& cache)
const override
;
115
120
Result<Vector3>
getFieldGradient
(
121
const
Vector3
&
position
,
ActsMatrix<3, 3>
& derivative,
122
MagneticFieldProvider::Cache
& cache)
const override
;
123
124
private
:
125
Config
m_cfg
;
126
double
m_scale
;
127
double
m_dz
;
128
double
m_R2
;
129
130
Vector2
multiCoilField
(
const
Vector2
&
pos
,
double
scale)
const
;
131
132
Vector2
singleCoilField
(
const
Vector2
&
pos
,
double
scale)
const
;
133
134
double
B_r
(
const
Vector2
&
pos
,
double
scale)
const
;
135
136
double
B_z
(
const
Vector2
&
pos
,
double
scale)
const
;
137
138
double
k2
(
double
r
,
double
z
)
const
;
139
};
140
141
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
MagneticField
SolenoidBField.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:33
using
1.8.2 with
sPHENIX GitHub integration