LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
lcvn::WireHelper Class Reference

#include "PixelMapProducer.h"

Public Member Functions

 WireHelper (recob::Wire wire, double thresh=0.)
 
virtual Waveform GetWaveform ()
 
virtual geo::WireID GetID ()
 

Protected Attributes

recob::Wire fWire
 
double fThreshold
 
geo::WireReadoutGeom const * fWireReadoutGeom
 

Detailed Description

Definition at line 49 of file PixelMapProducer.h.

Constructor & Destructor Documentation

lcvn::WireHelper::WireHelper ( recob::Wire  wire,
double  thresh = 0. 
)
inline

Definition at line 51 of file PixelMapProducer.h.

References lcvn::HitHelper::GetID(), and lcvn::HitHelper::GetWaveform().

51 : fWire(wire), fThreshold(thresh) {}

Member Function Documentation

geo::WireID lcvn::WireHelper::GetID ( )
virtual

Definition at line 63 of file PixelMapProducer.cxx.

64  {
65  geo::WireID ret;
66  std::vector<geo::WireID> wireids = fWireReadoutGeom->ChannelToWire(fWire.Channel());
67  if (!wireids.size()) return ret;
68  ret = wireids[0];
69 
70  if (wireids.size() > 1) {
71  for (auto iwire : wireids)
72  if (iwire.Plane == fWire.View()) ret = iwire;
73  }
74  return ret;
75  }
geo::WireReadoutGeom const * fWireReadoutGeom
geo::View_t View() const
Returns the view the channel belongs to.
Definition: Wire.h:219
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
Waveform lcvn::WireHelper::GetWaveform ( )
virtual

Definition at line 45 of file PixelMapProducer.cxx.

References lcvn::HitHelper::fThreshold.

46  {
47  Waveform ret;
48  auto ROIs = fWire.SignalROI();
49  if (!(ROIs.get_ranges().size())) return ret;
50 
51  for (auto iROI = ROIs.begin_range(); iROI != ROIs.end_range(); ++iROI) {
52  auto& ROI = *iROI;
53  std::map<double, double> pulse;
54  for (int tick = ROI.begin_index(); tick < (int)ROI.end_index(); tick++) {
55  if (!(ROI[tick] > fThreshold)) continue;
56  pulse.insert(std::pair<double, double>((double)tick, (double)ROI[tick]));
57  }
58  ret.push_back(pulse);
59  }
60  return ret;
61  }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:73
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
Definition: Wire.h:211
std::vector< std::map< double, double > > Waveform

Member Data Documentation

double lcvn::WireHelper::fThreshold
protected

Definition at line 58 of file PixelMapProducer.h.

recob::Wire lcvn::WireHelper::fWire
protected

Definition at line 57 of file PixelMapProducer.h.

geo::WireReadoutGeom const* lcvn::WireHelper::fWireReadoutGeom
protected
Initial value:

Definition at line 59 of file PixelMapProducer.h.


The documentation for this class was generated from the following files: