2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
6 inline const BFieldZone*
7 MagField::AtlasFieldMap::findBFieldZone(double z, double r, double phi) const
10 // make sure it's inside the largest zone
11 // NB: the sign of the logic is chosen in order to return 0 on NaN inputs
12 if (z >= m_zmin && z <= m_zmax && r <= m_rmax) {
13 // find the edges of the zone
15 int iz = int(m_invq[0] * (z - m_zmin)); // index to LUT
16 iz = m_edgeLUT[0][iz]; // tentative index from LUT
17 if (z > m_edge[0][iz + 1]) {
21 int ir = int(m_invq[1] * r); // index to LUT - note minimum r is always 0
22 ir = m_edgeLUT[1][ir]; // tentative index from LUT
23 if (r > m_edge[1][ir + 1]) {
28 int(m_invq[2] * (phi + M_PI)); // index to LUT - minimum phi is -pi
29 iphi = m_edgeLUT[2][iphi]; // tentative index from LUT
30 if (phi > m_edge[2][iphi + 1]) {
33 // use LUT to get the zone
34 return m_zoneLUT[(iz * m_nr + ir) * m_nphi + iphi];
39 // fast 2d map (made of one zone)
40 inline const BFieldMeshZR*
41 AtlasFieldMap::getBFieldMesh() const