ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
CaloUtils::ToolConstant< T > Class Template Reference

Constant of a ToolWithConstants. More...

#include <ToolWithConstants.h>

Inheritance diagram for CaloUtils::ToolConstant< T >:
Collaboration diagram for CaloUtils::ToolConstant< T >:

Classes

class  CProperty
 Internal wrapper for Gaudi::Property. More...
 

Public Types

using Context = ToolConstantsContext
 Alias for the context object. More...
 

Public Member Functions

template<class OWNER >
 ToolConstant (OWNER *owner, const std::string &name, const std::string &doc="")
 Declare a constant with no default. More...
 
template<class OWNER >
 ToolConstant (OWNER *owner, const std::string &name, const char *doc)
 Declare a constant with no default. More...
 
template<class OWNER , typename U = T, typename = std::enable_if_t<std::is_arithmetic_v<U> >>
 ToolConstant (OWNER *owner, const std::string &name, const T &deflt, const std::string &doc="")
 Declare a constant with a default. More...
 
operator() (const Context &c) const
 Retrieve the value of a constant. More...
 
operator() () const
 Retrieve the value of a constant. More...
 
virtual std::string name () const override
 Return the name of this constant. More...
 
virtual bool setFromJO () const override
 Was this constant set through job options? More...
 

Private Attributes

CProperty m_prop
 Internal Property instance, for getting JO settings from Gaudi. More...
 
int m_toolVersion
 Version of the owning tool. More...
 

Detailed Description

template<class T>
class CaloUtils::ToolConstant< T >

Constant of a ToolWithConstants.

See ToolWithContants below for usage information.

Definition at line 200 of file ToolWithConstants.h.

Member Typedef Documentation

◆ Context

template<class T >
using CaloUtils::ToolConstant< T >::Context = ToolConstantsContext

Alias for the context object.

Definition at line 205 of file ToolWithConstants.h.

Constructor & Destructor Documentation

◆ ToolConstant() [1/3]

template<class T >
template<class OWNER >
CaloUtils::ToolConstant< T >::ToolConstant ( OWNER *  owner,
const std::string &  name,
const std::string &  doc = "" 
)

Declare a constant with no default.

Parameters
ownerThe owning ToolWithConstants.
nameName of the constant.
docDocumentation string.

◆ ToolConstant() [2/3]

template<class T >
template<class OWNER >
CaloUtils::ToolConstant< T >::ToolConstant ( OWNER *  owner,
const std::string &  name,
const char *  doc 
)

Declare a constant with no default.

Parameters
ownerThe owning ToolWithConstants.
nameName of the constant.
docDocumentation string.

(Needed in addition to the previous signature in order to avoid ambiguities; otherwise, if a char* is given for the third argument, it would match the following signature instead of the previous one.)

◆ ToolConstant() [3/3]

template<class T >
template<class OWNER , typename U = T, typename = std::enable_if_t<std::is_arithmetic_v<U> >>
CaloUtils::ToolConstant< T >::ToolConstant ( OWNER *  owner,
const std::string &  name,
const T &  deflt,
const std::string &  doc = "" 
)

Declare a constant with a default.

Parameters
ownerThe owning ToolWithConstants.
nameName of the constant.
defltDefault value.
docDocumentation string.

Only possible for arithmetic types, not Array<N>.

Member Function Documentation

◆ name()

template<class T >
virtual std::string CaloUtils::ToolConstant< T >::name ( ) const
overridevirtual

Return the name of this constant.

Implements CaloUtils::IToolConstant.

◆ operator()() [1/2]

template<class T >
T CaloUtils::ToolConstant< T >::operator() ( ) const

Retrieve the value of a constant.

This variant may only be used if the constant was initialized via JO.

◆ operator()() [2/2]

template<class T >
T CaloUtils::ToolConstant< T >::operator() ( const Context c) const

Retrieve the value of a constant.

Parameters
cContext for accessing condtions (as returned from context()).

◆ setFromJO()

template<class T >
virtual bool CaloUtils::ToolConstant< T >::setFromJO ( ) const
overridevirtual

Was this constant set through job options?

Implements CaloUtils::IToolConstant.

Member Data Documentation

◆ m_prop

template<class T >
CProperty CaloUtils::ToolConstant< T >::m_prop
private

Internal Property instance, for getting JO settings from Gaudi.

Definition at line 350 of file ToolWithConstants.h.

◆ m_toolVersion

template<class T >
int CaloUtils::ToolConstant< T >::m_toolVersion
private

Version of the owning tool.

Definition at line 353 of file ToolWithConstants.h.


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