DumpFrames.cxx
Go to the documentation of this file.
2 #include "WireCellUtil/Units.h"
4 
6 
7 using namespace WireCell;
8 
10  : log(Log::logger("glue"))
11 {
12 }
13 
14 
15 Gen::DumpFrames::~DumpFrames()
16 {
17 }
18 
19 
21 {
22  if (!frame) {
23  log->debug("frame sink sees EOS");
24  return true;
25  }
26  auto traces = frame->traces();
27  const int ntraces = traces->size();
28 
29  std::stringstream ss;
30  ss << "sink frame: #" << frame->ident()
31  << " @" << frame->time()/units::ms
32  << " with " << ntraces << " traces";
33  {
34  std::string comma = "";
35  ss << ", frame tags:[";
36  for (auto ftag : frame->frame_tags()) {
37  ss << comma << ftag;
38  comma = ", ";
39  }
40  ss << "]";
41  }
42  {
43  std::string comma = "";
44  ss << ", trace tags:[";
45  for (auto ftag : frame->trace_tags()) {
46  ss << comma << ftag;
47  comma = ", ";
48  }
49  ss << "]";
50  }
51  log->debug(ss.str());
52  return true;
53 }
54 
std::shared_ptr< const IFrame > pointer
Definition: IData.h:19
std::string string
Definition: nybbler.cc:12
static const double ms
Definition: Units.h:104
virtual bool operator()(const IFrame::pointer &frame)
Do something thrilling with a frame.
Definition: DumpFrames.cxx:20
logptr_t logger(std::string name)
Definition: Logging.cxx:71
void log(source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)
Definition: spdlog.h:165
Definition: Main.h:22
#define WIRECELL_FACTORY(NAME, CONCRETE,...)
Definition: NamedFactory.h:332