3 #include <boost/filesystem.hpp> 26 if (path[path.length()-1] !=
'/')
30 name <<
Tools::Form(
"%04d/%02d/%02d/", night/10000, (night/100)%100, night%100);
34 boost::filesystem::create_directories(name.str());
36 catch (
const runtime_error &)
42 name << night <<
'_' << setfill(
'0') << setw(3) << runid <<
'.' << extension;
50 fFileName =
"/dev/null";
54 <<
"OPEN_FILE #" << GetRunId() <<
":" 72 if (now-fTime<boost::posix_time::seconds(5))
78 str <<
this <<
" - EVENT #" << e.
evNum <<
" / " << e.
trgNum;
87 str <<
this <<
" - CLOSE FILE #" << GetRunId();
98 cout <<
"WRITE_EVENT #" << GetRunId() <<
" (" << e.
evNum <<
")" << endl;
99 cout <<
" Typ=" << e.
trgTyp << endl;
100 cout <<
" roi=" << e.
nRoi << endl;
101 cout <<
" tim=" << e.
time.tv_sec << endl;
Adds some functionality to boost::posix_time::ptime for our needs.
bool Open(const RUN_HEAD &h, const FAD::RunDescription &d)
bool WriteEvt(const EVT_CTRL2 &)
bool Close(const EVT_CTRL2 &)
bool WriteEvt(const EVT_CTRL2 &)
static std::string FormFileName(const std::string &path, uint64_t night, uint32_t runid, const std::string &extension)