ATLAS Offline Software
Loading...
Searching...
No Matches
MultipleScatteringUpdator.cxx File Reference
#include "TrkExTools/MultipleScatteringUpdator.h"
#include "TrkGeometry/MaterialProperties.h"
#include "TrkExUtils/MaterialInteraction.h"
#include "AthenaKernel/RNGWrapper.h"
#include "GaudiKernel/ThreadLocalContext.h"
#include "CLHEP/Random/RandFlat.h"
#include "CxxUtils/checker_macros.h"
#include "CxxUtils/close_to_zero.h"
Include dependency graph for MultipleScatteringUpdator.cxx:

Go to the source code of this file.

Functions

template<typename T>
bool close_to_zero (T value, T eps=std::numeric_limits< T >::epsilon())

Function Documentation

◆ close_to_zero()

template<typename T>
bool CxxUtils::close_to_zero ( T value,
T eps = std::numeric_limits<T>::epsilon() )

Definition at line 48 of file close_to_zero.h.

48 {
49 if constexpr (std::is_integral_v<T>) {
50 // For integers, only exact zero is invalid
51 return value == 0;
52 } else if constexpr (std::is_floating_point_v<T>) {
53 return std::abs(value) < eps;
54 } else {
55 static_assert(std::is_arithmetic_v<T>, "close_to_zero: Only arithmetic types supported");
56 return false;
57 }
58 }