ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
CaloUtils::ToolWithConstants< BASE > Class Template Reference

#include <ToolWithConstants.h>

Inheritance diagram for CaloUtils::ToolWithConstants< BASE >:
Collaboration diagram for CaloUtils::ToolWithConstants< BASE >:

Public Types

typedef ToolWithConstants base_class
 Shorthand for derived classes. More...
 
using Context = CaloUtils::ToolConstantsContext
 Convenient alias for the Context type. More...
 
template<class T >
using Constant = ToolConstant< T >
 Alias for the Constant type. More...
 

Public Member Functions

virtual StatusCode initialize () override
 Initialize method. More...
 
Context context (const EventContext &ctx) const
 Create a Context object. More...
 
virtual void writeConstants (std::ostream &stream, const std::string &name, const EventContext &ctx) const
 Dump method (for debugging) More...
 
virtual StatusCode mergeConstants (CaloRec::ToolConstants &out, const EventContext &ctx) const override
 Merge our constants into out with the proper prefix. More...
 
virtual int toolVersion () const
 Return the version number for this tool. More...
 
virtual const std::string & toolType () const
 Return the name of the type of this tool. More...
 

Private Attributes

SG::ReadCondHandleKey< CaloRec::ToolConstantsm_DBHandle { this, "DBHandleKey", "", "" }
 Handle to a ToolConstants conditions object. More...
 
StringProperty m_prefix { this, "prefix", "", "" }
 Prefix for finding our constants within the ToolConstants object. More...
 
ToolWithConstantsImpl m_impl { this->name(), m_prefix, m_DBHandle }
 Internal implementation object. More...
 
Constant< int > m_order { this, "order", 0 }
 Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag. More...
 
Constant< bool > m_isdummy {this, "isDummy", false }
 If true, then this is a dummy tool that should not be executed. More...
 

Friends

template<class T >
class CaloUtils::ToolConstant
 

Detailed Description

template<class BASE>
class CaloUtils::ToolWithConstants< BASE >

Definition at line 438 of file ToolWithConstants.h.

Member Typedef Documentation

◆ base_class

template<class BASE >
typedef ToolWithConstants CaloUtils::ToolWithConstants< BASE >::base_class

Shorthand for derived classes.

Definition at line 443 of file ToolWithConstants.h.

◆ Constant

template<class BASE >
template<class T >
using CaloUtils::ToolWithConstants< BASE >::Constant = ToolConstant<T>

Alias for the Constant type.

Definition at line 456 of file ToolWithConstants.h.

◆ Context

Convenient alias for the Context type.

Definition at line 451 of file ToolWithConstants.h.

Member Function Documentation

◆ context()

template<class BASE >
Context CaloUtils::ToolWithConstants< BASE >::context ( const EventContext &  ctx) const

Create a Context object.

This can then be passed to Constant::operator().

◆ initialize()

template<class BASE >
virtual StatusCode CaloUtils::ToolWithConstants< BASE >::initialize ( )
overridevirtual

◆ mergeConstants()

template<class BASE >
virtual StatusCode CaloUtils::ToolWithConstants< BASE >::mergeConstants ( CaloRec::ToolConstants out,
const EventContext &  ctx 
) const
overridevirtual

Merge our constants into out with the proper prefix.

Parameters
[out]outObject to receive our constants.
ctxEvent context.

◆ toolType()

template<class BASE >
virtual const std::string& CaloUtils::ToolWithConstants< BASE >::toolType ( ) const
virtual

Return the name of the type of this tool.

A saved set of constants includes both the C++ class name and a version number. Normally, the class name is taken from the Gaudi type() method, but that may be changed by overriding this method. This can be used, for example, when there are tools with distinct C++ classes but which are yet similar enough to combine together.

◆ toolVersion()

template<class BASE >
virtual int CaloUtils::ToolWithConstants< BASE >::toolVersion ( ) const
virtual

Return the version number for this tool.

A saved set of constants includes both the C++ class name and a version number. The idea is that the version number can be bumped whenever there's a backwards-incompatible change; this gives some protection against trying to use an old version of a tool with an incompatible newer set of constants.

If you want a tool to have a version number, override this method. Otherwise, it will default to a version number of 0.

◆ writeConstants()

template<class BASE >
virtual void CaloUtils::ToolWithConstants< BASE >::writeConstants ( std::ostream &  stream,
const std::string &  name,
const EventContext &  ctx 
) const
virtual

Dump method (for debugging)

Parameters
streamOstream to which to write.
nameName to go in output
ctxEvent context.

Friends And Related Function Documentation

◆ CaloUtils::ToolConstant

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

Definition at line 524 of file ToolWithConstants.h.

Member Data Documentation

◆ m_DBHandle

template<class BASE >
SG::ReadCondHandleKey<CaloRec::ToolConstants> CaloUtils::ToolWithConstants< BASE >::m_DBHandle { this, "DBHandleKey", "", "" }
private

Handle to a ToolConstants conditions object.

Definition at line 527 of file ToolWithConstants.h.

◆ m_impl

template<class BASE >
ToolWithConstantsImpl CaloUtils::ToolWithConstants< BASE >::m_impl { this->name(), m_prefix, m_DBHandle }
private

Internal implementation object.

Definition at line 535 of file ToolWithConstants.h.

◆ m_isdummy

template<class BASE >
Constant<bool> CaloUtils::ToolWithConstants< BASE >::m_isdummy {this, "isDummy", false }
private

If true, then this is a dummy tool that should not be executed.

This is used for the case of reading from COOL using hierarchical tags: we need to have such tags associated with some object in each folder, regardless of whether or not the correction from that folder is actually used. [Every folder that IOVDbSvc knows about at configuration time needs to have a valid object for the configured tag, else IOVDbSvc will raise a fatal error. But we don't know at configuration time which folders we're actually going to need, so we gotta configure all of them.]

Definition at line 553 of file ToolWithConstants.h.

◆ m_order

template<class BASE >
Constant<int> CaloUtils::ToolWithConstants< BASE >::m_order { this, "order", 0 }
private

Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag.

Tools should be executed in order of increasing m_order.

Definition at line 540 of file ToolWithConstants.h.

◆ m_prefix

template<class BASE >
StringProperty CaloUtils::ToolWithConstants< BASE >::m_prefix { this, "prefix", "", "" }
private

Prefix for finding our constants within the ToolConstants object.

Definition at line 531 of file ToolWithConstants.h.


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