 |
ATLAS Offline Software
|
Go to the documentation of this file.
17 #ifndef XAOD_STANDALONE
21 # include "GaudiKernel/Converter.h"
22 # include "GaudiKernel/GenericAddress.h"
23 #endif // NOT XAOD_STANDALONE
38 typedef AthContainers_detail::lock_guard< mutex_t > guard_t;
42 #ifndef XAOD_STANDALONE
51 const std::type_info& ti,
79 const std::type_info&
tinfo()
const override {
88 throw std::runtime_error(
"RHolderBucket::cast not implemented" );
95 bool isConst )
override {
98 static const bool QUIET =
true;
127 const std::type_info&
tinfo,
129 bool isConst)
override
154 const std::string&
name,
155 const std::type_info& ti)
185 static const bool SILENT =
true;
186 static const bool METADATA =
false;
198 return StatusCode::SUCCESS;
202 #endif // not XAOD_STANDALONE
206 namespace Experimental {
219 static const bool QUIET =
true;
237 const std::string&
key )
const {
247 ::Warning(
"xAOD::REvent::proxy",
248 "Can't find BranchInfo for %s.",
261 static mutex_t
mutex;
263 if( missingSGKeys.emplace(
sgkey ).second &&
265 ::Warning(
"xAOD::REvent::proxy_exact",
266 "Can't find BranchInfo for %d.",
288 auto it = m_branches.find(
sgkey );
289 if(
it != m_branches.end() ) {
290 return &(
it->second );
303 static const bool SILENT =
true;
304 static const bool METADATA =
false;
316 static const std::type_info&
dummy =
typeid(
REvent );
329 ::Error(
"xAOD::REvent::getBranchInfo",
338 #ifndef XAOD_STANDALONE
342 new GenericAddress() );
350 #endif // not XAOD_STANDALONE
355 auto ret = m_branches.insert( std::make_pair(
sgkey, std::move( bi ) ) );
358 return &( ret.first->second );
365 static const bool QUIET =
true;
374 static mutex_t
mutex;
376 if( missingSGKeys.emplace(
sgkey ).second ) {
378 ::Warning(
"xAOD::REvent::getEventFormatElement",
379 "Can't find EventFormatElement for hashed "
380 "SG key %d",
sgkey );
403 ::Warning(
"xAOD::REvent::addToStore",
404 "Function should only be called through an invalid "
414 m_branches.insert( std::make_pair(
stringToKey( uniqueKey.Data(),
419 return StatusCode::SUCCESS;
426 std::vector< const SG::DataProxy* > ret;
427 for(
const auto&
p : m_branches ) {
430 ret.push_back(
proxy );
457 const std::string&,
bool,
bool ) {
459 throw std::runtime_error(
"xAOD::REvent::recordObject is not "
465 static const std::string NAME =
"xAOD::REvent";
Interface for registering a transient object in t2p map.
virtual long repSvcType() const override
Object_t m_outputObjects
Collection of all the managed output object.
Tool for accessing xAOD files outside of Athena, version RNTuple.
upgrade_mutex_t m_branchesMutex
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
void lock() override
Lock the held object. A no-op.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
This function is used by the TVirtualEvent interface to access an output object with a given hashed k...
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
Manager for EDM objects created by ROOT.
void * cast(CLID, const std::type_info &tinfo, SG::IRegisterTransient *irt, bool isConst) override
Return the object, cast to type.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
void * cast(CLID, SG::IRegisterTransient *, bool) override
Return the object, cast to a CLID's type.
const std::string m_key
The key of the object.
void * object() override
Return the object held.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
Helper struct used by the IProxyDict code.
std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent=false) override
Function for retrieving an input object in a non-template way.
POOL::TEvent event(POOL::TEvent::kClassAccess)
::StatusCode StatusCode
StatusCode definition for legacy code.
const std::string * keyToString(SG::sgkey_t key) const override
Find the string corresponding to a given key.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
Object_t m_inputObjects
Collection of all the managed input objects.
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
const std::type_info & tinfo() const override
Return the type_info of the stored object.
const std::type_info & m_ti
The type info of the object.
uint32_t CLID
The Class ID type.
const std::type_info & m_ti
EventFormat m_inputEventFormat
Format of the current input file.
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
void * cast(const std::type_info &tinfo, SG::IRegisterTransient *, bool isConst) override
Return the object, cast to a certain type.
REvent(EAuxMode mode=kUndefinedAccess)
Default constructor.
xAOD::Experimental::REvent & m_event
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&) override
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
xAOD::Experimental::REvent & m_event
The original REvent object.
void registerKey(SG::sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
Bool_t m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
Helper object for holding something through a THolder.
void setSGKey(sgkey_t sgkey)
check if it is a transient ID (primary or symLinked):
void setConst()
Mark this object as const.
std::unique_ptr< SG::DataProxy > m_proxy
Data proxy describing this branch/object.
Lock object for taking out upgradable locks.
void relinquish() override
Give up ownership of the bucket's contents. A no-op.
#define ATLAS_THREAD_SAFE
Smart pointer to manage DataObject reference counts.
EventFormat * m_outputEventFormat
Format of the current output file.
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
Define macros for attributes used to control the static checker.
const std::string & name() const override
Get the name of the instance.
RLoader(xAOD::Experimental::REvent &event, const std::string &name, const std::type_info &ti)
const ::TClass * m_class
Dictionary describing this branch/object.
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Add a new proxy to the store.
void setProxy(SG::DataProxy &proxy)
RHolderBucket(const std::string &key, const std::type_info &ti, xAOD::Experimental::REvent &event)
Constructor with an existing holder.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.