ATLAS Offline Software
Loading...
Searching...
No Matches
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.

Public Member Functions

template<class OWNER>
 ToolConstant (OWNER *owner, const std::string &name, const std::string &doc="")
 Declare a constant with no default.
template<class OWNER>
 ToolConstant (OWNER *owner, const std::string &name, const char *doc)
 Declare a constant with no default.
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.
operator() (const Context &c) const
 Retrieve the value of a constant.
operator() () const
 Retrieve the value of a constant.
virtual std::string name () const override
 Return the name of this constant.
virtual bool setFromJO () const override
 Was this constant set through job options?

Private Attributes

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

Detailed Description

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

Constant of a ToolWithConstants.

See ToolWithContants below for usage information.

Definition at line 198 of file ToolWithConstants.h.

Member Typedef Documentation

◆ Context

Alias for the context object.

Definition at line 203 of file ToolWithConstants.h.

Constructor & Destructor Documentation

◆ ToolConstant() [1/3]

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 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 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()

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

Return the name of this constant.

Implements CaloUtils::IToolConstant.

◆ operator()() [1/2]

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]

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()

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

Was this constant set through job options?

Implements CaloUtils::IToolConstant.

Member Data Documentation

◆ m_prop

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

Internal Property instance, for getting JO settings from Gaudi.

Definition at line 348 of file ToolWithConstants.h.

◆ m_toolVersion

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

Version of the owning tool.

Definition at line 351 of file ToolWithConstants.h.


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