LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evdb_tool::DrawWireData Class Reference
Inheritance diagram for evdb_tool::DrawWireData:
evdb_tool::IWaveformDrawer

Public Member Functions

 DrawWireData (const fhicl::ParameterSet &pset)
 
 ~DrawWireData ()
 
void configure (const fhicl::ParameterSet &pset) override
 
void Fill (evdb::View2D &, raw::ChannelID_t &, float, float) override
 
void Draw (const std::string &, float, float) override
 
float getMaximum () const override
 
float getMinimum () const override
 

Private Attributes

float fMaximum
 
float fMinimum
 
std::vector< int > fColorMap
 

Detailed Description

Definition at line 22 of file DrawWireData_tool.cc.

Constructor & Destructor Documentation

evdb_tool::DrawWireData::DrawWireData ( const fhicl::ParameterSet pset)
explicit

Definition at line 44 of file DrawWireData_tool.cc.

References configure().

45  {
46  configure(pset);
47  }
void configure(const fhicl::ParameterSet &pset) override
evdb_tool::DrawWireData::~DrawWireData ( )

Definition at line 49 of file DrawWireData_tool.cc.

49 {}

Member Function Documentation

void evdb_tool::DrawWireData::configure ( const fhicl::ParameterSet pset)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 51 of file DrawWireData_tool.cc.

References fColorMap.

Referenced by DrawWireData().

52  {
53  fColorMap.push_back(kBlue);
54  fColorMap.push_back(kMagenta);
55  fColorMap.push_back(kBlack);
56  fColorMap.push_back(kRed);
57 
58  return;
59  }
std::vector< int > fColorMap
void evdb_tool::DrawWireData::Draw ( const std::string &  ,
float  ,
float   
)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 104 of file DrawWireData_tool.cc.

References DEFINE_ART_CLASS_TOOL.

105  {
106  return;
107  }
void evdb_tool::DrawWireData::Fill ( evdb::View2D view2D,
raw::ChannelID_t channel,
float  lowBin,
float  hiBin 
)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 61 of file DrawWireData_tool.cc.

References evdb::View2D::AddPolyLine(), bin, recob::Wire::Channel(), fColorMap, evd::RecoDrawingOptions::fWireLabels, evdb::EventHolder::GetEvent(), evdb::EventHolder::Instance(), and recob::Wire::Signal().

65  {
67 
68  //grab the singleton with the event
70  if (!event) return;
71 
72  for (size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod) {
73  // Step one is to recover the hits for this label that match the input channel
74  art::InputTag const which = recoOpt->fWireLabels[imod];
75 
77  event->getByLabel(which, wireVecHandle);
78 
79  for (size_t wireIdx = 0; wireIdx < wireVecHandle->size(); wireIdx++) {
80  art::Ptr<recob::Wire> wire(wireVecHandle, wireIdx);
81 
82  if (wire->Channel() != channel) continue;
83 
84  // Recover a full wire version of the deconvolved wire data
85  // (the ROIs don't tend to display well)
86  std::vector<float> signal = wire->Signal();
87 
88  TPolyLine& wireWaveform =
89  view2D.AddPolyLine(signal.size(), fColorMap[imod % fColorMap.size()], 2, 1);
90 
91  for (size_t idx = 0; idx < signal.size(); idx++) {
92  float bin = float(idx) + 0.5;
93 
94  if (bin >= lowBin && bin <= hiBin) wireWaveform.SetPoint(idx, bin, signal[idx]);
95  }
96 
97  wireWaveform.Draw("same");
98  }
99  } //end loop over HitFinding modules
100 
101  return;
102  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
TPolyLine & AddPolyLine(int n, int c, int w, int s)
Definition: View2D.cxx:210
std::vector< art::InputTag > fWireLabels
module labels that produced wires
static EventHolder * Instance()
Definition: EventHolder.cxx:15
float bin[41]
Definition: plottest35.C:14
std::vector< int > fColorMap
Definition: fwd.h:26
Event finding and building.
float evdb_tool::DrawWireData::getMaximum ( ) const
inlineoverridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 32 of file DrawWireData_tool.cc.

References fMaximum.

32 { return fMaximum; };
float evdb_tool::DrawWireData::getMinimum ( ) const
inlineoverridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 33 of file DrawWireData_tool.cc.

References fMaximum, and fMinimum.

33 { return fMinimum; };

Member Data Documentation

std::vector<int> evdb_tool::DrawWireData::fColorMap
private

Definition at line 39 of file DrawWireData_tool.cc.

Referenced by configure(), and Fill().

float evdb_tool::DrawWireData::fMaximum
private

Definition at line 33 of file DrawWireData_tool.cc.

Referenced by getMaximum(), and getMinimum().

float evdb_tool::DrawWireData::fMinimum
private

Definition at line 37 of file DrawWireData_tool.cc.

Referenced by getMinimum().


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