52template <
typename T>
bool JetContext::setValue(
const std::string& name,
const T value,
bool allowOverwrite) {
53 if(( !allowOverwrite &&
isAvailable(name)) )
return false;
55 if constexpr (!std::is_same<T, int>::value && !std::is_same<T, float>::value) {
56 static_assert(std::is_same<T, double>::value,
"Unsupported type provided, please use integers or doubles.");
57 m_dict_.insert_or_assign(name, (
float) value);
59 m_dict_.insert_or_assign(name, value);
Class JetContext Designed to read AOD information related to the event, N vertices,...
std::unordered_map< std::string, std::variant< int, float > > m_dict_
bool setValue(const std::string &name, const T value, bool allowOverwrite=false)
bool isAvailable(const std::string &name) const
void getValue(const std::string &name, T &value) const