ATLAS Offline Software
ExtendedEventContext.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 
13 class TrigRoiDescriptor;
14 namespace SG {
15 class ThinningCache;
16 }
17 namespace std { namespace pmr {
18 class memory_resource;
19 }}
20 
21 namespace Atlas {
22 
24  public:
26 
28  EventIDBase::number_type conditionsRun = EventIDBase::UNDEFNUM,
29  const TrigRoiDescriptor* roi = nullptr)
31  {}
32 
35 
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; }
63  const SG::ThinningCache* thinningCache() const { return m_thinningCache; }
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 
109  ExtendedEventContext& getExtendedEventContext (EventContext& ctx);
110 
111 
115  void setExtendedEventContext (EventContext& ctx,
116  ExtendedEventContext&& ectx);
117 } // namespace Atlas
118 
119 #endif
120 
Atlas::ExtendedEventContext::m_thinningCache
const SG::ThinningCache * m_thinningCache
Definition: ExtendedEventContext.h:80
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
Atlas::ExtendedEventContext::conditionsRun
EventIDBase::number_type conditionsRun() const
Definition: ExtendedEventContext.h:38
Atlas::hasExtendedEventContext
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
Definition: ExtendedEventContext.cxx:23
Atlas::ExtendedEventContext::m_conditionsRun
EventIDBase::number_type m_conditionsRun
Definition: ExtendedEventContext.h:78
Atlas::ExtendedEventContext::setThinningCache
void setThinningCache(const SG::ThinningCache *cache)
Thread-local thinning cache.
Definition: ExtendedEventContext.h:62
AtlasMcWeight::number_type
unsigned int number_type
Definition: AtlasMcWeight.h:20
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
Atlas::ExtendedEventContext::roiDescriptor
const TrigRoiDescriptor * roiDescriptor() const
Get cached pointer to View's Region of Interest Descriptor or nullptr if not describing a View.
Definition: ExtendedEventContext.h:51
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
Atlas::getExtendedEventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition: ExtendedEventContext.cxx:32
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
IProxyDict.h
Atlas::ExtendedEventContext::setConditionsRun
void setConditionsRun(EventIDBase::number_type conditionsRun)
Definition: ExtendedEventContext.h:36
Atlas::ExtendedEventContext::m_memResource
std::pmr::memory_resource * m_memResource
Definition: ExtendedEventContext.h:81
Atlas::ExtendedEventContext::m_proxy
IProxyDict * m_proxy
Definition: ExtendedEventContext.h:77
Atlas::ExtendedEventContext::m_roi
const TrigRoiDescriptor * m_roi
Definition: ExtendedEventContext.h:79
Atlas::ExtendedEventContext::thinningCache
const SG::ThinningCache * thinningCache() const
Definition: ExtendedEventContext.h:63
Atlas::ExtendedEventContext::ATLAS_NOT_CONST_THREAD_SAFE
IProxyDict *proxy ATLAS_NOT_CONST_THREAD_SAFE() const
Definition: ExtendedEventContext.h:34
Atlas::ExtendedEventContext::setProxy
void setProxy(IProxyDict *proxy)
Definition: ExtendedEventContext.h:33
Atlas::ExtendedEventContext::setMemResource
void setMemResource(std::pmr::memory_resource *memResource)
Memory resource.
Definition: ExtendedEventContext.h:72
Atlas::ExtendedEventContext::ATLAS_NOT_CONST_THREAD_SAFE
std::pmr::memory_resource *memResource ATLAS_NOT_CONST_THREAD_SAFE() const
Definition: ExtendedEventContext.h:73
checker_macros.h
Define macros for attributes used to control the static checker.
SG::ThinningCache
Cache thinning decisions for converters.
Definition: ThinningCache.h:48
Atlas::setExtendedEventContext
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
Definition: ExtendedEventContext.cxx:50
Atlas::ExtendedEventContext::ExtendedEventContext
ExtendedEventContext()
Definition: ExtendedEventContext.h:25
Atlas::ExtendedEventContext::ExtendedEventContext
ExtendedEventContext(IProxyDict *p, EventIDBase::number_type conditionsRun=EventIDBase::UNDEFNUM, const TrigRoiDescriptor *roi=nullptr)
Definition: ExtendedEventContext.h:27
Atlas
Definition: ExtendedEventContext.h:21