All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 23 of file DrawWireData_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 47 of file DrawWireData_tool.cc.

48 {
49  configure(pset);
50 }
void configure(const fhicl::ParameterSet &pset) override
evdb_tool::DrawWireData::~DrawWireData ( )

Definition at line 52 of file DrawWireData_tool.cc.

53 {
54 }

Member Function Documentation

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

Implements evdb_tool::IWaveformDrawer.

Definition at line 56 of file DrawWireData_tool.cc.

57 {
58  fColorMap.push_back(kBlue);
59  fColorMap.push_back(kMagenta);
60  fColorMap.push_back(kBlack);
61  fColorMap.push_back(kRed);
62 
63  return;
64 }
std::vector< int > fColorMap
void evdb_tool::DrawWireData::Draw ( const std::string &  ,
float  ,
float   
)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 112 of file DrawWireData_tool.cc.

113 {
114  return;
115 }
void evdb_tool::DrawWireData::Fill ( evdb::View2D &  view2D,
raw::ChannelID_t channel,
float  lowBin,
float  hiBin 
)
overridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 67 of file DrawWireData_tool.cc.

71 {
72  art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
73 
74  //grab the singleton with the event
75  const art::Event* event = evdb::EventHolder::Instance()->GetEvent();
76  if(!event) return;
77 
78  for (size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod)
79  {
80  // Step one is to recover the hits for this label that match the input channel
81  art::InputTag const which = recoOpt->fWireLabels[imod];
82 
83  art::Handle< std::vector<recob::Wire> > wireVecHandle;
84  event->getByLabel(which, wireVecHandle);
85 
86  for(size_t wireIdx = 0; wireIdx < wireVecHandle->size(); wireIdx++)
87  {
88  art::Ptr<recob::Wire> wire(wireVecHandle, wireIdx);
89 
90  if (wire->Channel() != channel) continue;
91 
92  // Recover a full wire version of the deconvolved wire data
93  // (the ROIs don't tend to display well)
94  std::vector<float> signal = wire->Signal();
95 
96  TPolyLine& wireWaveform = view2D.AddPolyLine(signal.size(), fColorMap[imod % fColorMap.size()], 2, 1);
97 
98  for(size_t idx = 0; idx < signal.size(); idx++)
99  {
100  float bin = float(idx) + 0.5;
101 
102  if (bin >= lowBin && bin <= hiBin) wireWaveform.SetPoint(idx,bin,signal[idx]);
103  }
104 
105  wireWaveform.Draw("same");
106  }
107  }//end loop over HitFinding modules
108 
109  return;
110 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::vector< int > fColorMap
float evdb_tool::DrawWireData::getMaximum ( ) const
inlineoverridevirtual

Implements evdb_tool::IWaveformDrawer.

Definition at line 34 of file DrawWireData_tool.cc.

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

Implements evdb_tool::IWaveformDrawer.

Definition at line 35 of file DrawWireData_tool.cc.

35 {return fMinimum;};

Member Data Documentation

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

Definition at line 42 of file DrawWireData_tool.cc.

float evdb_tool::DrawWireData::fMaximum
private

Definition at line 35 of file DrawWireData_tool.cc.

float evdb_tool::DrawWireData::fMinimum
private

Definition at line 40 of file DrawWireData_tool.cc.


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