4#ifndef CaloRecGPU_CaloRecUtilities_h
5#define CaloRecGPU_CaloRecUtilities_h
15 template <
class ...
Args>
17 static constexpr size_t size(){
18 return sizeof...(Args);
23template<
class F,
class... Types,
class...
Args>
25 auto&& func = std::forward<F>(f);
26 [&]<std::size_t...
I>(std::index_sequence<
I...>) {
27 (func(Types{},
I, args...), ...);
28 }(std::make_index_sequence<
sizeof...(Types)>{});
33 std::memcpy(&
res, &bits,
sizeof(
float));
39 return x == 0 ? 1e-15 :
x;
43 return x == 0 ? 1e-7 :
x;
std::pair< std::vector< unsigned int >, bool > res
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
double protect_from_zero(const double x)
void apply_to_multi_class(F &&f, multi_class_holder< Types... >, Args &... args)
float float_unhack(const unsigned int bits)
A convenient way to handle a compile-time list of types, useful for several metaprogramming technique...
static constexpr size_t size()