5 #include <boost/filesystem.hpp> 21 namespace bf =
boost::filesystem;
54 bf::path dir = outputPath.parent_path();
55 string stem = outputPath.stem().string();
56 string extension = outputPath.extension().string();
59 if ( !bf::exists( dir ) ) {
61 stream <<
"Directory " << dir <<
" does not exist.";
71 string msg =
"Filename " + filename +
" is not a number, which was needed.";
76 unsigned int length = 0;
81 if ( !dir.empty() ) name << dir <<
"/";
82 for (
unsigned int i = 0; i < length; ++i ) { name <<
"0"; }
83 name << iFile << extension;
87 size_t pos = stem.
rfind(
"_" );
88 stem = stem.
substr( 0, pos );
93 unsigned int length = 0;
97 name << dir <<
"/" << stem;
98 for (
unsigned int i = 0; i < length; ++i ) {
99 if ( i == 0 ) name <<
"_";
102 name << iFile << extension;
bool isEventAccepted() const
Test whether this event should be output.
virtual const std::string & message() const
error message to be printed
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Define general base for Gaudi exception.
StatusCode writeObjects() override
OutputStream override: Select the different objects and write them to file.
const std::string & name() const override
The identifying name of the algorithm object.
Gaudi::Property< std::string > m_outputName
constexpr static const auto SUCCESS
Gaudi::Property< bool > m_numericFilename
#define DECLARE_COMPONENT(type)
virtual StatusCode writeObjects()
Select the different objects and write them to file.
StatusCode execute() override
Working entry point.
This class is used for returning status codes from appropriate routines.
void clearSelection()
Clear list of selected objects.
Gaudi::Property< unsigned int > m_eventsPerFile
constexpr static const auto FAILURE
Extension of OutputStream to write run records after last event.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Gaudi::Property< unsigned int > m_nNumbersAdded