ATLAS Offline Software
|
a systematics data handle that will either copy the input object or act like an update handle More...
#include <SysCopyHandle.h>
Public Member Functions | |
template<typename T2 > | |
SysCopyHandle (T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription) | |
Standard constructor. More... | |
template<typename T2 > | |
SysCopyHandle (const std::string &inputName, const std::string &outputName, T2 *owner) | |
Construct directly without declaring properties. More... | |
virtual bool | empty () const noexcept override |
whether we have a name configured More... | |
operator bool () const noexcept | |
!empty() More... | |
virtual std::string | getNamePattern () const override |
get the name pattern before substitution More... | |
::StatusCode | getCopy (T *&object, const CP::SystematicSet &sys) const |
retrieve the object for the given name More... | |
bool | msgLvl (const MSG::Level lvl) const |
Test the output level of the object. More... | |
MsgStream & | msg () const |
The standard message stream. More... | |
MsgStream & | msg (const MSG::Level lvl) const |
The standard message stream. More... | |
StatusCode | initialize (SysListHandle &sysListHandle) |
initialize this handle More... | |
StatusCode | initialize (SysListHandle &sysListHandle, SG::AllowEmptyEnum) |
Private Types | |
typedef std::decay< decltype(*(std::declval< EL::AnaAlgorithm >).evtStore()))>::type | StoreType |
the type of the event store we use More... | |
Private Member Functions | |
virtual CP::SystematicSet | getInputAffecting (const ISystematicsSvc &svc) const override |
get the affecting systematics if this is an input handle More... | |
virtual StatusCode | fillSystematics (const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override |
register and cache the systematics More... | |
Private Attributes | |
std::string | m_inputName |
the input name we use More... | |
std::string | m_outputName |
the (optional) name of the copy we create More... | |
std::unordered_map< CP::SystematicSet, std::tuple< std::string, std::string, std::string > > | m_nameCache |
the cache of names we use More... | |
StoreType * | m_evtStore = nullptr |
the event store we use More... | |
std::function< StoreType *()> | m_evtStoreGetter |
the function to retrieve the event store More... | |
std::function< MsgStream &()> | m_msg |
the message stream we use More... | |
a systematics data handle that will either copy the input object or act like an update handle
There are several use cases for this data handle:
Normally this handle will be configured both with the name of the input object and the name of the output object to create. In that case it will create a shallow copy of the input object and add it to the event store.
Alternatively if the second name is not given, it will do a non-const retrieve of the input object and effectively act like an update handle. This is essentially an optimization to avoid shallow copies when no systematics are added. This is not common and may break some assumptions in Athena.
The template parameter T
can optionally be const
qualified to indicate that only a const
object will be needed. This can be used if only the copy behavior of this handle is needed, but the copy won't be modified. That is a rather specialized behavior, since normally we only need copies to modify them. As such it is recommended to switch those algorithms to a SysReadHandle
and schedule an CP::AsgShallowCopyAlg
beforehand to do the copy.
Definition at line 60 of file SysCopyHandle.h.
|
private |
the type of the event store we use
Definition at line 160 of file SysCopyHandle.h.
CP::SysCopyHandle< T >::SysCopyHandle | ( | T2 * | owner, |
const std::string & | propertyName, | ||
const std::string & | propertyValue, | ||
const std::string & | propertyDescription | ||
) |
Standard constructor.
T2 | The type of the owner |
owner | Used to declare the property and for its messaging |
propertyName | The name of the property to declare. An additional propertyName+"Out" property will be declared to set the output name |
propertyValue | The default value for the property |
propertyDescription | The description of the property |
This version of the constructor declares a property on the parent object and should usually be preferred when the container to be copied should be configurable
CP::SysCopyHandle< T >::SysCopyHandle | ( | const std::string & | inputName, |
const std::string & | outputName, | ||
T2 * | owner | ||
) |
Construct directly without declaring properties.
T2 | The owner that provides the messaging and event store |
inputName | The name of the input container |
outputName | The name of the output container (acts like an update handle if set to the empty string) |
owner | The owner that provides the messaging and event store |
|
overridevirtualnoexcept |
whether we have a name configured
Implements CP::ISysHandleBase.
|
overrideprivatevirtual |
register and cache the systematics
Implements CP::ISysHandleBase.
::StatusCode CP::SysCopyHandle< T >::getCopy | ( | T *& | object, |
const CP::SystematicSet & | sys | ||
) | const |
retrieve the object for the given name
|
overrideprivatevirtual |
get the affecting systematics if this is an input handle
This returns the empty set if this is either not an input handle, or if the input handle is not affected by systematics.
Implements CP::ISysHandleBase.
|
overridevirtual |
get the name pattern before substitution
Implements CP::ISysHandleBase.
StatusCode CP::SysCopyHandle< T >::initialize | ( | SysListHandle & | sysListHandle | ) |
initialize this handle
StatusCode CP::SysCopyHandle< T >::initialize | ( | SysListHandle & | sysListHandle, |
SG::AllowEmptyEnum | |||
) |
|
inherited |
The standard message stream.
Definition at line 24 of file AsgMessagingForward.cxx.
|
inherited |
|
inherited |
Test the output level of the object.
lvl | The message level to test against |
true
If messages at level "lvl" will be printed Definition at line 11 of file AsgMessagingForward.cxx.
|
explicitnoexcept |
!empty()
|
private |
the event store we use
Definition at line 164 of file SysCopyHandle.h.
|
private |
the function to retrieve the event store
This is an std::function to allow the parent to be either a tool or an algorithm. Though we are not really supporting tools as parents when using SysListHandle, so in principle this could be replaced with a pointer to the algorithm instead.
Definition at line 174 of file SysCopyHandle.h.
|
private |
the input name we use
Definition at line 146 of file SysCopyHandle.h.
|
privateinherited |
the message stream we use
This used to be a simple pointer to the MsgStream
itself, but in AthenaMT the actual object used is local to the thread. So instead of pointing to it directly we are now using a function to look it up, which will get the thread-local object.
Definition at line 77 of file AsgMessagingForward.h.
|
private |
the cache of names we use
Definition at line 154 of file SysCopyHandle.h.
|
private |
the (optional) name of the copy we create
Definition at line 150 of file SysCopyHandle.h.