Skip to content
Snippets Groups Projects
Commit 68feaed7 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

BFieldVector add static_assert for the types we allow

parent 752a3f5d
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ BFieldCache::inside(double z, double r, double phi) const
if (phi < m_phimin) {
phi += 2.0 * M_PI;
}
return (r <= m_rmax && r >= m_rmin && z <= m_zmax && z >= m_zmin &&
return (z <= m_zmax && z >= m_zmin && r <= m_rmax && r >= m_rmin &&
phi <= m_phimax && phi >= m_phimin);
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
//
// BFieldVector.h
//
// Magnetic field value stored in the map.
// It may be either short (toroid) or double (solenoid).
// We allow short (usual case) double (special case)
//
// Masahiro Morii, Harvard University
//
......@@ -22,6 +21,10 @@ template<class T>
class BFieldVector
{
public:
static_assert(
(std::is_same<T, short>::value || std::is_same<T, double>::value),
"Type for the BField Vector must be one of short or double");
// Default
BFieldVector() = default;
BFieldVector(const BFieldVector&) = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment