14#ifndef XAOD_STANDALONE
17#include "GaudiKernel/Converter.h"
18#include "GaudiKernel/GenericAddress.h"
36using mutex_t = AthContainers_detail::mutex;
38using guard_t = AthContainers_detail::lock_guard<mutex_t>;
40#ifndef XAOD_STANDALONE
56 static constexpr bool METADATA =
false;
59 static constexpr bool SILENT =
false;
69 static constexpr bool SILENT =
false;
75 const_cast<void*
>(result);
80 const std::type_info&
tinfo()
const override {
return m_ti; }
89 throw std::runtime_error(std::format (
"xAODPrivate::HolderBucket::cast cannot look up CLID {}", clid));
95 bool isConst)
override {
98 static constexpr bool SILENT =
true;
99 static constexpr bool METADATA =
false;
100 const void* result =
nullptr;
101 if (isConst ==
false) {
108 if (result ==
nullptr) {
123 const_cast<void*
>(result);
129 bool isConst)
override {
159 virtual StatusCode
createObj(IOpaqueAddress*, DataObject*& obj)
override {
160 static const bool SILENT =
true;
161 static const bool METADATA =
false;
166 return StatusCode::SUCCESS;
172 return StatusCode::SUCCESS;
175 return StatusCode::FAILURE;
202 static const bool QUIET =
true;
234 static mutex_t
mutex;
265 "Function should only be called through an invalid ElementLink");
269 const ::TString uniqueKey =
270 ::TString::Format(
"NonExistentKey_%lu", m_branches.size());
275 std::make_pair(
stringToKey(uniqueKey.Data(), clid), std::move(bi)));
278 return StatusCode::SUCCESS;
285 std::vector<const SG::DataProxy*> ret;
286 for (
const auto& p : m_branches) {
289 ret.push_back(
proxy);
316 const std::string&,
bool,
bool) {
318 throw std::runtime_error(
"xAOD::Event::recordObject is not implemented");
323 static const std::string result{
"xAOD::Event"};
331 static const bool QUIET =
true;
340 static mutex_t
mutex;
342 if (missingSGKeys.emplace(sgkey).second) {
345 "Can't find EventFormatElement for hashed SG key: " << sgkey);
362 auto it = m_branches.find(sgkey);
363 if (it != m_branches.end()) {
364 return &(it->second);
377 static const bool SILENT =
true;
378 static const bool METADATA =
false;
390 static const std::type_info& dummy =
typeid(
Event);
406 bi.
m_class = mgr->holder()->getClass();
411#ifndef XAOD_STANDALONE
413 auto taddr = std::make_unique<SG::TransientAddress>(
414 CLID_NULL, efe->
branchName(),
new GenericAddress());
415 taddr->setSGKey(sgkey);
418 bi.
m_proxy = std::make_unique<SG::DataProxy>(std::move(taddr), loader);
425 auto ret = m_branches.insert(std::make_pair(sgkey, std::move(bi)));
428 return &(ret.first->second);
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
Provide an interface for finding inheritance information at run time.
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
uint32_t CLID
The Class ID type.
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
const std::type_info & typeinfo() const
Return the std::type_info for this class.
Interface for registering a transient object in t2p map.
Helper object for holding something through a THolder.
const std::type_info & m_ti
The type info of the object.
const std::string m_key
The key of the object.
xAOD::Event & m_event
The original Event object.
const std::type_info & tinfo() const override
Return the type_info of the stored object.
void * cast(CLID clid, SG::IRegisterTransient *irt, bool isConst) override
Return the object, cast to a CLID's type.
void lock() override
Lock the held object. A no-op.
void * cast(const std::type_info &tinfo, SG::IRegisterTransient *, bool isConst) override
Return the object, cast to a certain type.
HolderBucket(const std::string &key, const std::type_info &ti, xAOD::Event &event)
Constructor with an existing holder.
void * cast(CLID, const std::type_info &tinfo, SG::IRegisterTransient *irt, bool isConst) override
Return the object, cast to type.
void * object() override
Return the object held.
void relinquish() override
Give up ownership of the bucket's contents. A no-op.
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&obj) override
void setProxy(SG::DataProxy &proxy)
Loader(xAOD::Event &event, const std::string &name, const std::type_info &ti)
virtual long repSvcType() const override
const std::type_info & m_ti
Manager for EDM objects created by ROOT.
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
EventFormat m_inputEventFormat
Format of the current input file.
const std::string & name() const override
Get the name of the instance.
const std::string * keyToString(SG::sgkey_t key) const 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.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.
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) override
Function for retrieving an input object in a non-template way.
upgrade_mutex_t m_branchesMutex
Mutex for multithread synchronization.
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
Object_t m_inputObjects
Collection of all the managed input objects.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
Event(std::string_view name)
Constructor with a name.
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.
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
EventFormat * m_outputEventFormat
Format of the current output file.
Object_t m_outputObjects
Collection of all the managed output object.
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
AthContainers_detail::upgrading_lock< upgrade_mutex_t > upgrading_lock_t
Lock type for multithread synchronization.
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
AthContainers_detail::mutex mutex_t
Mutex used to synchronize modifications to the cache vector.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Helper struct used by the IProxyDict code.
std::unique_ptr< SG::DataProxy > m_proxy
Data proxy describing this branch/object.
const ::TClass * m_class
Dictionary describing this branch/object.