ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MagneticField
MagFieldElements
MagFieldElements
BFieldMeshZR.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* BFieldMeshZR.h
7
*
8
* A 2-dim z-r mesh inside the solenoid field map
9
*
10
* Masahiro Morii, Harvard University
11
*
12
* AthenaMT : RD Schaffer , Christos Anastopoulos
13
*/
14
#ifndef BFIELDMESHZR_H
15
#define BFIELDMESHZR_H
16
17
#include "
MagFieldElements/BFieldCacheZR.h
"
18
#include "
MagFieldElements/BFieldVectorZR.h
"
19
#include <array>
20
#include <cmath>
21
#include <vector>
22
23
class
BFieldMeshZR
24
{
25
public
:
26
// no default constructor
27
BFieldMeshZR
() =
delete
;
28
// constructor
29
BFieldMeshZR
(
double
zmin
,
double
zmax
,
double
rmin
,
double
rmax
);
30
// allocate space to vectors
31
void
reserve
(
int
nz,
int
nr);
32
// add elements to vectors
33
void
appendMesh
(
int
i,
double
mesh
);
34
void
appendField
(
const
BFieldVectorZR
&
field
);
35
// build LUT
36
void
buildLUT
();
37
// test if a point is inside this zone
38
bool
inside
(
double
z
,
double
r
)
const
;
39
// find the bin
40
inline
void
getCache
(
double
z
,
41
double
r
,
42
BFieldCacheZR
& cache,
43
double
scaleFactor = 1.0)
const
;
44
// accessors
45
double
min
(
size_t
i)
const
;
46
double
max
(
size_t
i)
const
;
47
double
zmin
()
const
;
48
double
zmax
()
const
;
49
double
rmin
()
const
;
50
double
rmax
()
const
;
51
unsigned
nmesh
(
size_t
i)
const
;
52
double
mesh
(
size_t
i,
size_t
j)
const
;
53
unsigned
nfield
()
const
;
54
const
BFieldVectorZR
&
field
(
size_t
i)
const
;
55
int
memSize
()
const
;
56
57
private
:
58
std::array<double, 2>
m_min
;
59
std::array<double, 2>
m_max
;
60
std::array<std::vector<double>, 2>
m_mesh
;
61
std::vector<BFieldVectorZR>
m_field
;
62
// look-up table and related variables
63
std::array<std::vector<int>, 2>
m_LUT
;
64
std::array<double, 2>
m_invUnit
= {1};
// inverse unit size in the LUT
65
int
m_zoff
{0};
66
};
67
68
#include "
MagFieldElements/BFieldMeshZR.icc
"
69
#endif
BFieldCacheZR.h
BFieldMeshZR.icc
BFieldVectorZR.h
z
#define z
BFieldCacheZR
Definition
BFieldCacheZR.h:22
BFieldMeshZR::mesh
double mesh(size_t i, size_t j) const
BFieldMeshZR::reserve
void reserve(int nz, int nr)
BFieldMeshZR::m_LUT
std::array< std::vector< int >, 2 > m_LUT
Definition
BFieldMeshZR.h:63
BFieldMeshZR::m_max
std::array< double, 2 > m_max
Definition
BFieldMeshZR.h:59
BFieldMeshZR::m_zoff
int m_zoff
Definition
BFieldMeshZR.h:65
BFieldMeshZR::BFieldMeshZR
BFieldMeshZR()=delete
BFieldMeshZR::inside
bool inside(double z, double r) const
BFieldMeshZR::zmin
double zmin() const
BFieldMeshZR::rmin
double rmin() const
BFieldMeshZR::BFieldMeshZR
BFieldMeshZR(double zmin, double zmax, double rmin, double rmax)
BFieldMeshZR::getCache
void getCache(double z, double r, BFieldCacheZR &cache, double scaleFactor=1.0) const
BFieldMeshZR::field
const BFieldVectorZR & field(size_t i) const
BFieldMeshZR::max
double max(size_t i) const
BFieldMeshZR::min
double min(size_t i) const
BFieldMeshZR::nfield
unsigned nfield() const
BFieldMeshZR::nmesh
unsigned nmesh(size_t i) const
BFieldMeshZR::m_min
std::array< double, 2 > m_min
Definition
BFieldMeshZR.h:58
BFieldMeshZR::zmax
double zmax() const
BFieldMeshZR::memSize
int memSize() const
Definition
BFieldMeshZR.cxx:45
BFieldMeshZR::appendMesh
void appendMesh(int i, double mesh)
BFieldMeshZR::m_field
std::vector< BFieldVectorZR > m_field
Definition
BFieldMeshZR.h:61
BFieldMeshZR::rmax
double rmax() const
BFieldMeshZR::m_invUnit
std::array< double, 2 > m_invUnit
Definition
BFieldMeshZR.h:64
BFieldMeshZR::m_mesh
std::array< std::vector< double >, 2 > m_mesh
Definition
BFieldMeshZR.h:60
BFieldMeshZR::buildLUT
void buildLUT()
Definition
BFieldMeshZR.cxx:18
BFieldMeshZR::appendField
void appendField(const BFieldVectorZR &field)
BFieldVectorZR
Definition
BFieldVectorZR.h:19
r
int r
Definition
globals.cxx:22
Generated on
for ATLAS Offline Software by
1.17.0