4#ifndef ExpressionParsing_BaseAccessor_h_
5#define ExpressionParsing_BaseAccessor_h_
21 std::stringstream
msg;
22 msg <<
"Failed to create read handle for " << key;
23 throw std::runtime_error(key);
26 std::stringstream
msg;
27 msg <<
"Cannot convert to scalar since the aux vector data container " << key <<
" does not contain exactly one element but " << n_elements;
28 throw std::runtime_error(key);
43 virtual int loadInt([[maybe_unused]]
const EventContext& ctx,[[maybe_unused]]
const std::string &var_name)
const override
45 virtual double loadDouble([[maybe_unused]]
const EventContext& ctx,[[maybe_unused]]
const std::string &var_name)
const override
47 virtual std::vector<int>
loadVecInt([[maybe_unused]]
const EventContext& ctx,[[maybe_unused]]
const std::string &var_name)
const override
48 {
return std::vector<int>(); }
49 virtual std::vector<double>
loadVec([[maybe_unused]]
const EventContext& ctx,[[maybe_unused]]
const std::string &var_name)
const override
50 {
return std::vector<double>(); }
53 throw std::runtime_error(
"Attempt to convert empty vector into scalar.");
virtual IAccessor::VariableType variableType(const std::string &var_name) const override
IAccessor::VariableType m_variableType
static void throwVectorContainsNotOneElement(const std::string &key, std::size_t n_elements)
BaseAccessor(IAccessor::VariableType variable_type)
static void throwInvalidHandle(const std::string &key)
Special accessor to handle empty containers until the correct accessor can be created.
virtual std::vector< double > loadVec(const EventContext &ctx, const std::string &var_name) const override
void throwEmptyVector() const
virtual int loadInt(const EventContext &ctx, const std::string &var_name) const override
virtual std::vector< int > loadVecInt(const EventContext &ctx, const std::string &var_name) const override
virtual IAccessor::VariableType variableType(const std::string &var_name) const override
virtual double loadDouble(const EventContext &ctx, const std::string &var_name) const override
Interface of auxiliary classes to access xAOD object content.
Namespace holding all the expression evaluation code.