5#ifndef ATHLINKS_ELEMENTLINK_H
6#define ATHLINKS_ELEMENTLINK_H
13#include <RootMetaSelection.h>
16#include "AthLinks/ElementLinkBase.h"
21 template<
typename STORABLE >
39template<
typename STORABLE >
114 const EventContext& ctx );
116 const EventContext& ctx );
118 const EventContext& ctx );
120 const EventContext& ctx );
122 const EventContext& ctx );
124 const EventContext& ctx );
227template <
typename STORABLE>
231template <
typename STORABLE>
239namespace ROOT {
namespace Meta {
namespace Selection {
240template<
typename STORABLE >
249 ROOT::Meta::Selection::MemberAttributes< kTransient >
m_container;
250 ROOT::Meta::Selection::MemberAttributes< kTransient >
m_element;
252 ROOT::Meta::Selection::MemberAttributes< kTransient >
m_event;
bool operator<(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
bool operator>(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
char data[hepevt_bytes_allocation_ATLAS]
stored_index_type persIndex() const
Return the index of the link.
sgkey_t persKey() const
Return the SG key that we reference, as a hash.
ElementLinkBase(const ElementLinkBase &)=default
ElementLink implementation for ROOT usage.
BaseConstReference getStorableObjectRef() const
Retrieve storable object reference.
ElementLink(const ID_type &key, index_type index, const EventContext &ctx)
Versions of the above constructors with dummy EventContext arguments.
bool setElement(ElementType element)
Set link to point to an Element (slowest).
const ID_type & dataID() const
Get the key that we reference, as a string.
ROOT::Meta::Selection::ElementLink< cont_type >::self DictSel
virtual bool toTransient()
Reset the object's internal cache.
ElementLink(xAOD::TVirtualEvent *event)
Constructor setting up the link with a specific event object.
ElementLink(const ID_type &key, index_type index, ElementType element, xAOD::TVirtualEvent *event=0)
Construct from a storable key and element index, taking the element object from the user.
ElementLink(sgkey_t id, index_type index, const EventContext &ctx)
ElementLink(const ElementLink &parent)
Copy-constructor.
BaseConstPointer m_container
ElementConstPointer operator->() const
Access the object as a smart pointer.
const cont_type * BaseConstPointer
ElementLink(ElementType element, BaseConstReference container, const EventContext &ctx)
BaseConstPointer getStorableObjectPointer() const
Retrieve storable object pointer.
cont_type::value_type value_type
bool toContainedElement(BaseConstReference container, ElementType element)
Set link to point to given element (slowest).
bool toPersistent()
Dummy function provinding the offline interface.
TypeTools::Copy< value_type >::const_pointer ElementConstPointer
ElementConstPointer cptr() const
Get a constant pointer to the referenced object.
void resetWithKeyAndIndex(sgkey_t id, index_type index, xAOD::TVirtualEvent *event=0)
Reset with storable id and element index (fastest).
index_type index() const
Get the index of the element inside of its container.
ElementLink(sgkey_t id, index_type index, ElementType element, const EventContext &ctx)
ElementConstReference operator*() const
Get a reference to the object in question.
ElementLink(sgkey_t id, index_type index, xAOD::TVirtualEvent *event=0)
Construct object from storable id and element index (fastest).
bool toIndexedElement(BaseConstReference container, index_type index)
Set link to point to given index (slower).
bool operator!() const
Operator checking the validity of the link.
TypeTools::Copy< value_type >::const_reference ElementConstReference
bool operator!=(const ElementLink &rhs) const
Comparison operator.
void resetWithKeyAndIndex(const ID_type &key, index_type index, xAOD::TVirtualEvent *event=0)
Reset with storable key and element index (fast).
ElementLink(sgkey_t id, index_type index, ElementType element, xAOD::TVirtualEvent *event=0)
Construct from a storable id and element index, taking the element object from the user.
bool isValid() const
Check if the element can be found.
ElementLink & operator=(const ElementLink &rhs)
Assignment operator.
xAOD::TVirtualEvent * source() const
Get the data source for the reference.
const cont_type & BaseConstReference
ElementLink(const ID_type &key, index_type index, xAOD::TVirtualEvent *event=0)
Construct object from storable key and element index (fast).
xAOD::TVirtualEvent * m_event
bool operator==(const ElementLink &rhs) const
Comparison operator.
bool hasCachedElement() const
Check if the link has a cached element pointer.
ElementLink(ElementType element, BaseConstReference container, xAOD::TVirtualEvent *event=0)
Construct from a container reference and element pointer (slowest).
ElementLink()
Default constructor.
ElementLink(BaseConstReference container, index_type index, const EventContext &ctx)
TypeTools::Copy< value_type >::type ElementType
void findIdentifier()
Find the identifier of the object being pointed to.
ElementLink(BaseConstReference container, index_type index, xAOD::TVirtualEvent *event=0)
Construct from a container reference and element index (slower).
bool setStorableObject(BaseConstReference data, bool replace=false)
Set link storable to data object pointed by data (slower).
ElementLink(const ID_type &key, index_type index, ElementType element, const EventContext &ctx)
cont_type::const_iterator const_iterator
void reset()
Reset to default state.
void findIndex()
Find the index of an element inside the container.
ElementType cachedElement() const
Access the currently cached element. Doesn't trigger lookup.
Base interface for getting objects out of the input file.
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Selection rules: declare transient members.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.