10 #include "TTimeStamp.h" 13 #include "WireCellIface/IFrame.h" 22 mutable WireCell::ITrace::ChargeSequence
m_charge;
27 : m_rdvh(rdvh), m_index(index), m_channel(rdvh->at(index).Channel()) {}
31 virtual int tbin()
const {
return 0; }
33 virtual const ChargeSequence&
charge()
const {
34 if (m_charge.empty()) {
35 auto const& rd = m_rdvh->at(m_index);
38 m_charge.insert(m_charge.end(), adcv.begin(), adcv.end());
53 int ident,
double time,
double tick,
const tag_list_t& tags)
54 : m_ident(ident), m_time(time), m_tick(tick), m_tags(tags.
begin(), tags.
end()) {
55 const size_t nrds = rdvh->size();
56 auto* traces =
new std::vector<LazyTrace::pointer>(nrds);
57 for (
size_t ind = 0; ind < nrds; ++ind) {
58 traces->at(ind) = std::make_shared<LazyTrace>(rdvh, ind);
60 m_traces = WireCell::ITrace::shared_vector(traces);
70 static tag_list_t
dummy;
75 static trace_list_t
dummy;
80 static trace_summary_t
dummy;
85 virtual WireCell::ITrace::shared_vector
traces()
const {
93 virtual double time()
const {
97 virtual double tick()
const {
108 #include "WireCellUtil/NamedFactory.h" 114 using namespace wcls;
132 cfg[
"frame_tags"][0] =
"orig";
139 const std::string art_tag = cfg[
"art_tag"].asString();
140 if (art_tag.empty()) {
141 THROW(ValueError() << errmsg{
"LazyFrameSource requires a source_label"});
145 m_tick = cfg[
"tick"].asDouble();
146 for (
auto jtag : cfg[
"frame_tags"]) {
160 return tts2.AsDouble() - tts1.AsDouble();
169 bool okay =
event.getByLabel(
m_inputTag, rdvh);
173 THROW(RuntimeError() << errmsg{msg});
175 else if (rdvh->size() == 0)
return;
178 std::cerr <<
"LazyFrameSource: got " << rdvh->size() <<
" raw::RawDigit objects\n";
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
WireCell::ITrace::ChargeSequence m_charge
constexpr std::uint32_t timeLow() const
EventNumber_t event() const
virtual double tick() const
virtual void configure(const WireCell::Configuration &config)
static constexpr double us
void msg(const char *fmt,...)
virtual bool operator()(WireCell::IFrame::pointer &frame)
IFrameSource.
virtual int channel() const
virtual WireCell::Configuration default_configuration() const
IConfigurable.
virtual void visit(art::Event &event)
IArtEventVisitor.
constexpr std::uint32_t timeHigh() const
virtual ~LazyFrameSource()
std::deque< WireCell::IFrame::pointer > m_frames
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
static double tdiff(const art::Timestamp &ts1, const art::Timestamp &ts2)
virtual const trace_list_t & tagged_traces(const tag_t &tag) const
virtual const tag_list_t & frame_tags() const
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
virtual double time() const
Run const & getRun() const
virtual WireCell::ITrace::shared_vector traces() const
WireCell::ITrace::shared_vector m_traces
art::Handle< std::vector< raw::RawDigit > > m_rdvh
cet::LibraryManager dummy("noplugin")
virtual const trace_summary_t & trace_summary(const tag_t &tag) const
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
LazyFrame(art::Handle< std::vector< raw::RawDigit > > rdvh, int ident, double time, double tick, const tag_list_t &tags)
virtual int ident() const
virtual const ChargeSequence & charge() const
WIRECELL_FACTORY(wclsLazyFrameSource, wcls::LazyFrameSource, wcls::IArtEventVisitor, WireCell::IFrameSource) using namespace wcls
std::vector< std::string > m_frame_tags
virtual const tag_list_t & trace_tags() const
Timestamp const & beginTime() const
QTextStream & endl(QTextStream &s)
Event finding and building.
LazyTrace(art::Handle< std::vector< raw::RawDigit > > rdvh, size_t index)