All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 "WireCellAux/SimpleFrame.h"
#include "WireCellAux/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 66 of file CookedFrameSource.cxx.

67 {
68  // uint
69  const raw::ChannelID_t chid = rw.Channel();
70  const int tbin = 0;
71  const std::vector<float> sig = rw.Signal();
72 
73  const float baseline = 0.0;
74  unsigned int nsamp = sig.size();
75  if (nticks_want > 0) { nsamp = std::min(nsamp, nticks_want); }
76  else {
77  nticks_want = nsamp;
78  }
79 
80  auto strace = new SimpleTrace(chid, tbin, nticks_want);
81  auto& q = strace->charge();
82  for (unsigned int itick = 0; itick < nsamp; ++itick) {
83  q[itick] = sig[itick];
84  }
85  for (unsigned int itick = nsamp; itick < nticks_want; ++itick) {
86  q[itick] = baseline;
87  }
88  return strace;
89 }
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:231
BEGIN_PROLOG baseline
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:47
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 58 of file CookedFrameSource.cxx.

59 {
60  TTimeStamp tts1(ts1.timeHigh(), ts1.timeLow());
61  TTimeStamp tts2(ts2.timeHigh(), ts2.timeLow());
62  return tts2.AsDouble() - tts1.AsDouble();
63 }
WIRECELL_FACTORY ( wclsCookedFrameSource  ,
wcls::CookedFrameSource  ,
wcls::IArtEventVisitor  ,
WireCell::IFrameSource   
)