Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SysReadDecorHandle.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_DECOR_HANDLE_H
9 #define SYSTEMATICS_HANDLES__SYS_READ_DECOR_HANDLE_H
10 
19 #include <string>
20 #include <type_traits>
21 #include <unordered_map>
22 
23 class StatusCode;
24 
25 namespace CP
26 {
27  class SystematicSet;
28 
29 
31 
32  template<typename T> class SysReadDecorHandle final
34  {
35  //
36  // public interface
37  //
38 
51  public:
52  template<typename T2>
53  SysReadDecorHandle (T2 *owner, const std::string& propertyName,
54  const std::string& propertyValue,
55  const std::string& propertyDescription);
56 
58  template<typename T2>
59  SysReadDecorHandle (const std::string& decorName, T2 *owner);
60 
61 
63  public:
64  virtual bool empty () const noexcept override;
65 
67  public:
68  explicit operator bool () const noexcept;
69 
74  private:
75  virtual std::string getNamePattern () const override;
76 
77 
80  public:
81  StatusCode initialize (SysListHandle& sysListHandle, const ISysHandleBase& objectHandle);
84 
85 
87  public:
89 
90 
92  public:
93  const T& get (const SG::AuxElement& object,
95 
96 
97 
98  //
99  // inherited interface
100  //
101 
102  private:
103  virtual CP::SystematicSet
105  virtual StatusCode
107  const CP::SystematicSet& fullAffecting,
108  const std::vector<CP::SystematicSet>& sysList) override;
109 
110 
111 
112  //
113  // private interface
114  //
115 
117  private:
118  std::string m_decorName;
119 
121  private:
123 
125  private:
126  std::unordered_map<CP::SystematicSet,std::tuple<std::string,SG::AuxElement::ConstAccessor<T> > > m_dataCache;
127 
129  private:
130  const auto&
131  getData (const CP::SystematicSet& sys) const;
132  };
133 
134  template <typename T>
136 }
137 
138 #include "SysReadDecorHandle.icc"
139 
140 #endif
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition: SysListHandle.h:33
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CP::ISystematicsSvc
the interface for the central systematics service
Definition: ISystematicsSvc.h:25
asg::AsgMessagingForward
base class to forward messages to another class
Definition: AsgMessagingForward.h:29
CP::SysReadDecorHandle::m_dataCache
std::unordered_map< CP::SystematicSet, std::tuple< std::string, SG::AuxElement::ConstAccessor< T > > > m_dataCache
the cache of names we use
Definition: SysReadDecorHandle.h:126
CP::SysReadDecorHandle::fillSystematics
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
register and cache the systematics
SysListHandle.h
CP::SysReadDecorHandle::SysReadDecorHandle
SysReadDecorHandle(const std::string &decorName, T2 *owner)
Construct the handle directly without declaring a property.
SystematicSet.h
CP::SysReadDecorHandle::m_objectHandle
const ISysHandleBase * m_objectHandle
the object handle we use
Definition: SysReadDecorHandle.h:122
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
AsgMessagingForward.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
CP::SysReadDecorHandle::getNamePattern
virtual std::string getNamePattern() const override
get the name pattern before substitution
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::SysReadDecorHandle::SysReadDecorHandle
SysReadDecorHandle(T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
Standard constructor.
SysHandleArray.h
AnaAlgorithm.h
SG::AllowEmptyEnum
AllowEmptyEnum
Definition: StoreGate/StoreGate/VarHandleKey.h:29
CP::SysReadDecorHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize this handle
CP::ISysHandleBase
a basic interface for all systematics handles
Definition: ISysHandleBase.h:28
CP::SysReadDecorHandle::get
const T & get(const SG::AuxElement &object, const CP::SystematicSet &sys) const
retrieve the object decoration for the given systematic
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
CP::SysReadDecorHandle
a data handle for reading systematics varied input data
Definition: SysReadDecorHandle.h:34
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CP::SysReadDecorHandle::getData
const auto & getData(const CP::SystematicSet &sys) const
get the data for the given systematics
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
columnar::final
CM final
Definition: ColumnAccessor.h:106
ISysHandleBase.h
CP::SysReadDecorHandle::empty
virtual bool empty() const noexcept override
whether we have a name configured
CP::SysReadDecorHandle::getName
const std::string & getName(const CP::SystematicSet &sys) const
get the name we retrieve from the event store
CP::SysReadDecorHandle::getInputAffecting
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc) const override
get the affecting systematics if this is an input handle
CP::SysHandleArray
Vector-like class for systematic handles which interact with decorations.
Definition: SysHandleArray.h:26
CP::SysReadDecorHandle::m_decorName
std::string m_decorName
the input name we use
Definition: SysReadDecorHandle.h:118
SysReadDecorHandle.icc
AuxElement.h
Base class for elements of a container that can have aux data.
VarHandleKey.h
A property holding a SG store/key/clid from which a VarHandle is made.