#include <CookedFrameSink.h>
Definition at line 20 of file CookedFrameSink.h.
CookedFrameSink::CookedFrameSink |
( |
| ) |
|
CookedFrameSink::~CookedFrameSink |
( |
| ) |
|
|
virtual |
void CookedFrameSink::configure |
( |
const WireCell::Configuration & |
config | ) |
|
|
virtual |
Definition at line 42 of file CookedFrameSink.cxx.
44 const std::string anode_tn = cfg[
"anode"].asString();
45 if (anode_tn.empty()) {
46 THROW(ValueError() << errmsg{
"CookedFrameSink requires an anode plane"});
50 m_anode = Factory::find_tn<IAnodePlane>(anode_tn);
52 auto jtags = cfg[
"frame_tags"];
53 std::cerr <<
"CookedFrameSink: saving " << jtags.size() <<
" tags\n";
54 for (
auto jtag : jtags) {
56 std::cerr <<
"\t" << tag <<
"\n";
std::vector< std::string > m_frame_tags
WireCell::IAnodePlane::pointer m_anode
WireCell::Configuration CookedFrameSink::default_configuration |
( |
| ) |
const |
|
virtual |
IConfigurable.
Definition at line 31 of file CookedFrameSink.cxx.
34 cfg[
"anode"] =
"AnodePlane";
36 cfg[
"frame_tags"][0] =
"gauss";
37 cfg[
"frame_tags"][1] =
"wiener";
bool CookedFrameSink::operator() |
( |
const WireCell::IFrame::pointer & |
frame | ) |
|
|
virtual |
IArtEventVisitor.
Reimplemented from wcls::IArtEventVisitor.
Definition at line 62 of file CookedFrameSink.cxx.
65 std::cerr <<
"CookedFrameSink: promising to produce recob::Wires named \"" <<
tag <<
"\"\n";
66 collector.
produces< std::vector<recob::Wire> >(tag);
std::vector< std::string > m_frame_tags
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
Implement to visit an Art event.
Implements wcls::IArtEventVisitor.
Definition at line 90 of file CookedFrameSink.cxx.
93 std::cerr <<
"CookedFrameSink: I have no frame to save to art::Event\n";
97 std::cerr <<
"CookedFrameSink: got " <<
m_frame->traces()->size() <<
" total traces\n";
102 if (traces.empty()) {
103 std::cerr <<
"CookedFrameSink: no traces for tag \"" <<
tag <<
"\"\n";
108 std::unique_ptr<std::vector<recob::Wire> > outwires(
new std::vector<recob::Wire>);
112 for (
const auto&
trace : traces) {
114 const int tbin =
trace->tbin();
115 const int chid =
trace->channel();
116 const auto& charge =
trace->charge();
121 size_t ncharge = charge.size();
122 int nticks = tbin + ncharge;
130 roi.add_range(tbin, charge.begin(), charge.begin() + ncharge);
136 auto const& gc = *lar::providerFrom<geo::Geometry>();
137 auto view = gc.View(chid);
142 outwires->emplace_back(
recob::Wire(roi, chid, view));
144 std::cerr <<
"CookedFrameSink saving " << outwires->size() <<
" recob::Wires named \""<<
tag<<
"\"\n";
std::vector< std::string > m_frame_tags
M::value_type trace(const M &m)
static ITrace::vector tagged_traces(IFrame::pointer frame, IFrame::tag_t tag)
WireCell::IFrame::pointer m_frame
Class holding the regions of interest of signal from a channel.
WireCell::IAnodePlane::pointer wcls::CookedFrameSink::m_anode |
|
private |
WireCell::IFrame::pointer wcls::CookedFrameSink::m_frame |
|
private |
int wcls::CookedFrameSink::m_nticks |
|
private |
The documentation for this class was generated from the following files: