14#ifndef XAOD_STANDALONE
16#include "GaudiKernel/Converter.h"
17#include "GaudiKernel/GenericAddress.h"
34using mutex_t = AthContainers_detail::mutex;
36using 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 {
153 virtual StatusCode
createObj(IOpaqueAddress*, DataObject*& obj)
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;
196 static const bool QUIET =
true;
259 "Function should only be called through an invalid ElementLink");
263 const ::TString uniqueKey =
264 ::TString::Format(
"NonExistentKey_%lu", m_branches.size());
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);
400 bi.
m_class = mgr->holder()->getClass();
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);
419 auto ret = m_branches.insert(std::make_pair(sgkey, std::move(bi)));
422 return &(ret.first->second);
#define ATH_MSG_WARNING(x)
AthContainers_detail::mutex mutex_t
Mutex type for multithread synchronization.
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
uint32_t CLID
The Class ID type.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
void upgrade()
Convert the lock from upgrade to exclusive.
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 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 * cast(CLID, SG::IRegisterTransient *, bool) override
Return the object, cast to a CLID's 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.
AthContainers_detail::upgrading_lock< upgrade_mutex_t > upgrading_lock_t
Lock type 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.
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.
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.