#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 43 of file CookedFrameSink.cxx.
45 const std::string anode_tn = cfg[
"anode"].asString();
46 if (anode_tn.empty()) {
47 THROW(ValueError() << errmsg{
"CookedFrameSink requires an anode plane"});
51 m_anode = Factory::find_tn<IAnodePlane>(anode_tn);
53 auto jtags = cfg[
"frame_tags"];
54 std::cerr <<
"CookedFrameSink: saving " << jtags.size() <<
" tags\n";
55 for (
auto jtag : jtags) {
56 std::string tag = jtag.asString();
std::vector< std::string > m_frame_tags
BEGIN_PROLOG could also be cerr
WireCell::IAnodePlane::pointer m_anode
WireCell::Configuration CookedFrameSink::default_configuration |
( |
| ) |
const |
|
virtual |
IConfigurable.
Definition at line 32 of file CookedFrameSink.cxx.
35 cfg[
"anode"] =
"AnodePlane";
37 cfg[
"frame_tags"][0] =
"gauss";
38 cfg[
"frame_tags"][1] =
"wiener";
bool CookedFrameSink::operator() |
( |
const WireCell::IFrame::pointer & |
frame | ) |
|
|
virtual |
void CookedFrameSink::produces |
( |
art::ProducesCollector & |
collector | ) |
|
|
virtual |
void CookedFrameSink::visit |
( |
art::Event & |
event | ) |
|
|
virtual |
Implement to visit an Art event.
Implements wcls::IArtEventVisitor.
Definition at line 91 of file CookedFrameSink.cxx.
94 std::cerr <<
"CookedFrameSink: I have no frame to save to art::Event\n";
98 std::cerr <<
"CookedFrameSink: got " <<
m_frame->traces()->size() <<
" total traces\n";
103 if (traces.empty()) {
104 std::cerr <<
"CookedFrameSink: no traces for tag \"" << tag <<
"\"\n";
109 std::unique_ptr<std::vector<recob::Wire> > outwires(
new std::vector<recob::Wire>);
113 for (
const auto&
trace : traces) {
115 const int tbin =
trace->tbin();
116 const int chid =
trace->channel();
117 const auto& charge =
trace->charge();
122 size_t ncharge = charge.size();
123 int nticks = tbin + ncharge;
131 roi.add_range(tbin, charge.begin(), charge.begin() + ncharge);
137 auto const& gc = *lar::providerFrom<geo::Geometry>();
138 auto view = gc.View(chid);
143 outwires->emplace_back(
recob::Wire(roi, chid, view));
145 std::cerr <<
"CookedFrameSink saving " << outwires->size() <<
" recob::Wires named \""<<tag<<
"\"\n";
146 event.put(std::move(outwires), tag);
std::vector< std::string > m_frame_tags
BEGIN_PROLOG could also be cerr
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 |
std::vector<std::string> wcls::CookedFrameSink::m_frame_tags |
|
private |
int wcls::CookedFrameSink::m_nticks |
|
private |
The documentation for this class was generated from the following files: