ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CP::SysWriteDecorHandle< T > Class Template Referencefinal

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

#include <SysWriteDecorHandle.h>

Inheritance diagram for CP::SysWriteDecorHandle< T >:
Collaboration diagram for CP::SysWriteDecorHandle< T >:

Public Member Functions

template<typename T2 >
 SysWriteDecorHandle (T2 *owner, const std::string &propertyName, const std::string &propertyValue, const std::string &propertyDescription)
 Standard constructor. More...
 
template<typename T2 >
 SysWriteDecorHandle (const std::string &decorName, T2 *owner)
 Construct the handle directly without declaring a property. More...
 
virtual bool empty () const noexcept override
 whether we have a name configured More...
 
 operator bool () const noexcept
 !empty() More...
 
const std::string & getName (const CP::SystematicSet &sys) const
 get the name we retrieve from the event store More...
 
void set (const SG::AuxElement &object, const T &value, const CP::SystematicSet &sys) const
 set the object decoration for the given systematic 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, const ISysHandleBase &objectHandle)
 initialize this handle More...
 
StatusCode initialize (SysListHandle &sysListHandle, const ISysHandleBase &objectHandle, SG::AllowEmptyEnum)
 

Private Member Functions

virtual std::string getNamePattern () const override
 get the name pattern before substitution More...
 
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...
 
const auto & getData (const CP::SystematicSet &sys) const
 get the data for the given systematics More...
 

Private Attributes

std::string m_decorName
 the input name we use More...
 
const ISysHandleBasem_objectHandle {nullptr}
 the object handle we use More...
 
std::unordered_map< CP::SystematicSet, std::tuple< std::string, SG::AuxElement::Decorator< T > > > m_dataCache
 the cache of names we use More...
 
std::function< MsgStream &()> m_msg
 the message stream we use More...
 

Detailed Description

template<typename T>
class CP::SysWriteDecorHandle< T >

a data handle for reading systematics varied input data

Definition at line 40 of file SysWriteDecorHandle.h.

Constructor & Destructor Documentation

◆ SysWriteDecorHandle() [1/2]

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

Standard constructor.

Template Parameters
T2The type of the owner
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 decoration to be written should be configurable

◆ SysWriteDecorHandle() [2/2]

template<typename T >
template<typename T2 >
CP::SysWriteDecorHandle< T >::SysWriteDecorHandle ( const std::string &  decorName,
T2 *  owner 
)

Construct the handle directly without declaring a property.

Member Function Documentation

◆ empty()

template<typename T >
virtual bool CP::SysWriteDecorHandle< T >::empty ( ) const
overridevirtualnoexcept

whether we have a name configured

Implements CP::ISysHandleBase.

◆ fillSystematics()

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

register and cache the systematics

Implements CP::ISysHandleBase.

◆ getData()

template<typename T >
const auto& CP::SysWriteDecorHandle< T >::getData ( const CP::SystematicSet sys) const
private

get the data for the given systematics

◆ getInputAffecting()

template<typename T >
virtual CP::SystematicSet CP::SysWriteDecorHandle< T >::getInputAffecting ( const ISystematicsSvc svc) const
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.

◆ getName()

template<typename T >
const std::string& CP::SysWriteDecorHandle< T >::getName ( const CP::SystematicSet sys) const

get the name we retrieve from the event store

◆ getNamePattern()

template<typename T >
virtual std::string CP::SysWriteDecorHandle< T >::getNamePattern ( ) const
overrideprivatevirtual

get the name pattern before substitution

This is not currently defined for decoration handles and made private.

Implements CP::ISysHandleBase.

◆ initialize() [1/2]

template<typename T >
StatusCode CP::SysWriteDecorHandle< T >::initialize ( SysListHandle sysListHandle,
const ISysHandleBase objectHandle 
)

initialize this handle

◆ initialize() [2/2]

template<typename T >
StatusCode CP::SysWriteDecorHandle< T >::initialize ( SysListHandle sysListHandle,
const ISysHandleBase objectHandle,
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  }

◆ 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  }

◆ 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 >
CP::SysWriteDecorHandle< T >::operator bool ( ) const
explicitnoexcept

!empty()

◆ set()

template<typename T >
void CP::SysWriteDecorHandle< T >::set ( const SG::AuxElement object,
const T &  value,
const CP::SystematicSet sys 
) const

set the object decoration for the given systematic

Member Data Documentation

◆ m_dataCache

template<typename T >
std::unordered_map<CP::SystematicSet,std::tuple<std::string,SG::AuxElement::Decorator<T> > > CP::SysWriteDecorHandle< T >::m_dataCache
private

the cache of names we use

Definition at line 133 of file SysWriteDecorHandle.h.

◆ m_decorName

template<typename T >
std::string CP::SysWriteDecorHandle< T >::m_decorName
private

the input name we use

Definition at line 125 of file SysWriteDecorHandle.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_objectHandle

template<typename T >
const ISysHandleBase* CP::SysWriteDecorHandle< T >::m_objectHandle {nullptr}
private

the object handle we use

Definition at line 129 of file SysWriteDecorHandle.h.


The documentation for this class was generated from the following file:
asg::AsgMessagingForward::m_msg
std::function< MsgStream &()> m_msg
the message stream we use
Definition: AsgMessagingForward.h:77
asg::AsgMessagingForward::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessagingForward.cxx:24