|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef _ExpressionEvaluation_GenAccessor_h_
5 #define _ExpressionEvaluation_GenAccessor_h_
21 template <
class T_Dest,
class T_Cont,
class T_Helper>
24 result.push_back(
static_cast<T_Dest
>(
helper.get( *handle ) ));
27 template <
class T_Dest,
class T_Cont,
class T_Helper>
30 return static_cast<T_Dest
>(
helper.get( *handle ) );
38 template <
class T_Dest,
class T_Cont,
class T_Helper>
40 std::size_t n_elements=
helper.size(*handle);
42 result.reserve(n_elements);
43 for(std::size_t
idx =0;
idx <n_elements; ++
idx) {
47 template <
class T_Dest,
class T_Cont,
class T_Helper>
54 return static_cast<T_Dest
>(
helper.get(*handle, 0));
62 template <
class T_Cont,
class T_HelperKit,
class T_ScalarVectorHelper>
71 virtual int loadInt(
const EventContext& ctx)
const override {
72 return this->loadScalar<int>(ctx);
74 virtual double loadDouble(
const EventContext& ctx)
const override {
75 return this->loadScalar<double>(ctx);
77 virtual std::vector<int>
loadVecInt(
const EventContext& ctx)
const override {
78 return this->loadVector<int>(ctx);
80 virtual std::vector<double>
loadVec(
const EventContext& ctx)
const override {
81 return this->loadVector<double>(ctx);
84 template <
class T_Dest>
85 std::vector<T_Dest>
loadVector(
const EventContext& ctx)
const {
90 std::vector<T_Dest>
result;
98 template <
class T_Dest>
106 return T_ScalarVectorHelper::getScalar(
helper, handle,
dummy);
Property holding a SG store/key/clid from which a ReadHandle is made.
Auxiliary class to handle vector like containers (AuxVectorBase).
const SG::ReadHandleKey< T_Cont > * m_key
virtual std::vector< double > loadVec(const EventContext &ctx) const override
Generic accessor to access xAOD object content.
static void fillVector(T_Helper &helper, SG::ReadHandle< T_Cont > &handle, std::vector< T_Dest > &result)
const std::string & key() const
Return the StoreGate ID for the referenced object.
static T_Dest getScalar(T_Helper &helper, SG::ReadHandle< T_Cont > &handle, const T_Dest &dummy)
virtual std::vector< int > loadVecInt(const EventContext &ctx) const override
virtual int loadInt(const EventContext &ctx) const override
Namespace holding all the expression evaluation code.
virtual double loadDouble(const EventContext &ctx) const override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
static void throwInvalidHandle(const std::string &key)
T_Dest loadScalar(const EventContext &ctx) const
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
std::size_t getContainerSize(const T &cont)
static void throwVectorContainsNotOneElement(const std::string &key, std::size_t n_elements)
static void fillVector(T_Helper &helper, SG::ReadHandle< T_Cont > &handle, std::vector< T_Dest > &result)
Base class of xAOD object content accessors.
Handle class for reading from StoreGate.
static T_Dest getScalar(T_Helper &helper, SG::ReadHandle< T_Cont > &handle, const T_Dest &dummy)
std::vector< T_Dest > loadVector(const EventContext &ctx) const
GenAccessor(const SG::ReadHandleKey< T_Cont > &key, T_HelperKit &&helper_kit, IProxyLoader::VariableType variable_type)
Auxiliary class to handle scalar like containers (AuxElement).