ATLAS Offline Software
Loading...
Searching...
No Matches
CP::SysWriteHandle< T, Aux > Class Template Referencefinal

a data handle for writing systematics varied input data More...

#include <SysWriteHandle.h>

Inheritance diagram for CP::SysWriteHandle< T, Aux >:
Collaboration diagram for CP::SysWriteHandle< T, Aux >:

Classes

struct  SysData
 the data held per-systematic (filled in initialize) More...

Public Member Functions

template<typename T2>
 SysWriteHandle (T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
 Standard constructor.
template<typename T2>
 SysWriteHandle (const std::string &outputName, T2 *owner)
 Direct constructor which doesn't declare a property.
virtual bool empty () const noexcept override
 whether we have a name configured
 operator bool () const noexcept
 !empty()
virtual std::string getNamePattern () const override
 get the name pattern before substitution
const std::string & getName (const CP::SystematicSet &sys) const
 get the name we record to the event store
template<typename X = Aux, typename = std::enable_if_t<std::is_same_v<X,void>>>
::StatusCode record (std::unique_ptr< T > object, const CP::SystematicSet &sys, const EventContext &ctx=Gaudi::Hive::currentContext()) const
 record the object for the given systematic
template<typename X = Aux, typename = std::enable_if_t<!std::is_same_v<X,void>>>
::StatusCode record (std::unique_ptr< T > object, std::unique_ptr< Aux > aux, const CP::SystematicSet &sys, const EventContext &ctx=Gaudi::Hive::currentContext()) const
 record the object and aux store for the given systematic
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
StatusCode initialize (SysListHandle &sysListHandle)
 initialize this handle
StatusCode initialize (SysListHandle &sysListHandle, SG::AllowEmptyEnum)

Private Member Functions

virtual CP::SystematicSet getInputAffecting (const ISystematicsSvc &svc) const override
virtual StatusCode fillSystematics (const ISystematicsSvc &svc, const CP::SystematicSet &fullAffecting, const std::vector< CP::SystematicSet > &sysList) override
 register and cache the systematics
virtual StatusCode addDecorationDependency (const ISystematicsSvc &svc, const std::string &decoName, bool decoWrite) override
 add dependency information for the given decoration
const SG::WriteHandleKey< T > & getWriteHandle (const CP::SystematicSet &sys) const
 get the write handle key for the given systematic

Private Attributes

std::string m_outputName
 the output name we use
std::string m_outputType
 the explicit list of type names for output dependencies
std::unordered_map< CP::SystematicSet, SysDatam_sysData
std::function< void(const DataObjID &, Gaudi::DataHandle::Mode)> m_addAlgDependency
 a function to add a data dependency to the parent algorithm
std::function< MsgStream &()> m_msg
 the message stream we use

Detailed Description

template<typename T, typename Aux = void>
class CP::SysWriteHandle< T, Aux >

a data handle for writing systematics varied input data

Definition at line 32 of file SysWriteHandle.h.

Constructor & Destructor Documentation

◆ SysWriteHandle() [1/2]

template<typename T, typename Aux = void>
template<typename T2>
CP::SysWriteHandle< T, Aux >::SysWriteHandle ( T2 * owner,
const std::string & propertyName,
const std::string & propertyValue,
const std::string & propertyDescription )

Standard constructor.

Public Members

Parameters
ownerUsed to declare the property and for its messaging
propertyNameThe name of the property to declare
propertyValueThe default value for the property
propertyDescriptionThe 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 written should be configurable

◆ SysWriteHandle() [2/2]

template<typename T, typename Aux = void>
template<typename T2>
CP::SysWriteHandle< T, Aux >::SysWriteHandle ( const std::string & outputName,
T2 * owner )

Direct constructor which doesn't declare a property.

Member Function Documentation

◆ addDecorationDependency()

template<typename T, typename Aux = void>
virtual StatusCode CP::SysWriteHandle< T, Aux >::addDecorationDependency ( const ISystematicsSvc & svc,
const std::string & decoName,
bool decoWrite )
overrideprivatevirtual

add dependency information for the given decoration

Implements CP::ISysObjectHandleBase.

◆ empty()

template<typename T, typename Aux = void>
virtual bool CP::SysWriteHandle< T, Aux >::empty ( ) const
overridevirtualnoexcept

whether we have a name configured

Implements CP::ISysHandleBase.

◆ fillSystematics()

template<typename T, typename Aux = void>
virtual StatusCode CP::SysWriteHandle< T, Aux >::fillSystematics ( const ISystematicsSvc & svc,
const CP::SystematicSet & fullAffecting,
const std::vector< CP::SystematicSet > & sysList )
overrideprivatevirtual

register and cache the systematics

Implements CP::ISysHandleBase.

◆ getInputAffecting()

template<typename T, typename Aux = void>
virtual CP::SystematicSet CP::SysWriteHandle< T, Aux >::getInputAffecting ( const ISystematicsSvc & svc) const
overrideprivatevirtual

Inherited Members

Implements CP::ISysHandleBase.

◆ getName()

template<typename T, typename Aux = void>
const std::string & CP::SysWriteHandle< T, Aux >::getName ( const CP::SystematicSet & sys) const

get the name we record to the event store

◆ getNamePattern()

template<typename T, typename Aux = void>
virtual std::string CP::SysWriteHandle< T, Aux >::getNamePattern ( ) const
overridevirtual

get the name pattern before substitution

Implements CP::ISysObjectHandleBase.

◆ getWriteHandle()

template<typename T, typename Aux = void>
const SG::WriteHandleKey< T > & CP::SysWriteHandle< T, Aux >::getWriteHandle ( const CP::SystematicSet & sys) const
private

get the write handle key for the given systematic

◆ initialize() [1/2]

template<typename T, typename Aux = void>
StatusCode CP::SysWriteHandle< T, Aux >::initialize ( SysListHandle & sysListHandle)

initialize this handle

◆ initialize() [2/2]

template<typename T, typename Aux = void>
StatusCode CP::SysWriteHandle< T, Aux >::initialize ( SysListHandle & sysListHandle,
SG::AllowEmptyEnum  )

◆ msg() [1/2]

MsgStream & asg::AsgMessagingForward::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 24 of file AsgMessagingForward.cxx.

25 {
26 return m_msg();
27 }
std::function< MsgStream &()> m_msg
the message stream we use

◆ msg() [2/2]

MsgStream & asg::AsgMessagingForward::msg ( const MSG::Level lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 29 of file AsgMessagingForward.cxx.

30 {
31 MsgStream& msg = m_msg ();
32 msg << lvl;
33 return msg;
34 }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool asg::AsgMessagingForward::msgLvl ( const MSG::Level lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 11 of file AsgMessagingForward.cxx.

12 {
13 MsgStream& msg = m_msg();
14 if (msg.level() <= lvl)
15 {
16 msg << lvl;
17 return true;
18 } else
19 {
20 return false;
21 }
22 }

◆ operator bool()

template<typename T, typename Aux = void>
CP::SysWriteHandle< T, Aux >::operator bool ( ) const
explicitnoexcept

!empty()

◆ record() [1/2]

template<typename T, typename Aux = void>
template<typename X = Aux, typename = std::enable_if_t<std::is_same_v<X,void>>>
::StatusCode CP::SysWriteHandle< T, Aux >::record ( std::unique_ptr< T > object,
const CP::SystematicSet & sys,
const EventContext & ctx = Gaudi::Hive::currentContext() ) const

record the object for the given systematic

◆ record() [2/2]

template<typename T, typename Aux = void>
template<typename X = Aux, typename = std::enable_if_t<!std::is_same_v<X,void>>>
::StatusCode CP::SysWriteHandle< T, Aux >::record ( std::unique_ptr< T > object,
std::unique_ptr< Aux > aux,
const CP::SystematicSet & sys,
const EventContext & ctx = Gaudi::Hive::currentContext() ) const

record the object and aux store for the given systematic

Member Data Documentation

◆ m_addAlgDependency

template<typename T, typename Aux = void>
std::function<void(const DataObjID&, Gaudi::DataHandle::Mode)> CP::SysWriteHandle< T, Aux >::m_addAlgDependency
private

a function to add a data dependency to the parent algorithm

This wraps the owner's addDependency call and is used by addDecorationDependency to register MT dependencies.

Definition at line 137 of file SysWriteHandle.h.

◆ m_msg

std::function<MsgStream& ()> asg::AsgMessagingForward::m_msg
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.

◆ m_outputName

template<typename T, typename Aux = void>
std::string CP::SysWriteHandle< T, Aux >::m_outputName
private

the output name we use

Private Members

Definition at line 115 of file SysWriteHandle.h.

◆ m_outputType

template<typename T, typename Aux = void>
std::string CP::SysWriteHandle< T, Aux >::m_outputType
private

the explicit list of type names for output dependencies

Definition at line 118 of file SysWriteHandle.h.

◆ m_sysData

template<typename T, typename Aux = void>
std::unordered_map<CP::SystematicSet,SysData> CP::SysWriteHandle< T, Aux >::m_sysData
private

Definition at line 126 of file SysWriteHandle.h.


The documentation for this class was generated from the following file: