ATLAS Offline Software
Loading...
Searching...
No Matches
SysWriteDecorHandle.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_WRITE_DECOR_HANDLE_H
9#define SYSTEMATICS_HANDLES__SYS_WRITE_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
31 constexpr float invalidScaleFactor () {return -1;}
32
35 constexpr float invalidEfficiency () {return -1;}
36
37
39
40 template<typename T> class SysWriteDecorHandle final
42 {
43 //
44 // public interface
45 //
46
59 public:
60 template<typename T2>
61 SysWriteDecorHandle (T2 *owner, const std::string& propertyName,
62 const std::string& propertyValue,
63 const std::string& propertyDescription);
64
66 template<typename T2>
67 SysWriteDecorHandle (const std::string& decorName, T2 *owner);
68
70 public:
71 virtual bool empty () const noexcept override;
72
74 public:
75 explicit operator bool () const noexcept;
76
77
80 public:
81 StatusCode initialize (SysListHandle& sysListHandle, ISysObjectHandleBase& objectHandle);
82 StatusCode initialize (SysListHandle& sysListHandle, ISysObjectHandleBase& objectHandle, SG::AllowEmptyEnum);
84
85
87 public:
89
91 public:
92 const std::string& getDecorName () const noexcept;
93
94
96 public:
97 void set (const SG::AuxElement& object, const T& value,
99
102 public:
103 void lock (const SG::AuxElement& object,
105
106
107
108 //
109 // inherited interface
110 //
111
112 private:
113 virtual CP::SystematicSet
115 virtual StatusCode
117 const CP::SystematicSet& fullAffecting,
118 const std::vector<CP::SystematicSet>& sysList) override;
119
120
121
122 //
123 // private interface
124 //
125
127 private:
129
131 private:
133
135 private:
136 struct SysData
137 {
139 std::string name;
140
143 };
144 std::unordered_map<CP::SystematicSet,SysData> m_sysData;
145
147 private:
148 const auto&
149 getData (const CP::SystematicSet& sys) const;
150 };
151
152 template <typename T>
154}
155
157
158#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.
#define private
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
StatusCode initialize(SysListHandle &sysListHandle, ISysObjectHandleBase &objectHandle)
initialize this handle
ISysObjectHandleBase * m_objectHandle
the object handle we use
void lock(const SG::AuxElement &object, const CP::SystematicSet &sys) const
lock the object decoration for the given systematic You should call this after all set() calls for a ...
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
register and cache the systematics
const auto & getData(const CP::SystematicSet &sys) const
get the data for the given systematics
const std::string & getName(const CP::SystematicSet &sys) const
get the name we retrieve from the event store
virtual bool empty() const noexcept override
whether we have a name configured
SysWriteDecorHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
SysWriteDecorHandle(const std::string &decorName, T2 *owner)
Construct the handle directly without declaring a property.
void set(const SG::AuxElement &object, const T &value, const CP::SystematicSet &sys) const
set the object decoration for the given systematic
std::string m_decorName
the input name we use
std::unordered_map< CP::SystematicSet, SysData > m_sysData
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
get the affecting systematics if this is an input handle
const std::string & getDecorName() const noexcept
get the decoration name we use
Class to wrap a set of SystematicVariations.
base class to forward messages to another class
Select isolated Photons, Electrons and Muons.
SysHandleArray< SysWriteDecorHandle< T > > SysWriteDecorHandleArray
constexpr float invalidEfficiency()
the decoration value to use if there is no valid efficiency decoration
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
::StatusCode StatusCode
StatusCode definition for legacy code.
Forward declaration.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
STL namespace.
the data held per-systematic (filled in initialize)
SG::Decorator< T > decorator
the decorator for the decoration
std::string name
the expanded name of the decoration