ATLAS Offline Software
Loading...
Searching...
No Matches
SysReadHandle.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef SYSTEMATICS_HANDLES__SYS_READ_HANDLE_H
9#define SYSTEMATICS_HANDLES__SYS_READ_HANDLE_H
10
17#include <string>
18#include <type_traits>
19#include <unordered_map>
20
21class StatusCode;
22
23namespace CP
24{
25 class SysListHandle;
26 class SystematicSet;
27
28
30
31 template<typename T> class SysReadHandle final
33 {
36 public:
37
48 template<typename T2>
49 SysReadHandle (T2 *owner, const std::string& propertyName,
50 const std::string& propertyValue,
51 const std::string& propertyDescription);
52
54 template<typename T2>
55 SysReadHandle (const std::string &inputName, T2 *owner);
56
58 virtual bool empty () const noexcept override;
59
61 explicit operator bool () const noexcept;
62
64 virtual std::string getNamePattern () const override;
65
66
69 StatusCode initialize (SysListHandle& sysListHandle);
70 StatusCode initialize (SysListHandle& sysListHandle, SG::AllowEmptyEnum);
72
73
76
77
79 ::StatusCode retrieve (const T*& object,
81 const EventContext& ctx = Gaudi::Hive::currentContext()) const;
82
87 const EventContext& ctx = Gaudi::Hive::currentContext()) const;
88
89
90
93 private:
94
95 virtual CP::SystematicSet
97 virtual StatusCode
99 const CP::SystematicSet& fullAffecting,
100 const std::vector<CP::SystematicSet>& sysList) override;
101 virtual StatusCode
102 addDecorationDependency (const ISystematicsSvc& svc, const std::string& decoName, bool decoWrite) override;
103
104
105
108 private:
109
112
119 std::unordered_map<CP::SystematicSet,SysData> m_sysData;
120
123
124
125#ifndef XAOD_STANDALONE
130 std::function<void(const DataObjID&, Gaudi::DataHandle::Mode)> m_addAlgDependency;
131#endif
132 };
133}
134
135#include "SysReadHandle.icc"
136
137#endif
Property holding a SG store/key/clid from which a ReadHandle 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 std::string getNamePattern() const override
get the name pattern before substitution
bool isValid(const CP::SystematicSet &sys, const EventContext &ctx=Gaudi::Hive::currentContext()) const
check if the object is available Note that this should only be used in special use cases and may be r...
std::string m_inputName
the input name we use
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
::StatusCode retrieve(const T *&object, const CP::SystematicSet &sys, const EventContext &ctx=Gaudi::Hive::currentContext()) const
retrieve the object for the given name
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
register and cache the systematics
SysReadHandle(const std::string &inputName, T2 *owner)
Direct constructor which doesn't declare a property.
std::unordered_map< CP::SystematicSet, SysData > m_sysData
virtual bool empty() const noexcept override
whether we have a name configured
std::function< void(const DataObjID &, Gaudi::DataHandle::Mode)> m_addAlgDependency
a function to add a data dependency to the parent algorithm
const std::string & getName(const CP::SystematicSet &sys) const
get the name we retrieve from the event store
const SG::ReadHandleKey< T > & getReadHandle(const CP::SystematicSet &sys) const
get the read handle key for the given systematic
SysReadHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
virtual StatusCode addDecorationDependency(const ISystematicsSvc &svc, const std::string &decoName, bool decoWrite) override
add dependency information for the given decoration
Class to wrap a set of SystematicVariations.
Property holding a SG store/key/clid from which a ReadHandle is made.
base class to forward messages to another 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::ReadHandleKey< T > readHandle
the read handle key for the (expanded) input container
#define private
Definition testRead.cxx:27