Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Tool
ChannelStatusServiceTool_tool.cc
Go to the documentation of this file.
1
// ChannelStatusServiceTool_tool.cc
2
3
#include "
ChannelStatusServiceTool.h
"
4
#include "
dunecore/DuneInterface/Data/AdcTypes.h
"
5
#include "
fhiclcpp/intermediate_table.h
"
6
#include "
fhiclcpp/make_ParameterSet.h
"
7
#include "
larevt/CalibrationDBI/Interface/ChannelStatusService.h
"
8
#include "
larevt/CalibrationDBI/Interface/ChannelStatusProvider.h
"
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
;
17
using
Index
=
ChannelStatusServiceTool::Index
;
18
19
//**********************************************************************
20
21
ChannelStatusServiceTool::ChannelStatusServiceTool
(
fhicl::ParameterSet
const
&
ps
)
22
: m_LogLevel(ps.
get
<
Index
>(
"LogLevel"
)) {
23
const
Name
myname =
"ChannelStatusServiceTool::ctor: "
;
24
m_pChannelStatusProvider
= &
art::ServiceHandle<lariov::ChannelStatusService>
()->GetProvider();
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
35
Index
ChannelStatusServiceTool::get
(
Index
icha)
const
{
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
53
DEFINE_ART_CLASS_TOOL
(
ChannelStatusServiceTool
)
lariov::ChannelStatusProvider::IsBad
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
ChannelStatusServiceTool
Definition:
ChannelStatusServiceTool.h:23
art::ServiceHandle
Definition:
ServiceHandle.h:37
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
intermediate_table.h
ChannelStatusServiceTool::Index
IndexMapTool::Index Index
Definition:
ChannelStatusServiceTool.h:27
AdcChannelStatusNoisy
const AdcIndex AdcChannelStatusNoisy
Definition:
AdcTypes.h:48
string
std::string string
Definition:
nybbler.cc:12
AdcChannelStatusUnknown
const AdcIndex AdcChannelStatusUnknown
Definition:
AdcTypes.h:45
lariov::ChannelStatusProvider::IsNoisy
virtual bool IsNoisy(raw::ChannelID_t channel) const =0
Returns whether the specified channel is noisy in the current run.
ChannelStatusServiceTool::m_LogLevel
Index m_LogLevel
Definition:
ChannelStatusServiceTool.h:41
make_ParameterSet.h
Name
ChannelGroupService::Name Name
Definition:
FixedChannelGroupService_service.cc:19
Index
unsigned int Index
Definition:
sspmapmaker_v1.c:14
ChannelStatusServiceTool::ChannelStatusServiceTool
ChannelStatusServiceTool(fhicl::ParameterSet const &ps)
Definition:
ChannelStatusServiceTool_tool.cc:21
ChannelStatusServiceTool::m_pChannelStatusProvider
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
Definition:
ChannelStatusServiceTool.h:44
AdcTypes.h
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
ChannelStatusServiceTool::get
Index get(Index icha) const override
Definition:
ChannelStatusServiceTool_tool.cc:35
AdcChannelStatusGood
const AdcIndex AdcChannelStatusGood
Definition:
AdcTypes.h:46
ChannelStatusProvider.h
Interface for experiment-specific channel quality info provider.
AdcChannelStatusBad
const AdcIndex AdcChannelStatusBad
Definition:
AdcTypes.h:47
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
ChannelStatusService.h
Interface for experiment-specific service for channel quality info.
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
ChannelStatusServiceTool.h
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11