Algorithm used for testing ToolWithConstants.
More...
#include <ToolWithConstantsTestTool.h>
|
StringProperty | m_condKey { this, "CondKey", "", "" } |
|
IntegerProperty | m_runNumber { this, "RunNumber", 284500, "" } |
|
Constant< float > | m_cf1 { this, "cf1", 1.5, "cf1 doc" } |
|
Constant< int > | m_ci1 { this, "ci1", "ci1 doc" } |
|
Constant< bool > | m_cb1 { this, "cb1", "cb1 doc" } |
|
Constant< CaloRec::Array< 1 > > | m_ca1 { this, "ca1", "ca1 doc" } |
|
Constant< CaloRec::Array< 2 > > | m_ca2 { this, "ca2", "ca2 doc" } |
|
SG::ReadCondHandleKey< CaloRec::ToolConstants > | m_DBHandle |
| Handle to a ToolConstants conditions object. More...
|
|
StringProperty | m_prefix |
| Prefix for finding our constants within the ToolConstants object. More...
|
|
ToolWithConstantsImpl | m_impl |
| Internal implementation object. More...
|
|
Constant< int > | m_order |
| Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag. More...
|
|
Constant< bool > | m_isdummy |
| If true, then this is a dummy tool that should not be executed. More...
|
|
Algorithm used for testing ToolWithConstants.
Definition at line 27 of file ToolWithConstantsTestTool.h.
◆ base_class
◆ Constant
◆ Context
◆ context()
Create a Context
object.
This can then be passed to Constant::operator()
.
◆ execute()
StatusCode CaloUtils::ToolWithConstantsTestTool::execute |
( |
const EventContext & |
ctx | ) |
const |
Gaudi execute method.
Dump out current values of the constants.
Definition at line 100 of file ToolWithConstantsTestTool.cxx.
103 #define CHECKCONST(V) \
106 auto val = V (myctx); \
107 ATH_MSG_INFO (#V << " " << val); \
109 catch (const std::exception& e) { \
110 ATH_MSG_INFO (#V << " " << e.what()); \
118 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CaloUtils::ToolWithConstantsTestTool::initialize |
( |
| ) |
|
|
overridevirtual |
Gaudi initialize method.
Make some ToolConstants conditions objects for testing.
Reimplemented from CaloUtils::ToolWithConstants< AthAlgTool >.
Definition at line 28 of file ToolWithConstantsTestTool.cxx.
32 return StatusCode::SUCCESS;
43 auto cc = std::make_unique<CondCont_t> (*rcusvc.get(),
id);
46 EventIDBase::UNDEFEVT,
47 EventIDBase::UNDEFNUM,
48 EventIDBase::UNDEFNUM,
53 auto tc = std::make_unique<CaloRec::ToolConstants>();
56 tc->newrep (
name(),
"test.cb1",
"0");
57 tc->newrep (
name(),
"test.ca2",
"[[4, 5], [10, 9], [2.5, 1]]");
62 auto tc = std::make_unique<CaloRec::ToolConstants>();
65 tc->newrep (
name(),
"test.cb1",
"1");
66 tc->newrep (
name(),
"test.ca1",
"[10, 9, 8, 7]");
67 tc->newrep (
name(),
"test.ca2",
"[[14, 15], [1, 19], [12.5, 11]]");
72 auto tc = std::make_unique<CaloRec::ToolConstants>();
75 tc->newrep (
name(),
"test.cb1",
"1");
76 tc->newrep (
name(),
"test.caa",
"[10, 9, 8, 7]");
77 tc->newrep (
name(),
"test.ca2",
"[[14, 15], [1, 19], [12.5, 11]]");
82 auto tc = std::make_unique<CaloRec::ToolConstants>();
90 return StatusCode::SUCCESS;
◆ mergeConstants()
Merge our constants into out
with the proper prefix.
- Parameters
-
[out] | out | Object to receive our constants. |
| ctx | Event context. |
◆ testWriteConstants()
void CaloUtils::ToolWithConstantsTestTool::testWriteConstants |
( |
const EventContext & |
ctx | ) |
const |
◆ toolType()
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() [1/2]
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.
◆ toolVersion() [2/2]
int CaloUtils::ToolWithConstantsTestTool::toolVersion |
( |
| ) |
const |
|
overridevirtual |
◆ writeConstants()
Dump method (for debugging)
- Parameters
-
stream | Ostream to which to write. |
name | Name to go in output |
ctx | Event context. |
◆ m_ca1
◆ m_ca2
◆ m_cb1
Constant<bool> CaloUtils::ToolWithConstantsTestTool::m_cb1 { this, "cb1", "cb1 doc" } |
|
private |
◆ m_cf1
Constant<float> CaloUtils::ToolWithConstantsTestTool::m_cf1 { this, "cf1", 1.5, "cf1 doc" } |
|
private |
◆ m_ci1
Constant<int> CaloUtils::ToolWithConstantsTestTool::m_ci1 { this, "ci1", "ci1 doc" } |
|
private |
◆ m_condKey
StringProperty CaloUtils::ToolWithConstantsTestTool::m_condKey { this, "CondKey", "", "" } |
|
private |
◆ m_DBHandle
◆ m_impl
◆ m_isdummy
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
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
Prefix for finding our constants within the ToolConstants object.
Definition at line 531 of file ToolWithConstants.h.
◆ m_runNumber
IntegerProperty CaloUtils::ToolWithConstantsTestTool::m_runNumber { this, "RunNumber", 284500, "" } |
|
private |
The documentation for this class was generated from the following files: