|
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(
"THolderBucket::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
217 static const bool QUIET =
true;
235 const std::string&
key )
const {
250 static mutex_t
mutex;
252 if( missingSGKeys.emplace(
sgkey ).second &&
254 ::Warning(
"xAOD::TEvent::proxy_exact",
255 "Can't find BranchInfo for %d.",
277 auto it = m_branches.find(
sgkey );
278 if(
it != m_branches.end() ) {
279 return &(
it->second );
292 static const bool SILENT =
true;
293 static const bool METADATA =
false;
305 static const std::type_info&
dummy =
typeid(
TEvent );
318 ::Error(
"xAOD::TEvent::getBranchInfo",
327 #ifndef XAOD_STANDALONE
331 new GenericAddress() );
339 #endif // not XAOD_STANDALONE
344 auto ret = m_branches.insert( std::make_pair(
sgkey, std::move( bi ) ) );
347 return &( ret.first->second );
354 static const bool QUIET =
true;
363 static mutex_t
mutex;
365 if( missingSGKeys.emplace(
sgkey ).second ) {
367 ::Warning(
"xAOD::TEvent::getEventFormatElement",
368 "Can't find EventFormatElement for hashed "
369 "SG key %d",
sgkey );
392 ::Warning(
"xAOD::TEvent::addToStore",
393 "Function should only be called through an invalid "
403 m_branches.insert( std::make_pair(
stringToKey( uniqueKey.Data(),
408 return StatusCode::SUCCESS;
415 std::vector< const SG::DataProxy* > ret;
416 for(
const auto&
p : m_branches ) {
419 ret.push_back(
proxy );
446 const std::string&,
bool,
bool ) {
448 throw std::runtime_error(
"xAOD::TEvent::recordObject is not "
454 static const std::string NAME =
"xAOD::TEvent";
Interface for registering a transient object in t2p map.
void lock() override
Lock the held object. A no-op.
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
const std::string & name() const override
Get the name of the instance.
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.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
const std::type_info & tinfo() const override
Return the type_info of the stored object.
void * cast(CLID, SG::IRegisterTransient *, bool) override
Return the object, cast to a CLID's type.
const std::string * keyToString(SG::sgkey_t key) const override
Find the string corresponding to a given key.
Object_t m_inputObjects
Collection of all the managed input objects.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.
void registerKey(SG::sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
const ::TClass * m_class
Dictionary describing this branch/object.
void * cast(const std::type_info &tinfo, SG::IRegisterTransient *, bool isConst) override
Return the object, cast to a certain type.
Helper struct used by the IProxyDict code.
void * object() override
Return the object held.
const std::string m_key
The key of the object.
void * cast(CLID, const std::type_info &tinfo, SG::IRegisterTransient *irt, bool isConst) override
Return the object, cast to type.
Bool_t m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
POOL::TEvent event(POOL::TEvent::kClassAccess)
::StatusCode StatusCode
StatusCode definition for legacy code.
EventFormat m_inputEventFormat
Format of the current input file.
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
const std::type_info & m_ti
uint32_t CLID
The Class ID type.
virtual long repSvcType() const override
Object_t m_outputObjects
Collection of all the managed output object.
void upgrade()
Convert the lock from upgrade to exclusive.
void setProxy(SG::DataProxy &proxy)
upgrade_mutex_t m_branchesMutex
TLoader(xAOD::TEvent &event, const std::string &name, const std::type_info &ti)
Helper object for holding something through a THolder.
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
TEvent(EAuxMode mode=kUndefinedAccess)
Default constructor.
void relinquish() override
Give up ownership of the bucket's contents. A no-op.
Manager for EDM objects created by ROOT.
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&) override
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
EventFormat * m_outputEventFormat
Format of the current output file.
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
const std::type_info & m_ti
The type info of the object.
xAOD::TEvent & m_event
The original TEvent object.
void setSGKey(sgkey_t sgkey)
check if it is a transient ID (primary or symLinked):
void setConst()
Mark this object as const.
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Add a new proxy to the store.
Lock object for taking out upgradable locks.
#define ATLAS_THREAD_SAFE
Smart pointer to manage DataObject reference counts.
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.
std::unique_ptr< SG::DataProxy > m_proxy
Data proxy describing this branch/object.
THolderBucket(const std::string &key, const std::type_info &ti, xAOD::TEvent &event)
Constructor with an existing holder.
Tool for accessing xAOD files outside of Athena.