11#include "GaudiKernel/TypeNameString.h"
23 ISvcLocator* pSvcLocator)
46 Gaudi::Utils::TypeNameString writerAlgoTool(toolName);
49 StatusCode checkOut = toolSvc()->retrieveTool(writerAlgoTool.type(),
50 writerAlgoTool.name(),
54 if ( checkOut.isFailure() )
57 (
"failed to pick up tool of type \042"
58 << writerAlgoTool.type()
60 << writerAlgoTool.name()
63 return StatusCode::FAILURE;
80 return StatusCode::FAILURE;
91 return StatusCode::SUCCESS;
100 const EventContext& ctx = Gaudi::Hive::currentContext();
113 return StatusCode::SUCCESS;
128 std::ostringstream thisFileName;
130 << std::setw(6) << std::setfill(
'0')
131 << ctx.eventID().run_number() <<
"." << std::setfill(
'0')
133 << ctx.eventID().event_number() <<
".xml" << std::ends;
135 std::ofstream thisFileStream((thisFileName.str()).c_str());
143 StatusCode checkOut = tool->writeOut(thisFileStream);
145 if ( checkOut.isFailure() )
157 thisFileStream.close();
159 return StatusCode::SUCCESS;
165 return StatusCode::SUCCESS;
#define ATH_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)
std::map< std::string, unsigned int > m_toolReject
std::map< std::string, unsigned int > m_toolInvoke
std::vector< TBXMLWriterToolBase * > m_writerTools
TBXMLWriter(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor.
virtual StatusCode finalize() override
std::map< std::string, unsigned int > m_toolAccept
std::vector< std::string > m_writerToolNames
virtual StatusCode execute() override
std::string m_topDirectory
virtual StatusCode initialize() override
unsigned int m_outputFrequency
unsigned int m_eventCounter