RemoveBadChannels_tool.cc
Go to the documentation of this file.
1 // RemoveBadChannels_tool.cc
2 
3 #include "RemoveBadChannels.h"
6 #include <iostream>
7 
8 using std::string;
9 using std::cout;
10 using std::endl;
11 
12 using Index = unsigned int;
13 
14 //**********************************************************************
15 // Class methods.
16 //**********************************************************************
17 
19 : m_LogLevel(ps.get<int>("LogLevel"))
20 , m_RemoveBadChs(ps.get<bool>("RemoveBadChs"))
21 , m_RemoveNoisyChs(ps.get<bool>("RemoveNoisyChs")) {
22  const string myname = "RemoveBadChannels::ctor: ";
23  if ( m_LogLevel >= 1 ) {
24  cout << myname << "Parameters:" << endl;
25  cout << myname << " LogLevel: " << m_LogLevel << endl;
26  cout << myname << " RemoveBadChs: " << m_RemoveBadChs << endl;
27  cout << myname << " RemoveNoisyChs: " << m_RemoveNoisyChs << endl;
28  }
30  if ( m_pChannelStatusProvider == nullptr ) {
31  cout << myname << "WARNING: Channel status provider not found." << endl;
32  }
33 }
34 
35 //**********************************************************************
36 
38  const string myname = "RemoveBadChannels::update: ";
39  if ( m_LogLevel >= 2 ) cout << "Processing run " << acd.run() << " event " << acd.event()
40  << " channel " << acd.channel() << endl;
41  DataMap ret;
42 
43  //Set channel output to 0 for bad channels
46  if ( m_LogLevel >= 2 ) cout << "Zeroing " << acd.run() << " event " << acd.event() << " channel " << acd.channel() << endl;
47  for ( float& sam : acd.samples ) sam = 0;
48  }
49 
50  return ret;
51 }
52 
53 //**********************************************************************
54 
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
DataMap update(AdcChannelData &acd) const override
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
std::string string
Definition: nybbler.cc:12
virtual bool IsNoisy(raw::ChannelID_t channel) const =0
Returns whether the specified channel is noisy in the current run.
unsigned int Index
RemoveBadChannels(fhicl::ParameterSet const &ps)
AdcIndex run() const
AdcIndex event() const
static constexpr double ps
Definition: Units.h:99
Channel channel() const
Interface for experiment-specific channel quality info provider.
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
Interface for experiment-specific service for channel quality info.
int bool
Definition: qglobal.h:345
AdcSignalVector samples
QTextStream & endl(QTextStream &s)