LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::vect::extra Namespace Reference

Convenience utilities not directly related to vectors. More...

Functions

template<typename T >
roundValue01 (T value, T tol)
 Returns value, rounded to 0, -1 or +1 if closer than tol. More...
 

Detailed Description

Convenience utilities not directly related to vectors.

Function Documentation

template<typename T >
T geo::vect::extra::roundValue01 ( value,
tol 
)

Returns value, rounded to 0, -1 or +1 if closer than tol.

Definition at line 404 of file geo_vectors_utils.h.

References fhicl::detail::atom::value().

Referenced by geo::vect::rounded01().

404  {
405  if (std::abs(value) < tol) return 0.;
406  if (std::abs(std::abs(value) - 1.) < tol) return (value > 0.)? 1.: -1.;
407  return value;
408  } // roundValue01()
std::string value(boost::any const &)