ATLAS Offline Software
Loading...
Searching...
No Matches
BFieldZone.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5inline BFieldZone::BFieldZone(int id,
6 double zmin,
7 double zmax,
8 double rmin,
9 double rmax,
10 double phimin,
11 double phimax,
12 double scale)
13 : BFieldMesh<short>(zmin, zmax, rmin, rmax, phimin, phimax, scale)
14 , m_id(id)
15{}
16
17inline void
18BFieldZone::appendCond(const BFieldCond& cond)
19{
20 m_cond.push_back(cond);
21}
22
23
24inline void
25BFieldZone::addBiotSavart(const double* ATH_RESTRICT xyz,
26 double* ATH_RESTRICT B,
27 double* ATH_RESTRICT deriv) const
28{
29 for (unsigned i = 0; i < m_cond.size(); i++) {
30 m_cond[i].addBiotSavart(1, xyz, B, deriv);
31 }
32}
33
34inline int
35BFieldZone::id() const
36{
37 return m_id;
38}
39
40inline unsigned
41BFieldZone::ncond() const
42{
43 return m_cond.size();
44}
45
46inline const BFieldCond&
47BFieldZone::cond(int i) const
48{
49 return m_cond[i];
50}
51
52inline const std::vector<BFieldCond>*
53BFieldZone::condVector() const
54{
55 return &m_cond;
56}
57
58inline int
59BFieldZone::memSize() const
60{
61 return BFieldMesh<short>::memSize() + sizeof(int) +
62 sizeof(BFieldCond) * m_cond.capacity();
63}
64
65inline void
66BFieldZone::adjustMin(int i, double x)
67{
68 m_min[i] = x;
69 m_mesh[i].front() = x;
70}
71
72inline void
73BFieldZone::adjustMax(int i, double x)
74{
75 m_max[i] = x;
76 m_mesh[i].back() = x;
77}
78