4#ifndef PRIMATIVE_HELPERS_H
5#define PRIMATIVE_HELPERS_H
23 template <
typename T,
typename I,
typename A,
typename S=T>
24 std::function<T(
I)>
get(
const std::string & source,
A ass, T def) {
26 using rettype =
decltype(
ass(std::declval<I>()));
27 if constexpr (std::is_pointer<rettype>::value) {
28 return [acc,
ass, def](
I in) -> T {
29 const auto* associated =
ass(in);
30 if (!associated)
return def;
31 return acc(*associated);
34 return [acc,
ass](
I in) -> T {
return acc(
ass(in)); };
46 using ull =
unsigned long long;
47 using ul =
unsigned long;
50 template <
typename T,
typename A=defaultAccessor_t<T>>
52 using I =
typename T::input_type;
54 std::string s = input.source;
55 std::string t = input.target.empty() ? input.source : input.target;
57 const char cz = char(0);
58 const char cm = char(-1);
59 const char sm = short(-1);
61 case Tp::PRECISION_CUSTOM:
62 case Tp::CUSTOM:
throw std::logic_error(
"custom type unsupported");
Base class for elements of a container that can have aux data.
Header file for AthHistogramAlgorithm.
SG::ConstAccessor< T, ALLOC > ConstAccessor
make the histogram assessment part of the config
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
std::function< T(I)> get(const std::string &source, A ass, T def)
bool isCustom(const Primitive &p)
decltype(defaultAccessor< T >) defaultAccessor_t
hold the test vectors and ease the comparison