5 #include <boost/filesystem.hpp>
8 #include "GaudiKernel/IRegistry.h"
9 #include "GaudiKernel/IDataManagerSvc.h"
10 #include "GaudiKernel/IDataProviderSvc.h"
11 #include "GaudiKernel/IOpaqueAddress.h"
12 #include "GaudiKernel/DataStoreItem.h"
13 #include "GaudiKernel/DataObject.h"
14 #include "GaudiKernel/MsgStream.h"
21 namespace bf =
boost::filesystem;
28 declareProperty(
"EventsPerFile", m_eventsPerFile
29 = std::numeric_limits< unsigned int>::max() );
30 declareProperty(
"NumericFilename", m_numericFilename =
false );
31 declareProperty(
"NumbersAdded", m_nNumbersAdded = 6 );
68 string filename = outputPath.filename().string();
69 bf::path dir = outputPath.parent_path();
70 string stem = outputPath.stem().string();
71 string extension = outputPath.extension().string();
74 if ( !bf::exists( dir ) ) {
76 stream <<
"Directory " << dir <<
" does not exist.";
85 }
catch(
const std::invalid_argument& ) {
86 string msg =
"Filename " + filename
87 +
" is not a number, which was needed.";
92 unsigned int length = 0;
94 if ( stem.length() > iFile.length() ) {
95 length = stem.length() - iFile.length();
99 if ( !dir.empty() ) name << dir <<
"/";
100 for (
unsigned int i = 0;
i < length; ++
i ) {
103 name << iFile << extension;
107 size_t pos = stem.rfind(
"_" );
108 stem = stem.substr( 0, pos );
113 unsigned int length = 0;
119 name << dir <<
"/" << stem;
120 for (
unsigned int i = 0;
i < length; ++
i ) {
121 if (
i == 0 ) name <<
"_";
124 name << iFile << extension;
bool isEventAccepted() const
Test whether this event should be output.
virtual const std::string & message() const
error message to be printed
Definition of the MsgStream class used to transmit messages.
string to_string(const T &value)
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
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.
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.
StatusCode execute() override
This class is used for returning status codes from appropriate routines.
#define DECLARE_COMPONENT(type)
void clearSelection()
Clear list of selected objects.
Extension of OutputStream to write run records after last event.
unsigned int m_nNumbersAdded
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
unsigned int m_eventsPerFile