Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunedataprep
dunedataprep
DataPrep
Tool
RemoveBadChannels_tool.cc
Go to the documentation of this file.
1
// RemoveBadChannels_tool.cc
2
3
#include "
RemoveBadChannels.h
"
4
#include "
larevt/CalibrationDBI/Interface/ChannelStatusService.h
"
5
#include "
larevt/CalibrationDBI/Interface/ChannelStatusProvider.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
18
RemoveBadChannels::RemoveBadChannels
(
fhicl::ParameterSet
const
&
ps
)
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
}
29
m_pChannelStatusProvider
= &
art::ServiceHandle<lariov::ChannelStatusService>
()->GetProvider();
30
if
(
m_pChannelStatusProvider
==
nullptr
) {
31
cout << myname <<
"WARNING: Channel status provider not found."
<<
endl
;
32
}
33
}
34
35
//**********************************************************************
36
37
DataMap
RemoveBadChannels::update
(
AdcChannelData
& acd)
const
{
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
44
if
((
m_pChannelStatusProvider
->
IsBad
(acd.
channel
()) &&
m_RemoveBadChs
) ||
45
(
m_pChannelStatusProvider
->
IsNoisy
(acd.
channel
()) &&
m_RemoveNoisyChs
)){
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
55
DEFINE_ART_CLASS_TOOL
(
RemoveBadChannels
)
lariov::ChannelStatusProvider::IsBad
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
RemoveBadChannels::update
DataMap update(AdcChannelData &acd) const override
Definition:
RemoveBadChannels_tool.cc:37
art::ServiceHandle
Definition:
ServiceHandle.h:37
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
RemoveBadChannels::m_RemoveNoisyChs
bool m_RemoveNoisyChs
Definition:
RemoveBadChannels.h:34
string
std::string string
Definition:
nybbler.cc:12
RemoveBadChannels::m_RemoveBadChs
bool m_RemoveBadChs
Definition:
RemoveBadChannels.h:33
lariov::ChannelStatusProvider::IsNoisy
virtual bool IsNoisy(raw::ChannelID_t channel) const =0
Returns whether the specified channel is noisy in the current run.
Index
unsigned int Index
Definition:
sspmapmaker_v1.c:14
AdcChannelData
Definition:
AdcChannelData.h:95
RemoveBadChannels
Definition:
RemoveBadChannels.h:19
RemoveBadChannels::RemoveBadChannels
RemoveBadChannels(fhicl::ParameterSet const &ps)
Definition:
RemoveBadChannels_tool.cc:18
cache_state.sam
sam
Definition:
cache_state.py:334
AdcChannelData::run
AdcIndex run() const
Definition:
AdcChannelData.h:174
AdcChannelData::event
AdcIndex event() const
Definition:
AdcChannelData.h:176
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
AdcChannelData::channel
Channel channel() const
Definition:
AdcChannelData.h:199
ChannelStatusProvider.h
Interface for experiment-specific channel quality info provider.
RemoveBadChannels.h
RemoveBadChannels::m_LogLevel
int m_LogLevel
Definition:
RemoveBadChannels.h:32
RemoveBadChannels::m_pChannelStatusProvider
const lariov::ChannelStatusProvider * m_pChannelStatusProvider
Definition:
RemoveBadChannels.h:37
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.
DataMap
Definition:
DataMap.h:43
bool
int bool
Definition:
qglobal.h:345
AdcChannelData::samples
AdcSignalVector samples
Definition:
AdcChannelData.h:131
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11