ATLAS Offline Software
Loading...
Searching...
No Matches
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"
25
26#include <memory>
27namespace MagField {
28
43{
44public:
45 AtlasFieldCache() = default;
49 AtlasFieldCache(double solFieldScale,
50 double torFieldScale,
51 const AtlasFieldMap* fieldMap);
52
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
85private:
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
114
117 const std::vector<BFieldCond>* m_cond{ nullptr };
118
122 const BFieldMeshZR* m_meshZR{ nullptr };
123
126};
127
128} // namespace MagField
129#include "AtlasFieldCache.icc"
130#endif // MAGFIELDCONDITIONS_ATLASMTFIELDCACHE_H
Scalar phi() const
phi method
#define xyz
#define z
BFieldCache.h.
Definition BFieldCache.h:25
bool solenoidOn() const
status of the magnets
AtlasFieldCache(const AtlasFieldCache &other)=default
AtlasFieldCache & operator=(AtlasFieldCache &&other)=default
Move-able and copy-able.
const BFieldZone * m_zone3d
A zone of the full 3d field.
bool fillFieldCacheZR(double z, double r)
fill Z-R cache for solenoid *‍/
AtlasFieldCache(AtlasFieldCache &&other)=default
const AtlasFieldMap * m_fieldMap
handle to the magnetic field map - not owned
BFieldCache m_cache3d
Full 3d field cell/cache This will be a cell inside a 3d field zone.
AtlasFieldCache & operator=(const AtlasFieldCache &other)=default
BFieldCacheZR m_cacheZR
Fast 2d field cell/cache.
bool fillFieldCache(double z, double r, double phi)
fill given magnetic field zone *‍/
const std::vector< BFieldCond > * m_cond
Pointer to the conductors in the current field zone (to compute Biot-Savart component) Owned by Atlas...
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,...
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.
AtlasFieldCache(double solFieldScale, double torFieldScale, const AtlasFieldMap *fieldMap)
constructor to setup with field scale and magnetic field map for first access to field
double m_solScale
magnetic field scales from currents
const BFieldMeshZR * m_meshZR
fast 2d map made of one zone assuming phi/roatational symmetry Owned by AtlasFieldMap.
Map for magnetic field.
int r
Definition globals.cxx:22
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Macro wrapping the nonstandard restrict keyword.
#define ATH_RESTRICT
Definition restrict.h:31