ATLAS Offline Software
Loading...
Searching...
No Matches
ExtendedEventContext.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAKERNEL_EXTENDEDEVENTCONTEXT_H
6#define ATHENAKERNEL_EXTENDEDEVENTCONTEXT_H
7
9#include "GaudiKernel/EventIDBase.h"
10#include "GaudiKernel/EventContext.h"
12
14namespace SG {
15class ThinningCache;
16}
17namespace std { namespace pmr {
18class memory_resource;
19}}
20
21namespace Atlas {
22
24 public:
26
28 EventIDBase::number_type conditionsRun = EventIDBase::UNDEFNUM,
29 const TrigRoiDescriptor* roi = nullptr)
31 {}
32
33 void setProxy(IProxyDict* proxy) { m_proxy = proxy; }
35
36 void setConditionsRun (EventIDBase::number_type conditionsRun)
38 EventIDBase::number_type conditionsRun() const
39 { return m_conditionsRun; }
40
51 const TrigRoiDescriptor* roiDescriptor() const { return m_roi; }
52
53
62 void setThinningCache (const SG::ThinningCache* cache) { m_thinningCache = cache; }
64
65
72 void setMemResource (std::pmr::memory_resource* memResource) { m_memResource = memResource; }
73 std::pmr::memory_resource* memResource ATLAS_NOT_CONST_THREAD_SAFE () const { return m_memResource; }
74
75
76 private:
77 IProxyDict* m_proxy {nullptr};
78 EventIDBase::number_type m_conditionsRun {EventIDBase::UNDEFNUM};
79 const TrigRoiDescriptor* m_roi {nullptr};
81 std::pmr::memory_resource* m_memResource{nullptr};
82 };
83
84
85 //**********************************************************************
86 // Out-of-line routines for setting and getting the event context.
87 // Under some circumstances, the dynamic loader can bind the same
88 // symbol to different addresses in different libraries. Among
89 // other effects, this can cause std::any to malfunction; std::any
90 // is used inside EventContext to hold the extended context.
91 // To try to avoid this, we provide out-of-line functions
92 // to manipulate the extended context.
93
97 bool hasExtendedEventContext (const EventContext& ctx);
98
99
103 const ExtendedEventContext& getExtendedEventContext (const EventContext& ctx);
104
105
110 const ExtendedEventContext* tryGetExtendedEventContext (const EventContext& ctx);
111
112
116 ExtendedEventContext& getExtendedEventContext (EventContext& ctx);
117
118
123 ExtendedEventContext* tryGetExtendedEventContext (EventContext& ctx);
124
125
129 void setExtendedEventContext (EventContext& ctx,
130 ExtendedEventContext&& ectx);
131} // namespace Atlas
132
133#endif
134
Define macros for attributes used to control the static checker.
IProxyDict *proxy ATLAS_NOT_CONST_THREAD_SAFE() const
const TrigRoiDescriptor * m_roi
void setThinningCache(const SG::ThinningCache *cache)
Thread-local thinning cache.
void setProxy(IProxyDict *proxy)
void setMemResource(std::pmr::memory_resource *memResource)
Memory resource.
EventIDBase::number_type m_conditionsRun
ExtendedEventContext(IProxyDict *p, EventIDBase::number_type conditionsRun=EventIDBase::UNDEFNUM, const TrigRoiDescriptor *roi=nullptr)
const SG::ThinningCache * m_thinningCache
EventIDBase::number_type conditionsRun() const
const TrigRoiDescriptor * roiDescriptor() const
Get cached pointer to View's Region of Interest Descriptor or nullptr if not describing a View.
std::pmr::memory_resource *memResource ATLAS_NOT_CONST_THREAD_SAFE() const
const SG::ThinningCache * thinningCache() const
std::pmr::memory_resource * m_memResource
void setConditionsRun(EventIDBase::number_type conditionsRun)
Cache thinning decisions for converters.
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
const ExtendedEventContext * tryGetExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
Forward declaration.
STL namespace.