 |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #ifndef XAOD_STANDALONE
16 #include "GaudiKernel/Converter.h"
17 #include "GaudiKernel/GenericAddress.h"
20 #endif // NOT XAOD_STANDALONE
36 using guard_t = AthContainers_detail::lock_guard<mutex_t>;
38 #ifndef XAOD_STANDALONE
54 static constexpr
bool METADATA =
false;
57 static constexpr
bool SILENT =
false;
67 static constexpr
bool SILENT =
false;
78 const std::type_info&
tinfo()
const override {
return m_ti; }
83 throw std::runtime_error(
"xAODPrivate::HolderBucket::cast not implemented");
89 bool isConst)
override {
92 static constexpr
bool SILENT =
true;
93 static constexpr
bool METADATA =
false;
94 const void*
result =
nullptr;
95 if (isConst ==
false) {
117 const_cast<void*
>(
result);
123 bool isConst)
override {
154 static const bool SILENT =
true;
155 static const bool METADATA =
false;
160 return StatusCode::SUCCESS;
166 return StatusCode::SUCCESS;
169 return StatusCode::FAILURE;
181 #endif // not XAOD_STANDALONE
196 static const bool QUIET =
true;
259 "Function should only be called through an invalid ElementLink");
263 const ::TString uniqueKey =
269 std::make_pair(
stringToKey(uniqueKey.Data(), clid), std::move(bi)));
272 return StatusCode::SUCCESS;
279 std::vector<const SG::DataProxy*> ret;
280 for (
const auto&
p : m_branches) {
283 ret.push_back(
proxy);
310 const std::string&,
bool,
bool) {
312 throw std::runtime_error(
"xAOD::Event::recordObject is not implemented");
317 static const std::string
result{
"xAOD::Event"};
325 static const bool QUIET =
true;
336 if (missingSGKeys.emplace(
sgkey).second) {
339 "Can't find EventFormatElement for hashed SG key: " <<
sgkey);
356 auto it = m_branches.find(
sgkey);
357 if (
it != m_branches.end()) {
358 return &(
it->second);
371 static const bool SILENT =
true;
372 static const bool METADATA =
false;
384 static const std::type_info&
dummy =
typeid(
Event);
405 #ifndef XAOD_STANDALONE
407 auto taddr = std::make_unique<SG::TransientAddress>(
408 CLID_NULL, efe->
branchName(),
new GenericAddress());
409 taddr->setSGKey(
sgkey);
412 bi.
m_proxy = std::make_unique<SG::DataProxy>(std::move(taddr), loader);
414 #endif // not XAOD_STANDALONE
419 auto ret = m_branches.insert(std::make_pair(
sgkey, std::move(bi)));
422 return &(ret.first->second);
void * cast(CLID, SG::IRegisterTransient *, bool) override
Return the object, cast to a CLID's type.
Interface for registering a transient object in t2p map.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
const std::type_info & tinfo() const override
Return the type_info of the stored object.
Loader(xAOD::Event &event, const std::string &name, const std::type_info &ti)
const std::string & name() const override
Get the name of the instance.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
const ::TClass * m_class
Dictionary describing this branch/object.
Object_t m_inputObjects
Collection of all the managed input objects.
xAOD::Event & m_event
The original Event object.
EventFormat m_inputEventFormat
Format of the current input file.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
void setProxy(SG::DataProxy &proxy)
Event(std::string_view name)
Constructor with a name.
const std::type_info & m_ti
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const std::string * keyToString(SG::sgkey_t key) const override
Find the string corresponding to a given key.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.
Simple smart pointer for Gaudi-style refcounted objects.
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&obj) override
void relinquish() override
Give up ownership of the bucket's contents. A no-op.
void lock() override
Lock the held object. A no-op.
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
HolderBucket(const std::string &key, const std::type_info &ti, xAOD::Event &event)
Constructor with an existing holder.
bool m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Add a new proxy to the store.
std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::unique_ptr< SG::DataProxy > m_proxy
Data proxy describing this branch/object.
const std::type_info & m_ti
The type info of the object.
upgrade_mutex_t m_branchesMutex
Mutex for multithread synchronization.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
Helper struct used by the IProxyDict code.
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent) override
Function for retrieving an input object in a non-template way.
uint32_t CLID
The Class ID type.
Helper object for holding something through a THolder.
Object_t m_outputObjects
Collection of all the managed output object.
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
const std::string m_key
The key of the object.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
EventFormat * m_outputEventFormat
Format of the current output file.
#define ATH_MSG_WARNING(x)
AthContainers_detail::mutex mutex_t
Mutex type for multithread synchronization.
void setConst()
Mark this object as const.
virtual long repSvcType() const override
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
Lock object for taking out upgradable locks.
#define ATLAS_THREAD_SAFE
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
Manager for EDM objects created by ROOT.
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
Define macros for attributes used to control the static checker.
void * object() override
Return the object held.
void * cast(const std::type_info &tinfo, SG::IRegisterTransient *, bool isConst) override
Return the object, cast to a certain type.
void registerKey(SG::sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
void * cast(CLID, const std::type_info &tinfo, SG::IRegisterTransient *irt, bool isConst) override
Return the object, cast to type.