Public Member Functions | Private Attributes | List of all members
wcls::ChannelSelectorDB Class Reference

#include <ChannelSelectorDB.h>

Inheritance diagram for wcls::ChannelSelectorDB:
wcls::ChannelNoiseDB wcls::IArtEventVisitor

Public Member Functions

 ChannelSelectorDB ()
 
virtual ~ChannelSelectorDB ()
 
virtual void visit (art::Event &event)
 IArtEventVisitor. More...
 
virtual void configure (const WireCell::Configuration &config)
 IConfigurable. More...
 
virtual channel_group_t bad_channels () const
 
virtual channel_group_t miscfg_channels () const
 
- Public Member Functions inherited from wcls::ChannelNoiseDB
 ChannelNoiseDB ()
 
virtual ~ChannelNoiseDB ()
 
- Public Member Functions inherited from wcls::IArtEventVisitor
virtual ~IArtEventVisitor ()
 
virtual void produces (art::ProducesCollector &collector)
 

Private Attributes

std::string m_type
 
channel_group_t m_bad_channels
 
channel_group_t m_miscfg_channels
 

Detailed Description

Definition at line 9 of file ChannelSelectorDB.h.

Constructor & Destructor Documentation

wcls::ChannelSelectorDB::ChannelSelectorDB ( )

Definition at line 22 of file ChannelSelectorDB.cxx.

23 {
24 }
wcls::ChannelSelectorDB::~ChannelSelectorDB ( )
virtual

Definition at line 26 of file ChannelSelectorDB.cxx.

27 {
28 }

Member Function Documentation

virtual channel_group_t wcls::ChannelSelectorDB::bad_channels ( ) const
inlinevirtual

Definition at line 25 of file ChannelSelectorDB.h.

25  {
26  return m_bad_channels;
27  }
channel_group_t m_bad_channels
void wcls::ChannelSelectorDB::configure ( const WireCell::Configuration &  config)
virtual

IConfigurable.

Reimplemented from wcls::ChannelNoiseDB.

Definition at line 64 of file ChannelSelectorDB.cxx.

65 {
66  m_type = get<std::string>(cfg, "type", "misconfigured");
67  if(m_type != "bad" && m_type != "misconfigured"){
68  THROW(ValueError() << errmsg{String::format(
69  "Channel type \"%s\" cannot be identified.", m_type)});
70  }
71 }
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
Definition: qstring.cpp:11496
virtual channel_group_t wcls::ChannelSelectorDB::miscfg_channels ( ) const
inlinevirtual

Definition at line 28 of file ChannelSelectorDB.h.

28  {
29  return m_miscfg_channels;
30  }
channel_group_t m_miscfg_channels
void wcls::ChannelSelectorDB::visit ( art::Event event)
virtual

IArtEventVisitor.

Reimplemented from wcls::ChannelNoiseDB.

Definition at line 30 of file ChannelSelectorDB.cxx.

31 {
32  std::cerr << "ChannelSelectorDB art::Event visit!\n";
33 
34  // FIXME: the current assumption in this code is that LS channel
35  // numbers are identified with WCT channel IDs. For MicroBooNE
36  // this holds but in general some translation is needed here.
37  auto const& gc = *lar::providerFrom<geo::Geometry>();
38  auto nchans = gc.Nchannels();
39 
40 
41  if (m_type == "bad") {
42  auto const& csvc = art::ServiceHandle<lariov::ChannelStatusService const>()->GetProvider();
43 
44  for(size_t ich=0; ich<nchans; ++ich) {
45  if (csvc.IsBad(ich)) {
46  m_bad_channels.push_back(ich);
47  }
48  }
49  }
50 
51  if (m_type == "misconfigured") {
52  const auto& esvc = art::ServiceHandle<lariov::ElectronicsCalibService const>()->GetProvider();
53 
54  std::vector<int> mc_channels;
55  for(size_t ich=0; ich<nchans; ++ich) {
56  if (esvc.ExtraInfo(ich).GetBoolData("is_misconfigured")) {
57  m_miscfg_channels.push_back(ich);
58  }
59  }
60  }
61 }
channel_group_t m_bad_channels
channel_group_t m_miscfg_channels

Member Data Documentation

channel_group_t wcls::ChannelSelectorDB::m_bad_channels
private

Definition at line 34 of file ChannelSelectorDB.h.

channel_group_t wcls::ChannelSelectorDB::m_miscfg_channels
private

Definition at line 35 of file ChannelSelectorDB.h.

std::string wcls::ChannelSelectorDB::m_type
private

Definition at line 33 of file ChannelSelectorDB.h.


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