ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MagneticField
MagFieldElements
MagFieldElements
AtlasFieldCache.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
11
12
#ifndef MAGFIELDCONDITIONS_ATLASMTFIELDCACHE_H
13
#define MAGFIELDCONDITIONS_ATLASMTFIELDCACHE_H 1
14
15
// MagField includes
16
#include "
CxxUtils/restrict.h
"
17
#include "GaudiKernel/ServiceHandle.h"
18
#include "GaudiKernel/SystemOfUnits.h"
19
#include "
MagFieldElements/AtlasFieldMap.h
"
20
#include "
MagFieldElements/BFieldCache.h
"
21
#include "
MagFieldElements/BFieldCacheZR.h
"
22
#include "
MagFieldElements/BFieldCond.h
"
23
#include "
MagFieldElements/BFieldMeshZR.h
"
24
#include "
MagFieldElements/BFieldZone.h
"
25
26
#include <memory>
27
namespace
MagField
{
28
42
class
AtlasFieldCache
43
{
44
public
:
45
AtlasFieldCache
() =
default
;
49
AtlasFieldCache
(
double
solFieldScale,
50
double
torFieldScale,
51
const
AtlasFieldMap
* fieldMap);
52
56
AtlasFieldCache
&
operator=
(
AtlasFieldCache
&& other) =
default
;
57
AtlasFieldCache
(
AtlasFieldCache
&& other) =
default
;
58
AtlasFieldCache
(
const
AtlasFieldCache
& other) =
default
;
59
AtlasFieldCache
&
operator=
(
const
AtlasFieldCache
& other) =
default
;
60
~AtlasFieldCache
() =
default
;
61
66
void
getField
(
const
double
*
ATH_RESTRICT
xyz
,
67
double
*
ATH_RESTRICT
bxyz,
68
double
*
ATH_RESTRICT
deriv =
nullptr
);
69
77
void
getFieldZR
(
const
double
*
ATH_RESTRICT
xyz
,
78
double
*
ATH_RESTRICT
bxyz,
79
double
*
ATH_RESTRICT
deriv =
nullptr
);
80
82
bool
solenoidOn
()
const
;
83
bool
toroidOn
()
const
;
84
85
private
:
86
88
bool
fillFieldCache
(
double
z
,
double
r
,
double
phi
);
90
bool
fillFieldCacheZR
(
double
z
,
double
r
);
91
93
double
m_solScale
{ 1 };
94
double
m_torScale
{ 1 };
95
double
m_scaleToUse
{ 1 };
96
97
// Solenoid zone ID number - needed to set solScale.
98
// Assumes only one Solenoid zone.
99
int
m_solZoneId
{ -1 };
100
102
const
AtlasFieldMap
*
m_fieldMap
{
nullptr
};
103
108
const
BFieldZone
*
m_zone3d
{
nullptr
};
109
113
BFieldCache
m_cache3d
;
114
117
const
std::vector<BFieldCond>*
m_cond
{
nullptr
};
118
122
const
BFieldMeshZR
*
m_meshZR
{
nullptr
};
123
125
BFieldCacheZR
m_cacheZR
{};
126
};
127
128
}
// namespace MagField
129
#include "
AtlasFieldCache.icc
"
130
#endif
// MAGFIELDCONDITIONS_ATLASMTFIELDCACHE_H
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
AtlasFieldCache.icc
AtlasFieldMap.h
BFieldCacheZR.h
BFieldCache.h
BFieldCond.h
BFieldMeshZR.h
BFieldZone.h
xyz
#define xyz
z
#define z
BFieldCacheZR
Definition
BFieldCacheZR.h:22
BFieldCache
BFieldCache.h.
Definition
BFieldCache.h:25
BFieldMeshZR
Definition
BFieldMeshZR.h:24
BFieldZone
Definition
BFieldZone.h:29
MagField::AtlasFieldCache::m_solZoneId
int m_solZoneId
Definition
AtlasFieldCache.h:99
MagField::AtlasFieldCache::solenoidOn
bool solenoidOn() const
status of the magnets
MagField::AtlasFieldCache::AtlasFieldCache
AtlasFieldCache(const AtlasFieldCache &other)=default
MagField::AtlasFieldCache::operator=
AtlasFieldCache & operator=(AtlasFieldCache &&other)=default
Move-able and copy-able.
MagField::AtlasFieldCache::m_zone3d
const BFieldZone * m_zone3d
A zone of the full 3d field.
Definition
AtlasFieldCache.h:108
MagField::AtlasFieldCache::fillFieldCacheZR
bool fillFieldCacheZR(double z, double r)
fill Z-R cache for solenoid */
MagField::AtlasFieldCache::~AtlasFieldCache
~AtlasFieldCache()=default
MagField::AtlasFieldCache::AtlasFieldCache
AtlasFieldCache(AtlasFieldCache &&other)=default
MagField::AtlasFieldCache::AtlasFieldCache
AtlasFieldCache()=default
MagField::AtlasFieldCache::m_torScale
double m_torScale
Definition
AtlasFieldCache.h:94
MagField::AtlasFieldCache::m_scaleToUse
double m_scaleToUse
Definition
AtlasFieldCache.h:95
MagField::AtlasFieldCache::m_fieldMap
const AtlasFieldMap * m_fieldMap
handle to the magnetic field map - not owned
Definition
AtlasFieldCache.h:102
MagField::AtlasFieldCache::m_cache3d
BFieldCache m_cache3d
Full 3d field cell/cache This will be a cell inside a 3d field zone.
Definition
AtlasFieldCache.h:113
MagField::AtlasFieldCache::operator=
AtlasFieldCache & operator=(const AtlasFieldCache &other)=default
MagField::AtlasFieldCache::m_cacheZR
BFieldCacheZR m_cacheZR
Fast 2d field cell/cache.
Definition
AtlasFieldCache.h:125
MagField::AtlasFieldCache::fillFieldCache
bool fillFieldCache(double z, double r, double phi)
fill given magnetic field zone */
MagField::AtlasFieldCache::m_cond
const std::vector< BFieldCond > * m_cond
Pointer to the conductors in the current field zone (to compute Biot-Savart component) Owned by Atlas...
Definition
AtlasFieldCache.h:117
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition
AtlasFieldCache.cxx:42
MagField::AtlasFieldCache::getFieldZR
void getFieldZR(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field valaue on the z-r plane at given position works only inside the solenoid.
Definition
AtlasFieldCache.cxx:86
MagField::AtlasFieldCache::AtlasFieldCache
AtlasFieldCache(double solFieldScale, double torFieldScale, const AtlasFieldMap *fieldMap)
constructor to setup with field scale and magnetic field map for first access to field
MagField::AtlasFieldCache::m_solScale
double m_solScale
magnetic field scales from currents
Definition
AtlasFieldCache.h:93
MagField::AtlasFieldCache::m_meshZR
const BFieldMeshZR * m_meshZR
fast 2d map made of one zone assuming phi/roatational symmetry Owned by AtlasFieldMap.
Definition
AtlasFieldCache.h:122
MagField::AtlasFieldCache::toroidOn
bool toroidOn() const
MagField::AtlasFieldMap
Map for magnetic field.
Definition
AtlasFieldMap.h:39
r
int r
Definition
globals.cxx:22
MagField
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
Definition
ForwardRegionFieldSvc.h:27
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