Functions
CookedFrameSource.cxx File Reference
#include "CookedFrameSource.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Run.h"
#include "lardataobj/RecoBase/Wire.h"
#include "TTimeStamp.h"
#include "WireCellIface/SimpleFrame.h"
#include "WireCellIface/SimpleTrace.h"
#include "WireCellUtil/NamedFactory.h"

Go to the source code of this file.

Functions

 WIRECELL_FACTORY (wclsCookedFrameSource, wcls::CookedFrameSource, wcls::IArtEventVisitor, WireCell::IFrameSource) using namespace wcls
 
static double tdiff (const art::Timestamp &ts1, const art::Timestamp &ts2)
 
static SimpleTrace * make_trace (const recob::Wire &rw, unsigned int nticks_want)
 

Function Documentation

static SimpleTrace* make_trace ( const recob::Wire rw,
unsigned int  nticks_want 
)
static

Definition at line 64 of file CookedFrameSource.cxx.

65 {
66  // uint
67  const raw::ChannelID_t chid = rw.Channel();
68  const int tbin = 0;
69  const std::vector<float> sig = rw.Signal();
70 
71  const float baseline = 0.0;
72  unsigned int nsamp = sig.size();
73  if (nticks_want > 0) { nsamp = std::min(nsamp, nticks_want); }
74  else {
75  nticks_want = nsamp;
76  }
77 
78  auto strace = new SimpleTrace(chid, tbin, nticks_want);
79  auto& q = strace->charge();
80  for (unsigned int itick = 0; itick < nsamp; ++itick) {
81  q[itick] = sig[itick];
82  }
83  for (unsigned int itick = nsamp; itick < nticks_want; ++itick) {
84  q[itick] = baseline;
85  }
86  return strace;
87 }
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:231
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:47
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
static double tdiff ( const art::Timestamp ts1,
const art::Timestamp ts2 
)
static

Definition at line 56 of file CookedFrameSource.cxx.

57 {
58  TTimeStamp tts1(ts1.timeHigh(), ts1.timeLow());
59  TTimeStamp tts2(ts2.timeHigh(), ts2.timeLow());
60  return tts2.AsDouble() - tts1.AsDouble();
61 }
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
WIRECELL_FACTORY ( wclsCookedFrameSource  ,
wcls::CookedFrameSource  ,
wcls::IArtEventVisitor  ,
WireCell::IFrameSource   
)