ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MagneticField
MagFieldElements
MagFieldElements
BFieldCacheZR.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//
6
// BFieldCacheZR.h
7
//
8
// Cashe of one bin of the magnetic field map.
9
// Defined by ranges in z, r, and the (Bz, Br) vectors at the 4 corners of the
10
// "bin".
11
//
12
// Masahiro Morii, Harvard University
13
//
14
#ifndef BFIELDCACHEZR_H
15
#define BFIELDCACHEZR_H
16
17
#include "
MagFieldElements/BFieldVectorZR.h
"
18
#include "
CxxUtils/restrict.h
"
19
#include <cmath>
20
21
class
BFieldCacheZR
22
{
23
public
:
24
// invalidate this cache, so that inside() will fail
25
void
invalidate
();
26
// set the z, r range that defines the bin
27
void
setRange
(
double
zmin,
double
zmax,
double
rmin,
double
rmax);
28
// set the field values at each corner (rescale for current scale factor)
29
void
setField
(
int
i,
const
BFieldVectorZR
& field,
double
scaleFactor = 1.0);
30
// set the multiplicative factor for the field vectors
31
// test if (z, r) is inside this bin
32
bool
inside
(
double
z
,
double
r
)
const
;
33
// interpolate the field and return B[3].
34
// also compute field derivatives if deriv[9] is given.
35
void
getB
(
const
double
*
ATH_RESTRICT
xyz
,
36
double
r
,
37
double
*
ATH_RESTRICT
B,
38
double
*
ATH_RESTRICT
deriv =
nullptr
)
const
;
39
40
private
:
41
// default unphysical boundaries, so that inside() will fail
42
double
m_zmin
{0},
m_zmax
{-1};
// bin range in z
43
double
m_rmin
{0},
m_rmax
{-1};
// bin range in r
44
double
m_invz
{-1},
m_invr
{-1};
// 1/(bin size) in z, r
45
double
m_field
[2][4] = {{0}};
// (Bz,Br) at 4 corners of the bin
46
};
47
#include "
MagFieldElements/BFieldCacheZR.icc
"
48
#endif
BFieldCacheZR.icc
BFieldVectorZR.h
xyz
#define xyz
z
#define z
BFieldCacheZR
Definition
BFieldCacheZR.h:22
BFieldCacheZR::getB
void getB(const double *ATH_RESTRICT xyz, double r, double *ATH_RESTRICT B, double *ATH_RESTRICT deriv=nullptr) const
Definition
BFieldCacheZR.cxx:9
BFieldCacheZR::m_rmax
double m_rmax
Definition
BFieldCacheZR.h:43
BFieldCacheZR::m_zmax
double m_zmax
Definition
BFieldCacheZR.h:42
BFieldCacheZR::setField
void setField(int i, const BFieldVectorZR &field, double scaleFactor=1.0)
BFieldCacheZR::invalidate
void invalidate()
BFieldCacheZR::m_rmin
double m_rmin
Definition
BFieldCacheZR.h:43
BFieldCacheZR::inside
bool inside(double z, double r) const
BFieldCacheZR::m_field
double m_field[2][4]
Definition
BFieldCacheZR.h:45
BFieldCacheZR::m_invr
double m_invr
Definition
BFieldCacheZR.h:44
BFieldCacheZR::m_invz
double m_invz
Definition
BFieldCacheZR.h:44
BFieldCacheZR::setRange
void setRange(double zmin, double zmax, double rmin, double rmax)
BFieldCacheZR::m_zmin
double m_zmin
Definition
BFieldCacheZR.h:42
BFieldVectorZR
Definition
BFieldVectorZR.h:19
r
int r
Definition
globals.cxx:22
restrict.h
Macro wrapping the nonstandard restrict keyword.
ATH_RESTRICT
#define ATH_RESTRICT
Definition
restrict.h:31
Generated on
for ATLAS Offline Software by
1.17.0