4#ifndef _ExpressionEvaluation_xAODAccessor_h_
5#define _ExpressionEvaluation_xAODAccessor_h_
7#include "GaudiKernel/DataHandle.h"
26 template <
class T_Cont,
typename T_src>
33 std::size_t
size(
const T_Cont &cont)
const {
38 T_src
get(
const T_Cont &cont)
const {
43 T_src
get(
const T_Cont &cont, std::size_t idx)
const {
69 template <
class T_Cont,
typename T_src>
77 BaseAccessor::throwInvalidHandle(key.key());
81 std::size_t
size(
const T_Cont &cont)
const {
86 T_src
get(
const T_Cont &cont)
const {
91 T_src
get(
const T_Cont &cont, std::size_t idx)
const {
108 catch (std::exception &err) {
141 template <
class T, IProxyLoader::VariableType T_variable_type>
154 template <
class T_Cont,
class T_ScalarVectorHelper>
161 T_ScalarVectorHelper> >(key,
168 T_ScalarVectorHelper> >(key,
216 if (!the_type_info) {
217 std::stringstream
msg;
218 msg <<
"ExpressionParsing::AccessorFactory: no type information about " << auxid
220 throw std::runtime_error(
msg.str());
223 iter =
m_kits.find(the_type_info->hash_code());
224 if (iter ==
m_kits.end()) {
225 std::stringstream
msg;
226 msg <<
"ExpressionParsing::AccessorFactory: no type information about " << auxid
228 throw std::runtime_error(
msg.str());
230 return *(iter->second);
232 std::map<std::size_t, std::unique_ptr<IAccessorKit> >
m_kits;
Base class for elements of a container that can have aux data.
Manage index tracking and synchronization of auxiliary data.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
Class which creates accessors for the specified xAOD object content (singleton).
std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxVectorBase > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxVectorBase > *decor_key=nullptr) const
create an accessor for the specified content of an AuxVectorBase.
std::map< std::size_t, std::unique_ptr< IAccessorKit > > m_kits
std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxElement > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxElement > *decor_key=nullptr) const
create an accessor for the specified content of an AuxElement.
const IAccessorKit & getKit(SG::auxid_t auxid) const
Get an auxiliary class which creates an accessor for the specified content.
Auxiliary class to create the corresponding auxiliary helper object.
AccessorHelper< T_Cont, T_src > create(const EventContext &ctx, SG::ReadHandle< T_Cont > &handle) const
std::size_t size(const T_Cont &cont) const
T_src get(const T_Cont &cont, std::size_t idx) const
Get the specified element of the vector provided by the container.
SG::AuxElement::ConstAccessor< T_src > m_accessor
T_src get(const T_Cont &cont) const
Get the scalar provided by the container.
AccessorHelper(SG::auxid_t auxid)
Implementation of an accessor creator which provides accessors for xAOD accessor or decor handle acce...
std::unique_ptr< IAccessor > createAccessor(const SG::ReadHandleKey< T_Cont > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< T_Cont > *decor_key=nullptr) const
virtual std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxVectorBase > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxVectorBase > *decor_key=nullptr) const override
virtual std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxElement > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxElement > *decor_key=nullptr) const override
Auxiliary class to create the corresponding auxiliary helper object.
const SG::ReadDecorHandleKey< T_Cont > * m_decorKey
Kit(const SG::ReadDecorHandleKey< T_Cont > &key)
DecorHelper< T_Cont, T_src > create(const EventContext &ctx, SG::ReadHandle< T_Cont > &handle) const
T_src get(const T_Cont &cont) const
Get the scalar provided by the container.
T_src get(const T_Cont &cont, std::size_t idx) const
Get the specified element of the vector provided by the container.
std::size_t size(const T_Cont &cont) const
SG::ReadDecorHandle< T_Cont, T_src > m_decorHandle
DecorHelper(const EventContext &ctx, const SG::ReadDecorHandleKey< T_Cont > &key, SG::ReadHandle< T_Cont > &handle)
Generic accessor to access xAOD object content.
Interface of a class to create an xAOD object content accessor.
virtual std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxVectorBase > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxVectorBase > *decor_key=nullptr) const =0
friend class AccessorFactory
virtual std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxElement > &key, SG::auxid_t auxid, const SG::ReadDecorHandleKey< SG::AuxElement > *decor_key=nullptr) const =0
static reference_type index(void *ptr, size_t ndx)
Look up an element in the container by index.
SG::ConstAccessor< T, ALLOC > ConstAccessor
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
Namespace holding all the expression evaluation code.
const SG::AuxVectorData * getVectorData(const T &cont)
std::size_t getContainerSize(const T &cont)
void dumpAux(const T &cont, SG::auxid_t method_id)
Method for debugging to dump information of all aux member of the given container and the specific au...
size_t auxid_t
Identifier for a particular aux data item.