2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 #include "CxxUtils/vec.h"
7 BFieldCache::invalidate()
13 BFieldCache::setRange(double zmin,
26 m_invz = 1.0 / (zmax - zmin);
27 m_invr = 1.0 / (rmax - rmin);
28 m_invphi = 1.0 / (phimax - phimin);
31 // set field array, filled externally
33 BFieldCache::setField(const CxxUtils::vec<double, 8>& field1,
34 const CxxUtils::vec<double, 8>& field2,
35 const CxxUtils::vec<double, 8>& field3)
37 CxxUtils::vstore(&m_field[0][0], field1);
38 CxxUtils::vstore(&m_field[1][0], field2);
39 CxxUtils::vstore(&m_field[2][0], field3);
43 BFieldCache::setBscale(double bscale)
49 BFieldCache::bscale() const
55 BFieldCache::inside(double z, double r, double phi) const
60 // clang emits code that is more similar to using the "bit AND"
61 // rather than "logical AND" for this kind of check.
62 // Basically get rid of jmp instructions with calculating
64 return ((z <= m_zmax) & (z >= m_zmin) & (r <= m_rmax) & (r >= m_rmin) &
65 (phi <= m_phimax) & (phi >= m_phimin));