Map for magnetic field.
More...
#include <AtlasFieldMap.h>
Map for magnetic field.
- Author
- R.D.Schaffer -at- cern.ch
Definition at line 38 of file AtlasFieldMap.h.
◆ AtlasFieldMap() [1/3]
MagField::AtlasFieldMap::AtlasFieldMap |
( |
| ) |
|
|
default |
◆ ~AtlasFieldMap()
MagField::AtlasFieldMap::~AtlasFieldMap |
( |
| ) |
|
|
inline |
◆ AtlasFieldMap() [2/3]
◆ AtlasFieldMap() [3/3]
◆ buildLUT()
void MagField::AtlasFieldMap::buildLUT |
( |
| ) |
|
|
private |
Definition at line 226 of file AtlasFieldMap.cxx.
230 for (
int j = 0; j < 3; j++) {
231 for (
unsigned i = 0;
i <
m_zone.size();
i++) {
235 for (
int k = 0;
k < 2;
k++) {
237 if (j == 2 &&
e[
k] >
M_PI) {
251 for (
unsigned k = 1;
k <
m_edge[j].size();
k++) {
262 for (
unsigned i = 0;
i <
m_zone.size();
i++) {
263 for (
unsigned k = 0;
k <
m_edge[j].size();
k++) {
274 for (
int j = 0; j < 3; j++) {
278 for (
unsigned i = 0;
i <
m_edge[j].size() - 1;
i++) {
288 for (
int i = 0;
i <
n;
i++) {
304 for (
int iz = 0; iz <
m_nz; iz++) {
308 for (
int iphi = 0; iphi <
m_nphi; iphi++) {
316 for (
unsigned i = 0;
i <
m_zone.size();
i++) {
◆ buildZR()
void MagField::AtlasFieldMap::buildZR |
( |
| ) |
|
|
private |
Definition at line 325 of file AtlasFieldMap.cxx.
341 unsigned nmeshz = solezone->
nmesh(0);
342 unsigned nmeshr = solezone->
nmesh(1);
343 if (solezone->
rmin() > 0.0) {
350 if (solezone->
rmin() > 0.0) {
354 for (
int i = 0;
i < 2;
i++) {
355 for (
unsigned j = 0; j < solezone->
nmesh(
i); j++) {
368 for (
int iphi = 0; iphi < nphi; iphi++) {
375 solezone->
getB(
xyz, B,
nullptr);
◆ findBFieldZone()
const BFieldZone* MagField::AtlasFieldMap::findBFieldZone |
( |
double |
z, |
|
|
double |
r, |
|
|
double |
phi |
|
) |
| const |
◆ findZoneSlow()
BFieldZone * MagField::AtlasFieldMap::findZoneSlow |
( |
double |
z, |
|
|
double |
r, |
|
|
double |
phi |
|
) |
| |
|
private |
◆ getBFieldMesh()
◆ initializeMap()
bool MagField::AtlasFieldMap::initializeMap |
( |
TFile * |
rootfile, |
|
|
float |
solenoidCurrent, |
|
|
float |
toroidCurrent |
|
) |
| |
Definition at line 26 of file AtlasFieldMap.cxx.
69 tree->SetBranchAddress(
"id", &
id);
70 tree->SetBranchAddress(
"zmin", &
zmin);
71 tree->SetBranchAddress(
"zmax", &
zmax);
72 tree->SetBranchAddress(
"rmin", &rmin);
73 tree->SetBranchAddress(
"rmax", &rmax);
74 tree->SetBranchAddress(
"phimin", &phimin);
75 tree->SetBranchAddress(
"phimax", &phimax);
76 tree->SetBranchAddress(
"bscale", &bscale);
77 tree->SetBranchAddress(
"ncond", &ncond);
78 tree->SetBranchAddress(
"nmeshz", &nmeshz);
79 tree->SetBranchAddress(
"nmeshr", &nmeshr);
80 tree->SetBranchAddress(
"nmeshphi", &nmeshphi);
81 tree->SetBranchAddress(
"nfield", &nfield);
90 unsigned maxmeshphi(0);
93 TTree* tmax = (TTree*)
rootfile->Get(
"BFieldMapSize");
94 if (tmax !=
nullptr) {
95 tmax->SetBranchAddress(
"maxcond", &maxcond);
96 tmax->SetBranchAddress(
"maxmeshz", &maxmeshz);
97 tmax->SetBranchAddress(
"maxmeshr", &maxmeshr);
98 tmax->SetBranchAddress(
"maxmeshphi", &maxmeshphi);
99 tmax->SetBranchAddress(
"maxfield", &maxfield);
102 for (
int i = 0;
i <
tree->GetEntries();
i++) {
104 maxcond =
std::max(maxcond, (
unsigned)ncond);
105 maxmeshz =
std::max(maxmeshz, (
unsigned)nmeshz);
106 maxmeshr =
std::max(maxmeshr, (
unsigned)nmeshr);
107 maxmeshphi =
std::max(maxmeshphi, (
unsigned)nmeshphi);
108 maxfield =
std::max(maxfield, (
unsigned)nfield);
111 finite =
new bool[maxcond];
112 p1x =
new double[maxcond];
113 p1y =
new double[maxcond];
114 p1z =
new double[maxcond];
115 p2x =
new double[maxcond];
116 p2y =
new double[maxcond];
117 p2z =
new double[maxcond];
118 curr =
new double[maxcond];
119 meshz =
new double[maxmeshz];
120 meshr =
new double[maxmeshr];
121 meshphi =
new double[maxmeshphi];
122 fieldz =
new short[maxfield];
123 fieldr =
new short[maxfield];
124 fieldphi =
new short[maxfield];
126 tree->SetBranchAddress(
"finite", finite);
127 tree->SetBranchAddress(
"p1x", p1x);
128 tree->SetBranchAddress(
"p1y", p1y);
129 tree->SetBranchAddress(
"p1z", p1z);
130 tree->SetBranchAddress(
"p2x", p2x);
131 tree->SetBranchAddress(
"p2y", p2y);
132 tree->SetBranchAddress(
"p2z", p2z);
133 tree->SetBranchAddress(
"curr", curr);
134 tree->SetBranchAddress(
"meshz", meshz);
135 tree->SetBranchAddress(
"meshr", meshr);
136 tree->SetBranchAddress(
"meshphi", meshphi);
137 tree->SetBranchAddress(
"fieldz", fieldz);
138 tree->SetBranchAddress(
"fieldr", fieldr);
139 tree->SetBranchAddress(
"fieldphi", fieldphi);
144 for (
int i = 0;
i <
tree->GetEntries();
i++) {
148 m_zone.back().reserve(nmeshz, nmeshr, nmeshphi);
149 for (
int j = 0; j < ncond; j++) {
160 m_zone.back().appendCond(cond);
162 for (
int j = 0; j < nmeshz; j++) {
163 m_zone.back().appendMesh(0, meshz[j]);
165 for (
int j = 0; j < nmeshr; j++) {
166 m_zone.back().appendMesh(1, meshr[j]);
168 for (
int j = 0; j < nmeshphi; j++) {
169 m_zone.back().appendMesh(2, meshphi[j]);
171 for (
int j = 0; j < nfield; j++) {
◆ memSize()
int MagField::AtlasFieldMap::memSize |
( |
| ) |
const |
|
private |
approximate memory footprint in bytes
Definition at line 393 of file AtlasFieldMap.cxx.
398 for (
unsigned i = 0;
i <
m_zone.size();
i++) {
401 for (
int i = 0;
i < 3;
i++) {
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read_packed_data()
int MagField::AtlasFieldMap::read_packed_data |
( |
std::istream & |
input, |
|
|
std::vector< int > & |
data |
|
) |
| const |
|
private |
◆ read_packed_int()
int MagField::AtlasFieldMap::read_packed_int |
( |
std::istream & |
input, |
|
|
int & |
n |
|
) |
| const |
|
private |
◆ solenoidCurrent()
float MagField::AtlasFieldMap::solenoidCurrent |
( |
| ) |
const |
|
inline |
◆ solenoidOn()
bool MagField::AtlasFieldMap::solenoidOn |
( |
| ) |
const |
|
inline |
◆ solenoidZoneId()
int MagField::AtlasFieldMap::solenoidZoneId |
( |
| ) |
const |
|
inline |
◆ toroidCurrent()
float MagField::AtlasFieldMap::toroidCurrent |
( |
| ) |
const |
|
inline |
◆ toroidOn()
bool MagField::AtlasFieldMap::toroidOn |
( |
| ) |
const |
|
inline |
◆ m_edge
std::vector<double> MagField::AtlasFieldMap::m_edge[3] |
|
private |
◆ m_edgeLUT
std::vector<int> MagField::AtlasFieldMap::m_edgeLUT[3] |
|
private |
◆ m_filename
std::string MagField::AtlasFieldMap::m_filename |
|
private |
◆ m_invq
double MagField::AtlasFieldMap::m_invq[3] |
|
private |
◆ m_mapIsInitialized
bool MagField::AtlasFieldMap::m_mapIsInitialized { false } |
|
private |
◆ m_meshZR
◆ m_nphi
int MagField::AtlasFieldMap::m_nphi { 0 } |
|
private |
◆ m_nr
int MagField::AtlasFieldMap::m_nr { 0 } |
|
private |
◆ m_nz
int MagField::AtlasFieldMap::m_nz { 0 } |
|
private |
◆ m_rmax
double MagField::AtlasFieldMap::m_rmax { 0 } |
|
private |
◆ m_solenoidCurrent
float MagField::AtlasFieldMap::m_solenoidCurrent { 0 } |
|
private |
◆ m_solenoidZoneId
int MagField::AtlasFieldMap::m_solenoidZoneId { -1 } |
|
private |
◆ m_toroidCurrent
float MagField::AtlasFieldMap::m_toroidCurrent { 0 } |
|
private |
◆ m_zmax
double MagField::AtlasFieldMap::m_zmax { 0 } |
|
private |
◆ m_zmin
double MagField::AtlasFieldMap::m_zmin { 0 } |
|
private |
◆ m_zone
std::vector<BFieldZone> MagField::AtlasFieldMap::m_zone |
|
private |
◆ m_zoneLUT
The documentation for this class was generated from the following files:
void getB(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT B, double *ATH_RESTRICT deriv=nullptr) const
get the bfield given a point in xyz
double mesh(size_t axis, size_t index) const
coordinate along axis (0 (z), 1 (r), 2 (phi)) of the cell at index (0 to nmesh-1)