ATLAS Offline Software
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 
5 inline 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 
17 inline void
18 BFieldZone::appendCond(const BFieldCond& cond)
19 {
20  m_cond.push_back(cond);
21 }
22 
23 
24 inline void
25 BFieldZone::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 
34 inline int
35 BFieldZone::id() const
36 {
37  return m_id;
38 }
39 
40 inline unsigned
41 BFieldZone::ncond() const
42 {
43  return m_cond.size();
44 }
45 
46 inline const BFieldCond&
47 BFieldZone::cond(int i) const
48 {
49  return m_cond[i];
50 }
51 
52 inline const std::vector<BFieldCond>*
53 BFieldZone::condVector() const
54 {
55  return &m_cond;
56 }
57 
58 inline int
59 BFieldZone::memSize() const
60 {
61  return BFieldMesh<short>::memSize() + sizeof(int) +
62  sizeof(BFieldCond) * m_cond.capacity();
63 }
64 
65 inline void
66 BFieldZone::adjustMin(int i, double x)
67 {
68  m_min[i] = x;
69  m_mesh[i].front() = x;
70 }
71 
72 inline void
73 BFieldZone::adjustMax(int i, double x)
74 {
75  m_max[i] = x;
76  m_mesh[i].back() = x;
77 }
78