21 SigProc::Omnibus::~Omnibus()
30 cfg[
"filters"] = Json::arrayValue;
37 m_input_tn = cfg[
"source"].asString();
38 m_input = Factory::find_tn<IFrameSource>(m_input_tn);
40 m_output_tn = cfg[
"sink"].asString();
41 if (m_output_tn.empty()) {
42 std::cerr <<
"Omnibus has no final frame sink component.\n";
46 m_output = Factory::find_tn<IFrameSink>(m_output_tn);
50 auto jffl = cfg[
"filters"];
51 for (
auto jff : jffl) {
53 std::cerr <<
"Omnibus adding frame filter: \"" << fftn <<
"\"\n";
54 auto ff = Factory::find_tn<IFrameFilter>(fftn);
55 m_filters.push_back(ff);
56 m_filters_tn.push_back(fftn);
61 void SigProc::Omnibus::execute()
66 if (!(*m_input)(frame)) {
67 std::cerr <<
"Omnibus: failed to get input frame from " << m_input_tn <<
"\n";
71 std::cerr <<
"Omnibus: got null frame, forwarding, assuming we have reached EOS\n";
74 if (!frame->traces()->size()) {
75 std::cerr <<
"Omnibus: got empty input frame, something is busted\n";
79 std::cerr <<
"Omnibus: got input frame from "<<m_input_tn<<
" with " << frame->traces()->size() <<
" traces\n";
87 for (
auto ff : m_filters) {
90 if (!(*ff)(frame, nextframe)) {
91 std::cerr <<
"Failed to filter frame from "<<tn<<
"\n";
94 if (!nextframe && !frame) {
98 std::cerr <<
"Omnibus: filter "<<tn<<
" returned a null frame\n";
108 std::cerr <<
"Omnibus: got frame from "<<tn<<
" with " << frame->traces()->size() <<
" traces\n";
114 if (!(*m_output)(frame)) {
115 std::cerr <<
"Omnibus: failed to send output frame to "<<m_output_tn<<
"\n";
std::shared_ptr< const IFrame > pointer
boost::error_info< struct tag_errmsg, std::string > errmsg
void dump_frame(WireCell::IFrame::pointer frame)
WIRECELL_FACTORY(Omnibus, WireCell::SigProc::Omnibus, WireCell::IApplication, WireCell::IConfigurable) using namespace WireCell
Json::Value Configuration
Thrown when an error occurs during the data processing.