Public Member Functions | Private Attributes | List of all members
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
 
- Public Member Functions inherited from evdb_tool::IWaveformDrawer
virtual ~IWaveformDrawer () noexcept=default
 

Private Attributes

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

Detailed Description

Definition at line 18 of file DrawWireData_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 42 of file DrawWireData_tool.cc.

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

Definition at line 47 of file DrawWireData_tool.cc.

48 {
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.

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 107 of file DrawWireData_tool.cc.

108 {
109  return;
110 }
void evdb_tool::DrawWireData::Fill ( evdb::View2D &  view2D,
raw::ChannelID_t channel,
float  lowBin,
float  hiBin 
)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 62 of file DrawWireData_tool.cc.

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

Implements evdb_tool::IWaveformDrawer.

Definition at line 29 of file DrawWireData_tool.cc.

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

Implements evdb_tool::IWaveformDrawer.

Definition at line 30 of file DrawWireData_tool.cc.

30 {return fMinimum;};

Member Data Documentation

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

Definition at line 37 of file DrawWireData_tool.cc.

float evdb_tool::DrawWireData::fMaximum
private

Definition at line 30 of file DrawWireData_tool.cc.

float evdb_tool::DrawWireData::fMinimum
private

Definition at line 35 of file DrawWireData_tool.cc.


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