ATLAS Offline Software
Loading...
Searching...
No Matches
SingleAssociationToolImpl.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
16
17
18namespace D3PD {
19
20
28 (const std::string& type,
29 const std::string& name,
30 const IInterface* parent)
31 : base_class (type, name, parent),
33{
34 declareProperty ("Prefix", m_prefix = "",
35 "Tuple variable prefix for this block.");
36 declareProperty ("BlockName", m_blockName = this->name(),
37 "The name of this block.");
38}
39
40
50StatusCode
52 const std::type_info& ti)
53{
55 CHECK( m_inputConverter.init (ti, fromTypeinfo()) );
56 return StatusCode::SUCCESS;
57}
58
59
69 * @c configureMulti should check that the type of the object coming as input
70 * (to @c getUntyped)
71 * is compatible with what it expects, and raise an error otherwise.
72 */
73StatusCode
75 const std::type_info& ti,
76 const std::vector<const std::type_info*>& tis,
77 size_t& which)
78{
80 CHECK( m_inputConverter.init (ti, tis, which) );
81 return StatusCode::SUCCESS;
82}
83
84
91StatusCode
93{
94 return StatusCode::SUCCESS;
95}
96
97
104{
105 if (!p) return 0;
106 const void* pp = m_inputConverter.convertUntyped (p);
107 if (!pp) {
108 REPORT_MESSAGE (MSG::WARNING)
109 << "Pointer conversion from " << m_inputConverter.srcName() << " to "
110 << m_inputConverter.dstName() << " failed.";
111 return 0;
112 }
113 return pp;
114}
115
116
117} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
Non-template parts of SingleAssociationTool.
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
AddVariable(const std::string &prefix, const std::string &blockName=s_emptyString)
Constructor.
Common interface for adding a variable to a tuple.
virtual const std::type_info & fromTypeinfo() const =0
Return the std::type_info for the source of the association.
StatusCode configureMulti(D3PD::IAddVariable *tree, const std::type_info &ti, const std::vector< const std::type_info * > &tis, size_t &which)
Configure during initialization: type-check.
std::string m_blockName
Property: the name of this block.
std::string m_prefix
Parameter: source object prefix.
SingleAssociationToolImpl(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
TypeConverter m_inputConverter
Helper to convert source object pointers.
const void * doConversion(const void *p)
Helper to convert pointers to source objects.
virtual StatusCode configureD3PD(D3PD::IAddVariable *tree, const std::type_info &ti)
Configure during initialization: type-check.
virtual StatusCode book()
Create any needed tuple variables.
Block filler tool for noisy FEB information.
TChain * tree