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
16#include <string>
17#include <type_traits>
18#include <unordered_map>
19
20class StatusCode;
21
22namespace CP
23{
24 class SysListHandle;
25 class SystematicSet;
26
27
29
30 template<typename T> class SysReadHandle final
32 {
33 //
34 // public interface
35 //
36
49 public:
50 template<typename T2>
51 SysReadHandle (T2 *owner, const std::string& propertyName,
52 const std::string& propertyValue,
53 const std::string& propertyDescription);
54
56 template<typename T2>
57 SysReadHandle (const std::string &inputName, T2 *owner);
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 ::StatusCode retrieve (const T*& object,
89
93 public:
95
96 //
97 // inherited interface
98 //
99
100 private:
101 virtual CP::SystematicSet
103 virtual StatusCode
105 const CP::SystematicSet& fullAffecting,
106 const std::vector<CP::SystematicSet>& sysList) override;
107
108
109
110 //
111 // private interface
112 //
113
115 private:
117
119 private:
120 std::unordered_map<CP::SystematicSet,std::string> m_inputNameCache;
121
122
124 private:
125 typedef std::decay<decltype(
126 *(std::declval<EL::AnaAlgorithm>().evtStore()))>::type StoreType;
127
129 private:
131
139 private:
141 };
142}
143
144#include "SysReadHandle.icc"
145
146#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
virtual std::string getNamePattern() const override
get the name pattern before substitution
std::string m_inputName
the input name we use
std::unordered_map< CP::SystematicSet, std::string > m_inputNameCache
the cache of names we use
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
get the affecting systematics if this is an input handle
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
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.
virtual bool empty() const noexcept override
whether we have a name configured
const std::string & getName(const CP::SystematicSet &sys) const
get the name we retrieve from the event store
::StatusCode retrieve(const T *&object, const CP::SystematicSet &sys) const
retrieve the object for the given name
StoreType * m_evtStore
the event store we use
std::decay< decltype(*(std::declval< EL::AnaAlgorithm >().evtStore()))>::type StoreType
the type of the event store we use
SysReadHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
std::function< StoreType *()> m_evtStoreGetter
the function to retrieve the event store
bool isValid(const CP::SystematicSet &sys) const
check if the object is available Note that this should only be used in special use cases and may be r...
Class to wrap a set of SystematicVariations.
base class to forward messages to another 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