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 <unordered_map>
20
21class StatusCode;
22
23namespace CP
24{
25 class SystematicSet;
26
28
29 template<typename T,typename Aux = void> class SysWriteHandle final
31 {
32 //
33 // public interface
34 //
35
48 public:
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
58
60 public:
61 virtual bool empty () const noexcept override;
62
64 public:
65 explicit operator bool () const noexcept;
66
68 public:
69 virtual std::string getNamePattern () const override;
70
71
74 public:
75 StatusCode initialize (SysListHandle& sysListHandle);
76 StatusCode initialize (SysListHandle& sysListHandle, SG::AllowEmptyEnum);
78
79
81 public:
83
84
86 public:
87 template<typename X = Aux,typename = std::enable_if_t<std::is_same_v<X,void>>>
88 ::StatusCode record (std::unique_ptr<T> object,
90
91
93 public:
94 template<typename X = Aux,typename = std::enable_if_t<!std::is_same_v<X,void>>>
95 ::StatusCode record (std::unique_ptr<T> object,
96 std::unique_ptr<Aux> aux,
98
99
100
101 //
102 // inherited interface
103 //
104
105 private:
106 virtual CP::SystematicSet
108 virtual StatusCode
110 const CP::SystematicSet& fullAffecting,
111 const std::vector<CP::SystematicSet>& sysList) override;
112 virtual StatusCode
113 addDecorationDependency (const ISystematicsSvc& svc, const std::string& decoName, bool decoWrite) override;
114
115
116
117 //
118 // private interface
119 //
120
122 private:
124
126 private:
128
130 private:
131 std::unordered_map<CP::SystematicSet,std::string> m_outputNameCache;
132
133
135 private:
136 typedef std::decay<decltype(
137 *(std::declval<EL::AnaAlgorithm>().evtStore()))>::type StoreType;
138
140 private:
142
150 private:
152
153#ifndef XAOD_STANDALONE
158 private:
159 std::function<void(const DataObjID&, Gaudi::DataHandle::Mode)> m_addAlgDependency;
160#endif
161 };
162}
163
164#include "SysWriteHandle.icc"
165
166#endif
A property holding a SG store/key/clid from which a VarHandle 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
::StatusCode record(std::unique_ptr< T > object, const CP::SystematicSet &sys) const
record the object for the given systematic
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
get the affecting systematics if this is an input handle
std::function< StoreType *()> m_evtStoreGetter
the function to retrieve the event store
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::unordered_map< CP::SystematicSet, std::string > m_outputNameCache
the cache of names we use
std::decay< decltype(*(std::declval< EL::AnaAlgorithm >().evtStore()))>::type StoreType
the type of the event store we use
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
StoreType * m_evtStore
the event store we use
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
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
Class to wrap a set of SystematicVariations.
base class to forward messages to another class
STL class.
Select isolated Photons, Electrons and Muons.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Forward declaration.
STL namespace.
#define private