18#ifndef CALOUTILS_TOOLWITHCONSTANTS_H
19#define CALOUTILS_TOOLWITHCONSTANTS_H
29#include "Gaudi/Property.h"
41template <
unsigned int N>
44 return StatusCode::FAILURE;
62 const EventContext&
ctx()
const {
return m_ctx; }
65 const EventContext&
ctx)
86 virtual std::string
name()
const = 0;
114 const std::string& prefix,
146 const std::string& name,
147 const EventContext& ctx)
const;
194template <CxxUtils::FromArrayrep T>
212 template <
class OWNER>
214 const std::string&
name,
215 const std::string& doc =
"");
228 template <
class OWNER>
230 const std::string&
name,
243 template <
class OWNER,
245 typename = std::enable_if_t<std::is_arithmetic_v<U> > >
247 const std::string&
name,
249 const std::string& doc =
"");
270 virtual std::string
name()
const override;
285 :
public Gaudi::Property<T>
295 const std::string& doc,
307 const std::string& doc,
313 using Gaudi::Property<T>::operator=;
326 virtual void toStream( std::ostream& out )
const override;
333 virtual StatusCode
fromString(
const std::string& value )
override;
363 requires (T& c, Gaudi::Property<int>& p)
365 { c.declareProperty(p) };
444template <HasProperties BASE>
445class ToolWithConstants
446 :
public extends<BASE, IToolWithConstants>
450 typedef ToolWithConstants base_class;
462 template <CxxUtils::FromArrayrep T>
477 Context
context (
const EventContext& ctx)
const;
487 const std::string& name,
488 const EventContext& ctx)
const;
497 const EventContext& ctx)
const override;
530 template <CxxUtils::FromArrayrep T>
535 {
this,
"DBHandleKey",
"",
"" };
539 {
this,
"prefix",
"",
"" };
548 {
this,
"order", 0 };
561 {
this,
"isDummy",
false };
571#undef ATH_TWC_REQUIRES
Exceptions that can be thrown from CaloUtils.
Helpers for checking error return status codes and reporting errors.
Read-only multidimensional array.
Concept to test if a class has Gaudi properties.
ToolWithConstantsImpl m_impl
Internal implementation object.
StringProperty m_prefix
Prefix for finding our constants within the ToolConstants object.
Constant< int > m_order
Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag....
virtual StatusCode mergeConstants(CaloRec::ToolConstants &out, const EventContext &ctx) const override
Merge our constants into out with the proper prefix.
Constant< bool > m_isdummy
If true, then this is a dummy tool that should not be executed. This is used for the case of reading ...
virtual const std::string & toolType() const
Return the name of the type of this tool.
virtual int toolVersion() const
Return the version number for this tool.
virtual void writeConstants(std::ostream &stream, const std::string &name, const EventContext &ctx) const
Dump method (for debugging).
SG::ReadCondHandleKey< CaloRec::ToolConstants > m_DBHandle
Handle to a ToolConstants conditions object.
virtual StatusCode initialize() override
Hold constants for a tool.
Context context(const EventContext &ctx) const
Create a Context object.
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
=============================================================================
Context object for retrieving ToolConstant values.
const CaloRec::ToolConstants * m_constants
const EventContext & m_ctx
const EventContext & ctx() const
ToolConstantsContext(const CaloRec::ToolConstants *constants, const EventContext &ctx)