|
ATLAS Offline Software
|
Go to the documentation of this file.
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>
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 {
141 template <
class T, IProxyLoader::VariableType T_variable_type>
146 return createAccessor<SG::AuxVectorBase,VectorHelper>(
key,auxid, decor_key);
151 return createAccessor<SG::AuxElement,ScalarHelper>(
key,auxid, decor_key);
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());
222 std::map<std::size_t, std::unique_ptr<IAccessorKit> >::const_iterator
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;
Property holding a SG store/key/clid from which a ReadHandle is made.
Auxiliary class to handle decorator handle based xAOD object content access.
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 =0
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
std::size_t size(const T_Cont &cont) const
static reference_type index(void *ptr, size_t ndx)
Look up an element in the container by index.
T_src get(const T_Cont &cont) const
Get the scalar provided by the container.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
std::map< std::size_t, std::unique_ptr< IAccessorKit > > m_kits
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Generic accessor to access xAOD object content.
T_src get(const T_Cont &cont) const
Get the scalar provided by the container.
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.
Helper class to provide constant type-safe access to aux data.
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.
Property holding a SG store/key/clid from which a ReadHandle is made.
Manage index tracking and synchronization of auxiliary data.
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
AccessorHelper(SG::auxid_t auxid)
Interface of a class to create an xAOD object content accessor.
Auxiliary class to create the corresponding auxiliary helper object.
size_t auxid_t
Identifier for a particular aux data item.
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
DecorHelper(const EventContext &ctx, const SG::ReadDecorHandleKey< T_Cont > &key, SG::ReadHandle< T_Cont > &handle)
SG::ReadDecorHandle< T_Cont, T_src > m_decorHandle
T_src get(const T_Cont &cont, std::size_t idx) const
Get the specified element of the vector provided by the container.
Namespace holding all the expression evaluation code.
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
virtual bool isValid() override final
Can the handle be successfully dereferenced?
static void throwInvalidHandle(const std::string &key)
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
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...
std::size_t size(const T_Cont &cont) const
Kit(const SG::ReadDecorHandleKey< T_Cont > &key)
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 getContainerSize(const T &cont)
Implementation of an accessor creator which provides accessors for xAOD accessor or decor handle acce...
AccessorHelper< T_Cont, T_src > create(const EventContext &ctx, SG::ReadHandle< T_Cont > &handle) const
const SG::AuxVectorData * getVectorData(const T &cont)
const SG::ReadDecorHandleKey< T_Cont > * m_decorKey
Auxiliary class to create the corresponding auxiliary helper object.
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
SG::AuxElement::ConstAccessor< T_src > m_accessor
DecorHelper< T_Cont, T_src > create(const EventContext &ctx, SG::ReadHandle< T_Cont > &handle) const
Class which creates accessors for the specified xAOD object content (singleton).
Base class for elements of a container that can have aux data.
const IAccessorKit & getKit(SG::auxid_t auxid) const
Get an auxiliary class which creates an accessor for the specified content.
Auxiliary class to handle xAOD accessor based xAOD object content access.