ATLAS Offline Software
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$
16 
17 
18 namespace D3PD {
19 
20 
28  (const std::string& type,
29  const std::string& name,
30  const IInterface* parent)
31  : base_class (type, name, parent),
32  AddVariable (m_prefix, m_blockName)
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 
52  const std::type_info& ti)
53 {
56  return StatusCode::SUCCESS;
57 }
58 
59 
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 
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
D3PD::SingleAssociationToolImpl::m_inputConverter
TypeConverter m_inputConverter
Helper to convert source object pointers.
Definition: SingleAssociationToolImpl.h:124
D3PD::IAddVariable
Common interface for adding a variable to a tuple.
Definition: IAddVariable.h:70
D3PD::SingleAssociationToolImpl::m_prefix
std::string m_prefix
Parameter: source object prefix.
Definition: SingleAssociationToolImpl.h:118
D3PD::AddVariable
Common implementation of IAddVariable.
Definition: AddVariable.h:38
D3PD::SingleAssociationToolImpl::m_blockName
std::string m_blockName
Property: the name of this block.
Definition: SingleAssociationToolImpl.h:121
D3PD::TypeConverter::dstName
std::string dstName() const
Return the name of the destination type, or an empty string.
Definition: TypeConverter.cxx:151
D3PD::AddVariable::configureD3PD
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
Definition: AddVariable.cxx:61
D3PD::SingleAssociationToolImpl::SingleAssociationToolImpl
SingleAssociationToolImpl(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: SingleAssociationToolImpl.cxx:28
tree
TChain * tree
Definition: tile_monitor.h:30
D3PD::SingleAssociationToolImpl::configureD3PD
virtual StatusCode configureD3PD(D3PD::IAddVariable *tree, const std::type_info &ti)
Configure during initialization: type-check.
Definition: SingleAssociationToolImpl.cxx:51
D3PD::TypeConverter::init
StatusCode init(const std::type_info &src_ti, const std::type_info &dst_ti)
Initialize the converter.
Definition: TypeConverter.cxx:51
D3PD::TypeConverter::srcName
std::string srcName() const
Return the name of the source type, or an empty string.
Definition: TypeConverter.cxx:141
D3PD::TypeConverter::convertUntyped
const void * convertUntyped(const void *p) const
Convert pointer.
Definition: TypeConverter.cxx:116
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
D3PD::SingleAssociationToolImpl::doConversion
const void * doConversion(const void *p)
Helper to convert pointers to source objects.
Definition: SingleAssociationToolImpl.cxx:103
D3PD::SingleAssociationToolImpl::fromTypeinfo
virtual const std::type_info & fromTypeinfo() const =0
Return the std::type_info for the source of the association.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::SingleAssociationToolImpl::book
virtual StatusCode book()
Create any needed tuple variables.
Definition: SingleAssociationToolImpl.cxx:92
SingleAssociationToolImpl.h
Non-template parts of SingleAssociationTool.
D3PD::SingleAssociationToolImpl::configureMulti
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.
Definition: SingleAssociationToolImpl.cxx:74