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
113
114
115 //
116 // private interface
117 //
118
120 private:
122
124 private:
125 std::unordered_map<CP::SystematicSet,std::string> m_outputNameCache;
126
127
129 private:
130 typedef std::decay<decltype(
131 *(std::declval<EL::AnaAlgorithm>().evtStore()))>::type StoreType;
132
134 private:
136
144 private:
146 };
147}
148
149#include "SysWriteHandle.icc"
150
151#endif
A property holding a SG store/key/clid from which a VarHandle is made.
a basic interface for all systematics handles
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
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
StoreType * m_evtStore
the event store we use
virtual bool empty() const noexcept override
whether we have a name configured
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