Public Types | Public Member Functions | Private Attributes | List of all members
ChannelStatusServiceTool Class Reference

#include <ChannelStatusServiceTool.h>

Inheritance diagram for ChannelStatusServiceTool:
IndexMapTool

Public Types

using Index = IndexMapTool::Index
 
- Public Types inherited from IndexMapTool
using Index = unsigned int
 

Public Member Functions

 ChannelStatusServiceTool (fhicl::ParameterSet const &ps)
 
 ~ChannelStatusServiceTool () override=default
 
Index get (Index icha) const override
 
- Public Member Functions inherited from IndexMapTool
virtual ~IndexMapTool ()=default
 

Private Attributes

Index m_LogLevel
 
const lariov::ChannelStatusProviderm_pChannelStatusProvider
 

Additional Inherited Members

- Static Public Member Functions inherited from IndexMapTool
static Index badIndex ()
 

Detailed Description

Definition at line 23 of file ChannelStatusServiceTool.h.

Member Typedef Documentation

Definition at line 27 of file ChannelStatusServiceTool.h.

Constructor & Destructor Documentation

ChannelStatusServiceTool::ChannelStatusServiceTool ( fhicl::ParameterSet const &  ps)

Definition at line 21 of file ChannelStatusServiceTool_tool.cc.

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 }
ChannelGroupService::Name Name
unsigned int Index
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
static constexpr double ps
Definition: Units.h:99
QTextStream & endl(QTextStream &s)
ChannelStatusServiceTool::~ChannelStatusServiceTool ( )
overridedefault

Member Function Documentation

Index ChannelStatusServiceTool::get ( Index  icha) const
overridevirtual

Implements IndexMapTool.

Definition at line 35 of file ChannelStatusServiceTool_tool.cc.

35  {
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 }
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
const AdcIndex AdcChannelStatusNoisy
Definition: AdcTypes.h:48
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
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
const AdcIndex AdcChannelStatusGood
Definition: AdcTypes.h:46
const AdcIndex AdcChannelStatusBad
Definition: AdcTypes.h:47
QTextStream & endl(QTextStream &s)

Member Data Documentation

Index ChannelStatusServiceTool::m_LogLevel
private

Definition at line 41 of file ChannelStatusServiceTool.h.

const lariov::ChannelStatusProvider* ChannelStatusServiceTool::m_pChannelStatusProvider
private

Definition at line 44 of file ChannelStatusServiceTool.h.


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