ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
D3PDMakerUtils
src
BlockFillerToolImpl.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id$
12
13
14
#include "
D3PDMakerUtils/BlockFillerToolImpl.h
"
15
#include "
AthenaKernel/errorcheck.h
"
16
17
18
namespace
D3PD
{
19
20
27
BlockFillerToolImpl::BlockFillerToolImpl
(
const
std::string&
type
,
28
const
std::string& name,
29
const
IInterface* parent)
30
: base_class (
type
, name, parent),
31
AddVariable
(
m_prefix
,
m_blockName
,
m_suffix
)
32
{
33
declareProperty (
"Prefix"
,
m_prefix
=
""
,
34
"Tuple variable prefix for this block."
);
35
declareProperty (
"Suffix"
,
m_suffix
=
""
,
36
"Tuple variable suffix for this block."
);
37
declareProperty (
"BlockName"
,
m_blockName
= this->name(),
38
"The name of this block."
);
39
}
40
41
52
* and raises an error otherwise.
53
*/
54
StatusCode
55
BlockFillerToolImpl::configureImpl
(
IAddVariable
*
tree
,
56
const
std::type_info& ti,
57
const
std::type_info& fill_ti)
58
{
59
CHECK
(
AddVariable::configureD3PD
(
tree
) );
60
CHECK
(
m_converter
.init (ti, fill_ti) );
61
62
return
StatusCode::SUCCESS;
63
}
64
65
70
* @param tis List of possible input types that we can accept.
71
* @param[out] which Index of the accepted type.
72
*
73
* This is the common implementation for the @c configureD3PD method
74
* of @c IBlockFillerTool.
75
* It checks that the type of the object coming as input
76
* is compatible with what the user code is expecting,
77
* and raises an error otherwise.
78
*
79
* This version allows for one of a set of types to match.
80
* If successful, WHICH is set to the index (0-based) of the matching type.
81
*/
82
StatusCode
83
BlockFillerToolImpl::configureImpl
(
IAddVariable
*
tree
,
84
const
std::type_info& ti,
85
const
std::vector<const std::type_info*>& tis,
86
size_t
& which)
87
{
88
CHECK
(
AddVariable::configureD3PD
(
tree
) );
89
CHECK
(
m_converter
.init (ti, tis, which) );
90
return
StatusCode::SUCCESS;
91
}
92
93
104
StatusCode
105
BlockFillerToolImpl::convert
(
void
const
* & p)
const
106
{
107
p =
m_converter
.convertUntyped (p);
108
if
(!p) {
109
REPORT_MESSAGE
(MSG::ERROR)
110
<<
"Pointer conversion from "
<<
m_converter
.srcName() <<
" to "
111
<<
m_converter
.dstName() <<
"failed."
;
112
return
StatusCode::FAILURE;
113
}
114
return
StatusCode::SUCCESS;
115
}
116
117
118
119
}
// namespace D3PD
BlockFillerToolImpl.h
Non-template parts of BlockFillerTool.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:365
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::AddVariable::configureD3PD
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
Definition
AddVariable.cxx:61
D3PD::AddVariable::AddVariable
AddVariable(const std::string &prefix, const std::string &blockName=s_emptyString)
Constructor.
Definition
AddVariable.cxx:29
D3PD::BlockFillerToolImpl::m_prefix
std::string m_prefix
Property: the variable prefix for this block.
Definition
BlockFillerToolImpl.h:112
D3PD::BlockFillerToolImpl::configureImpl
StatusCode configureImpl(IAddVariable *tree, const std::type_info &ti, const std::type_info &fill_ti)
Configure during initialization: type-check.
Definition
BlockFillerToolImpl.cxx:55
D3PD::BlockFillerToolImpl::m_suffix
std::string m_suffix
Property: the variable prefix for this block.
Definition
BlockFillerToolImpl.h:115
D3PD::BlockFillerToolImpl::m_converter
TypeConverter m_converter
Helper to do type conversions.
Definition
BlockFillerToolImpl.h:121
D3PD::BlockFillerToolImpl::m_blockName
std::string m_blockName
Property: the name of this block.
Definition
BlockFillerToolImpl.h:118
D3PD::BlockFillerToolImpl::convert
StatusCode convert(void const *&p) const
Do type conversion.
Definition
BlockFillerToolImpl.cxx:105
D3PD::BlockFillerToolImpl::BlockFillerToolImpl
BlockFillerToolImpl(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
BlockFillerToolImpl.cxx:27
D3PD::IAddVariable
Common interface for adding a variable to a tuple.
Definition
IAddVariable.h:70
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
type
tree
TChain * tree
Definition
tile_monitor.h:30
Generated on
for ATLAS Offline Software by
1.17.0