ATLAS Offline Software
Loading...
Searching...
No Matches
SgEventMeta.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASGTOOLS_SGEVENTMETA_H
6#define ASGTOOLS_SGEVENTMETA_H
7
8// Local include(s):
11
12// Complain if we try using this header in Athena:
13#if !defined(XAOD_STANDALONE) && !defined(__CPPCHECK__)
14# error "This header should not be used in Athena"
15#endif // XAOD_STANDALONE
16
17#include <memory>
18#include <vector>
19
20// Forward declaration(s):
21namespace xAOD {
22 class Event;
23} // namespace xAOD
24
25namespace asg {
26
46
47 public:
49 enum StoreType {
52 }; // enum StoreType
53
56
58 SgEventMeta(SgEventMeta&& other) noexcept;
59
61 SgEventMeta& operator=(SgEventMeta&& other) noexcept;
62
65
66 // Prevent copying
67 SgEventMeta(const SgEventMeta&) = delete;
69
72
74 template< typename T >
75 bool contains( const std::string& name );
77 template< typename T >
78 bool transientContains( const std::string& name ) const;
79
81 template< typename T >
82 StatusCode retrieve( T*& obj, const std::string& name );
84 template< typename T >
85 StatusCode retrieve( const T*& obj, const std::string& name );
86
88 template< typename T >
89 StatusCode record( std::unique_ptr<T> obj, const std::string& cname );
90
92 template< typename T >
93 StatusCode record( T* obj, const std::string& name );
94
98 template< typename T >
99 void keys( std::vector<std::string>& vkeys ) const;
100
102
103 private:
105 StatusCode initialize() const;
106
110 mutable std::atomic<xAOD::Event*> m_event;
111
112 }; // class SgEventMeta
113
114} // namespace asg
115
116// Include the template implementation:
118
119#endif // ASGTOOLS_SGEVENTMETA_H
Wrapper class providing StoreGate-like access to metadata in ROOT.
Definition SgEventMeta.h:45
StatusCode record(T *obj, const std::string &name)
Record an object into the store.
SgEventMeta & operator=(const SgEventMeta &)=delete
std::atomic< xAOD::Event * > m_event
Pointer to the xAOD::Event object in use.
SgEventMeta & operator=(SgEventMeta &&other) noexcept
Move assignment operator.
bool contains(const std::string &name)
Check if an object is available for constant access.
StatusCode initialize() const
Function initialising the object.
void keys(std::vector< std::string > &vkeys) const
provide list of all keys associated with a type.
SgEventMeta(StoreType type, xAOD::Event *event=0)
Constructor with a type and an optional Event pointer.
StatusCode record(std::unique_ptr< T > obj, const std::string &cname)
Record an object/container using a smart pointer for ownership.
bool transientContains(const std::string &name) const
Check if an object is available for non-constant access.
StoreType
Type of the store that this object implements.
Definition SgEventMeta.h:49
@ InputStore
This store is used to access the input metadata.
Definition SgEventMeta.h:50
@ OutputStore
This store is used to access the output metadata.
Definition SgEventMeta.h:51
SgEventMeta(const SgEventMeta &)=delete
StoreType m_type
Type of this store.
StatusCode retrieve(T *&obj, const std::string &name)
Retrieve a non-constant pointer to an object in the store.
StatusCode retrieve(const T *&obj, const std::string &name)
Retrieve a constant pointer to an object in the store.
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
Definition Event.h:60
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.