5 #include <boost/filesystem.hpp>
21 namespace bf =
boost::filesystem;
28 declareProperty(
"EventsPerFile", m_eventsPerFile
30 declareProperty(
"NumericFilename", m_numericFilename =
false );
31 declareProperty(
"NumbersAdded", m_nNumbersAdded = 6 );
68 bf::path dir = outputPath.parent_path();
69 string stem = outputPath.stem().
string();
70 string extension = outputPath.extension().string();
73 if ( !bf::exists( dir ) ) {
75 stream <<
"Directory " << dir <<
" does not exist.";
85 string msg =
"Filename " + filename
86 +
" is not a number, which was needed.";
91 unsigned int length = 0;
98 if ( !dir.empty() ) name << dir <<
"/";
99 for (
unsigned int i = 0;
i < length; ++
i ) {
102 name << iFile << extension;
106 size_t pos = stem.
rfind(
"_" );
107 stem = stem.
substr( 0, pos );
112 unsigned int length = 0;
118 name << dir <<
"/" << stem;
119 for (
unsigned int i = 0;
i < length; ++
i ) {
120 if (
i == 0 ) name <<
"_";
123 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.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
The namespace threadpool contains a thread pool and related utility classes.
StatusCode writeObjects() override
OutputStream override: Select the different objects and write them to file.
std::string m_outputName
Name of the output file.
#define DECLARE_COMPONENT(type)
A small to stream Data I/O.
const std::string & name() const override
The identifying name of the algorithm object.
virtual StatusCode writeObjects()
Select the different objects and write them to file.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode execute() override
This class is used for returning status codes from appropriate routines.
void clearSelection()
Clear list of selected objects.
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Extension of OutputStream to write run records after last event.
unsigned int m_nNumbersAdded
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
unsigned int m_eventsPerFile