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
NullBField.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file NullBField.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2016-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
#include "
Acts/Definitions/Algebra.hpp
"
11
#include "
Acts/MagneticField/MagneticFieldContext.hpp
"
12
#include "
Acts/MagneticField/MagneticFieldProvider.hpp
"
13
14
namespace
Acts {
15
18
class
NullBField
final :
public
MagneticFieldProvider
{
19
public
:
20
struct
Cache
{
22
Cache
(
const
MagneticFieldContext
&
/*mcfg*/
) {}
23
};
24
26
NullBField
() =
default
;
27
32
Result<Vector3>
getField
(
const
Vector3
&
position
,
33
MagneticFieldProvider::Cache
& cache)
const override
{
34
(void)position;
35
(void)cache;
36
return
Result<Vector3>::success
(
m_BField
);
37
}
38
45
Result<Vector3>
getFieldGradient
(
46
const
Vector3
&
position
,
ActsMatrix<3, 3>
& derivative,
47
MagneticFieldProvider::Cache
& cache)
const override
{
48
(void)position;
49
(void)derivative;
50
(void)cache;
51
return
Result<Vector3>::success
(
m_BField
);
52
}
53
55
Acts::MagneticFieldProvider::Cache
makeCache
(
56
const
Acts::MagneticFieldContext
& mctx)
const override
{
57
return
Acts::MagneticFieldProvider::Cache::make<Cache>(mctx);
58
}
59
66
bool
isInside
(
const
Vector3
&
position
)
const
{
67
(void)position;
68
return
true
;
69
}
70
71
private
:
73
const
Vector3
m_BField
= Vector3::Zero();
74
};
75
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
MagneticField
NullBField.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:33
using
1.8.2 with
sPHENIX GitHub integration