ChannelStatusServiceTool_tool.cc
Go to the documentation of this file.
1 // ChannelStatusServiceTool_tool.cc
2 
9 
10 #include <iostream>
11 #include <iomanip>
12 
13 using std::cout;
14 using std::endl;
15 using std::setw;
16 using Name = std::string;
18 
19 //**********************************************************************
20 
22 : m_LogLevel(ps.get<Index>("LogLevel")) {
23  const Name myname = "ChannelStatusServiceTool::ctor: ";
25  if ( m_pChannelStatusProvider == nullptr ) {
26  cout << myname << "WARNING: Channel status provider not found." << endl;
27  }
28  if ( m_LogLevel >= 1 ) {
29  cout << myname << " LogLevel: " << m_LogLevel << endl;
30  }
31 }
32 
33 //**********************************************************************
34 
36  const Name myname = "ChannelStatusServiceTool::get: ";
37  Index chanStat = AdcChannelStatusUnknown;
38  if ( m_pChannelStatusProvider != nullptr ) {
39  if ( m_pChannelStatusProvider->IsBad(icha) ) chanStat = AdcChannelStatusBad;
40  else if ( m_pChannelStatusProvider->IsNoisy(icha) ) chanStat = AdcChannelStatusNoisy;
41  else chanStat = AdcChannelStatusGood;
42  }
43  if ( m_LogLevel >= 2 ) {
44  if ( m_LogLevel >=3 || chanStat ) {
45  cout << myname << "Status for channel " << icha << ": " << chanStat << endl;
46  }
47  }
48  return chanStat;
49 }
50 
51 //**********************************************************************
52 
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
const AdcIndex AdcChannelStatusNoisy
Definition: AdcTypes.h:48
std::string string
Definition: nybbler.cc:12
const AdcIndex AdcChannelStatusUnknown
Definition: AdcTypes.h:45
virtual bool IsNoisy(raw::ChannelID_t channel) const =0
Returns whether the specified channel is noisy in the current run.
ChannelGroupService::Name Name
unsigned int Index
ChannelStatusServiceTool(fhicl::ParameterSet const &ps)
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
static constexpr double ps
Definition: Units.h:99
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
Index get(Index icha) const override
const AdcIndex AdcChannelStatusGood
Definition: AdcTypes.h:46
Interface for experiment-specific channel quality info provider.
const AdcIndex AdcChannelStatusBad
Definition: AdcTypes.h:47
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
Interface for experiment-specific service for channel quality info.
QTextStream & endl(QTextStream &s)