4 #include <io/EventFile.h>
6 #include <fwk/CentralConfig.h>
7 #include <fwk/RunController.h>
11 #include <det/Detector.h>
13 #include <sevt/SEvent.h>
14 #include <sevt/Header.h>
15 #include <sevt/EventTrigger.h>
17 #include <fevt/FEvent.h>
19 #include <fevt/EyeHeader.h>
21 #include <utl/config.h>
22 #include <utl/ErrorLogger.h>
23 #include <utl/Reader.h>
24 #include <utl/TimeStamp.h>
26 #include <EyeEvent.hh>
28 #include <boost/filesystem/operations.hpp>
29 #include <boost/filesystem/path.hpp>
34 namespace fs = boost::filesystem;
35 using namespace EventFileExporterOG;
49 const string fileType = topBranch.
GetChild(
"OutputFileType").
Get<
string>();
51 if(fileType ==
"Offline")
53 else if(fileType ==
"FDAS")
55 else if(fileType ==
"CDAS")
57 else if(fileType ==
"CORSIKA")
59 else if(fileType ==
"AIRES")
61 else if(fileType ==
"IoAuger")
63 else if(fileType ==
"RadioAERAroot")
67 err <<
"Unknown file type " << fileType <<
" in EventFileExporter::Init()";
74 ERROR(
"Output to strictly input only file types not allowed.");
87 if (sSwitch ==
string(
"off")) {
90 WARNING(
"Streamer switching is currently not supported ");
96 if (sSwitch ==
string(
"off")) {
99 WARNING(
"Streamer switching is currently not supported ");
103 if (sB.
GetChild(
"FDSimTelescope")) {
105 if (sSwitch ==
string(
"off")) {
108 WARNING(
"Streamer switching is currently not supported ");
114 if (sSwitch ==
string(
"off")) {
117 WARNING(
"Streamer switching is currently not supported ");
121 if (sB.
GetChild(
"SDSimPMTBaseHisto")) {
123 if (sSwitch ==
string(
"off")) {
126 WARNING(
"Streamer switching is currently not supported ");
130 if (sB.
GetChild(
"SDSimPMTFilterHisto")) {
132 if (sSwitch ==
string(
"off")) {
135 WARNING(
"Streamer switching is currently not supported ");
139 if (sB.
GetChild(
"SDSimTankParticles")) {
141 if (sSwitch ==
string(
"on")) {
145 WARNING(
"Streamer switching is currently not supported ");
148 if (sB.
GetChild(
"CDSimRPCParticles")) {
150 if (sSwitch ==
string(
"on")) {
154 WARNING(
"Streamer switching is currently not supported ");
165 INFO(
"StreamerSwitch data not found.");
167 #warning INFO: the streamer-switches can also go entirely into the new Branch interface
168 fEventFile =
new EventFile(fEventFilename,
io::eNew, fFileType, 0, fStreamerSwitch);
176 fEventFile->Write(event);
179 ++RunController::GetInstance().GetRunData().GetNamedCounters()[
"EventFileExporter/Events"];
188 std::ostringstream info;
189 info <<
"Wrote " << fEventsWritten <<
" events.";
Branch GetTopBranch() const
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
Open file for write, fail if exists.
#define INFO(message)
Macro for logging informational messages.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
Offline native file format.
Class representing a document branch.
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
ResultFlag
Flag returned by module methods to the RunController.
Interface to file I/O objects.
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
#define ERROR(message)
Macro for logging error messages.