17 m_d3pdSvc(
"D3PD::RootReaderD3PDSvc", name ),
24 "The D3PD creation service." );
26 "List of IObjFillerTool instances to run." );
28 "List of IMetadataTool instances to run." );
30 "The name of the tuple. The interpretation of this "
31 "depends on the D3PDSvc." );
34 "Common prefix to the D3PD variable names" );
36 "Name of the C++ classes to be generated" );
39 "Output directory for the generated sources" );
44 CHECK( m_d3pdSvc.retrieve() );
45 CHECK( m_tools.retrieve() );
48 if( ( m_tools.size() != m_prefixes.size() ) ||
49 ( m_tools.size() != m_classnames.size() ) ) {
50 REPORT_MESSAGE( MSG::ERROR ) <<
"The configuration is inconsistent: "
51 << m_tools.size() <<
" tools, "
52 << m_prefixes.size() <<
" prefixes "
53 << m_classnames.size() <<
" classnames";
54 return StatusCode::FAILURE;
58 for(
size_t i = 0; i < m_tools.size(); ++i ) {
61 if( m_classnames[ i ] ==
"" ) {
62 static int counter = 1;
63 std::ostringstream classname;
64 classname <<
"D3PDObject" << counter;
65 m_classnames[ i ] = classname.str();
70 CHECK( m_d3pdSvc->make( m_tuplePath + m_classnames[ i ], d3pd ) );
72 ATH_MSG_DEBUG(
"Creating D3PD object with name: " << m_tuplePath
73 << m_classnames[ i ] );
79 << m_d3pdSvc <<
") did not create a "
80 <<
"D3PD::IReaderD3PD object!";
81 return StatusCode::FAILURE;
86 rd3pd->setPrefix( m_prefixes[ i ] );
89 m_d3pds.push_back( rd3pd );
94 for(
size_t i = 0;
i < m_tools.size(); ++
i ) {
95 if( m_classnames[ i ] ==
"" )
continue;
96 CHECK( m_tools[ i ]->configureD3PD( m_d3pds[ i ] ) );
100 return StatusCode::SUCCESS;
106 for(
size_t i = 0; i <
m_tools.size(); ++i ) {
111 return StatusCode::SUCCESS;
119 for(
size_t i = 0; i <
m_tools.size(); ++i ) {
125 return StatusCode::SUCCESS;
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.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Define an abstract interface for building a D3PD tree.
Common interface for the code generator D3PD classes.
virtual void setIsContainer(bool isContainer)=0
Set the "isCollection" parameter of the object.
virtual StatusCode execute()
Standard Gaudi execute method.
ToolHandleArray< IMetadataTool > m_metadataTools
Property: List of metadata tools to run.
std::vector< IReaderD3PD * > m_d3pds
The created tuples. Note: we don't take ownership.
ServiceHandle< ID3PDSvc > m_d3pdSvc
Property: The D3PD creation service.
std::string m_dir
Directory where the sources should be put.
std::vector< std::string > m_prefixes
Variable name prefixes.
ToolHandleArray< IObjFillerTool > m_tools
Property: List of object filler tools to run.
std::vector< std::string > m_classnames
Reader class names.
std::string m_tuplePath
The D3PD base name.
bool m_booked
Flag that we've called book().
MultiReaderAlg(const std::string &name, ISvcLocator *svcloc)
Standard algorithm constructor.
virtual StatusCode finalize()
Standard Gaudi finalize method.
Block filler tool for noisy FEB information.
StatusCode DummyInitAlg::initialize ATLAS_NOT_THREAD_SAFE()
Standard Gaudi initialize method.