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
70
73 public:
74 StatusCode initialize (SysListHandle& sysListHandle, ISysObjectHandleBase& objectHandle);
75 StatusCode initialize (SysListHandle& sysListHandle, ISysObjectHandleBase& objectHandle, SG::AllowEmptyEnum);
77
78
80 public:
82
83
85 public:
86 const T& get (const SG::AuxElement& object,
88
89
90
91 //
92 // inherited interface
93 //
94
95 private:
96 virtual CP::SystematicSet
98 virtual StatusCode
100 const CP::SystematicSet& fullAffecting,
101 const std::vector<CP::SystematicSet>& sysList) override;
102
103
104
105 //
106 // private interface
107 //
108
110 private:
112
114 private:
116
118 private:
119 std::unordered_map<CP::SystematicSet,std::tuple<std::string,SG::ConstAccessor<T> > > m_dataCache;
120
122 private:
123 const auto&
124 getData (const CP::SystematicSet& sys) const;
125 };
126
127 template <typename T>
129}
130
131#include "SysReadDecorHandle.icc"
132
133#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
a ISysHandleBase for a handle to a specific object/container
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 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.
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
StatusCode initialize(SysListHandle &sysListHandle, ISysObjectHandleBase &objectHandle)
initialize this handle
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
get the affecting systematics if this is an input handle
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
ISysObjectHandleBase * m_objectHandle
the object handle we use
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