ATLAS Offline Software
Loading...
Searching...
No Matches
SysReadDecorHandle.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef SYSTEMATICS_HANDLES__SYS_READ_DECOR_HANDLE_H
9#define SYSTEMATICS_HANDLES__SYS_READ_DECOR_HANDLE_H
10
19#include <string>
20#include <type_traits>
21#include <unordered_map>
22
23class StatusCode;
24
25namespace CP
26{
27 class SystematicSet;
28
29
31
32 template<typename T> class SysReadDecorHandle final
34 {
35 //
36 // public interface
37 //
38
51 public:
52 template<typename T2>
53 SysReadDecorHandle (T2 *owner, const std::string& propertyName,
54 const std::string& propertyValue,
55 const std::string& propertyDescription);
56
58 template<typename T2>
59 SysReadDecorHandle (const std::string& decorName, T2 *owner);
60
61
63 public:
64 virtual bool empty () const noexcept override;
65
67 public:
68 explicit operator bool () const noexcept;
69
74 private:
75 virtual std::string getNamePattern () const override;
76
77
80 public:
81 StatusCode initialize (SysListHandle& sysListHandle, const ISysHandleBase& objectHandle);
82 StatusCode initialize (SysListHandle& sysListHandle, const ISysHandleBase& objectHandle, SG::AllowEmptyEnum);
84
85
87 public:
89
90
92 public:
93 const T& get (const SG::AuxElement& object,
95
96
97
98 //
99 // inherited interface
100 //
101
102 private:
103 virtual CP::SystematicSet
105 virtual StatusCode
107 const CP::SystematicSet& fullAffecting,
108 const std::vector<CP::SystematicSet>& sysList) override;
109
110
111
112 //
113 // private interface
114 //
115
117 private:
119
121 private:
123
125 private:
126 std::unordered_map<CP::SystematicSet,std::tuple<std::string,SG::ConstAccessor<T> > > m_dataCache;
127
129 private:
130 const auto&
131 getData (const CP::SystematicSet& sys) const;
132 };
133
134 template <typename T>
136}
137
138#include "SysReadDecorHandle.icc"
139
140#endif
A property holding a SG store/key/clid from which a VarHandle is made.
Base class for elements of a container that can have aux data.
a basic interface for all systematics handles
the interface for the central systematics service
Vector-like class for systematic handles which interact with decorations.
a class managing the property to configure the list of systematics to process
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
register and cache the systematics
const ISysHandleBase * m_objectHandle
the object handle we use
const T & get(const SG::AuxElement &object, const CP::SystematicSet &sys) const
retrieve the object decoration for the given systematic
const std::string & getName(const CP::SystematicSet &sys) const
get the name we retrieve from the event store
SysReadDecorHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize this handle
virtual bool empty() const noexcept override
whether we have a name configured
SysReadDecorHandle(const std::string &decorName, T2 *owner)
Construct the handle directly without declaring a property.
std::string m_decorName
the input name we use
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
get the affecting systematics if this is an input handle
virtual std::string getNamePattern() const override
get the name pattern before substitution
std::unordered_map< CP::SystematicSet, std::tuple< std::string, SG::ConstAccessor< T > > > m_dataCache
the cache of names we use
const auto & getData(const CP::SystematicSet &sys) const
get the data for the given systematics
Class to wrap a set of SystematicVariations.
base class to forward messages to another class
Select isolated Photons, Electrons and Muons.
SysHandleArray< SysReadDecorHandle< T > > SysReadDecorHandleArray
Forward declaration.
STL namespace.
#define private