ATLAS Offline Software
Loading...
Searching...
No Matches
SysWriteHandle.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef SYSTEMATICS_HANDLES__SYS_WRITE_HANDLE_H
9#define SYSTEMATICS_HANDLES__SYS_WRITE_HANDLE_H
10
17#include <memory>
18#include <string>
19#include <type_traits>
20#include <unordered_map>
21
22class StatusCode;
23
24namespace CP
25{
26 class SysListHandle;
27 class SystematicSet;
28
29
31
32 template<typename T,typename Aux = void> class SysWriteHandle final
34 {
37 public:
38
49 template<typename T2>
50 SysWriteHandle (T2 *owner, const std::string& propertyName,
51 const std::string& propertyValue,
52 const std::string& propertyDescription);
53
55 template<typename T2>
56 SysWriteHandle (const std::string &outputName, T2 *owner);
57
59 virtual bool empty () const noexcept override;
60
62 explicit operator bool () const noexcept;
63
65 virtual std::string getNamePattern () const override;
66
67
70 StatusCode initialize (SysListHandle& sysListHandle);
71 StatusCode initialize (SysListHandle& sysListHandle, SG::AllowEmptyEnum);
73
74
77
78
80 template<typename X = Aux,typename = std::enable_if_t<std::is_same_v<X,void>>>
81 ::StatusCode record (std::unique_ptr<T> object,
83 const EventContext& ctx = Gaudi::Hive::currentContext()) const;
84
85
87 template<typename X = Aux,typename = std::enable_if_t<!std::is_same_v<X,void>>>
88 ::StatusCode record (std::unique_ptr<T> object,
89 std::unique_ptr<Aux> aux,
91 const EventContext& ctx = Gaudi::Hive::currentContext()) const;
92
93
94
97 private:
98
99 virtual CP::SystematicSet
101 virtual StatusCode
103 const CP::SystematicSet& fullAffecting,
104 const std::vector<CP::SystematicSet>& sysList) override;
105 virtual StatusCode
106 addDecorationDependency (const ISystematicsSvc& svc, const std::string& decoName, bool decoWrite) override;
107
108
109
112 private:
113
116
119
126 std::unordered_map<CP::SystematicSet,SysData> m_sysData;
127
130
131
132#ifndef XAOD_STANDALONE
137 std::function<void(const DataObjID&, Gaudi::DataHandle::Mode)> m_addAlgDependency;
138#endif
139 };
140}
141
142#include "SysWriteHandle.icc"
143
144#endif
Property holding a SG store/key/clid from which a WriteHandle is made.
a ISysHandleBase for a handle to a specific object/container
the interface for the central systematics service
a class managing the property to configure the list of systematics to process
virtual StatusCode addDecorationDependency(const ISystematicsSvc &svc, const std::string &decoName, bool decoWrite) override
add dependency information for the given decoration
SysWriteHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
SysWriteHandle(const std::string &outputName, T2 *owner)
Direct constructor which doesn't declare a property.
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
const std::string & getName(const CP::SystematicSet &sys) const
get the name we record to the event store
std::string m_outputName
the output name we use
std::function< void(const DataObjID &, Gaudi::DataHandle::Mode)> m_addAlgDependency
a function to add a data dependency to the parent algorithm
std::unordered_map< CP::SystematicSet, SysData > m_sysData
virtual bool empty() const noexcept override
whether we have a name configured
std::string m_outputType
the explicit list of type names for output dependencies
const SG::WriteHandleKey< T > & getWriteHandle(const CP::SystematicSet &sys) const
get the write handle key for the given systematic
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
register and cache the systematics
virtual std::string getNamePattern() const override
get the name pattern before substitution
::StatusCode record(std::unique_ptr< T > object, const CP::SystematicSet &sys, const EventContext &ctx=Gaudi::Hive::currentContext()) const
record the object for the given systematic
Class to wrap a set of SystematicVariations.
Property holding a SG store/key/clid from which a WriteHandle is made.
base class to forward messages to another class
STL class.
Select isolated Photons, Electrons and Muons.
::StatusCode StatusCode
StatusCode definition for legacy code.
=============================================================================
Forward declaration.
STL namespace.
the data held per-systematic (filled in initialize)
SG::WriteHandleKey< T > writeHandle
the write handle key for the (expanded) output container
#define private
Definition testRead.cxx:27