Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Service
FixedChannelGroupService_service.cc
Go to the documentation of this file.
1
// FixedChannelGroupService.cxx
2
3
#include "
dunecore/DuneCommon/Service/FixedChannelGroupService.h
"
4
#include "
art/Framework/Services/Registry/ServiceDefinitionMacros.h
"
5
#include <sstream>
6
#include <iomanip>
7
8
using
std::cout;
9
using
std::ostream;
10
using
std::endl
;
11
using
std::string
;
12
using
std::ostringstream;
13
using
std::setfill
;
14
using
std::setw
;
15
using
std::vector
;
16
using
std::move
;
17
18
typedef
ChannelGroupService::Index
Index
;
19
typedef
ChannelGroupService::Name
Name
;
20
typedef
ChannelGroupService::ChannelVector
ChannelVector
;
21
22
//**********************************************************************
23
24
FixedChannelGroupService::
25
FixedChannelGroupService
(
fhicl::ParameterSet
const
& pset) {
26
vector<string>
names
= pset.
get_names
();
27
for
(
string
name
: names ) {
28
if
(
name
==
"service_provider"
)
continue
;
29
if
(
name
==
"service_type"
)
continue
;
30
ChannelVector
chans = pset.
get
<
ChannelVector
>(
name
);
31
m_names
.push_back(
name
);
32
m_chanvecs
.emplace_back(
move
(chans));
33
}
34
}
35
36
//**********************************************************************
37
38
FixedChannelGroupService::
39
FixedChannelGroupService
(
fhicl::ParameterSet
const
& pset,
art::ActivityRegistry
&)
40
:
FixedChannelGroupService
(pset) { }
41
42
//**********************************************************************
43
44
Index
FixedChannelGroupService::size
()
const
{
45
return
m_names
.size();
46
}
47
48
//**********************************************************************
49
50
Name
FixedChannelGroupService::name
(
Index
igrp)
const
{
51
if
( igrp <
m_names
.size() )
return
m_names
[igrp];
52
return
"NoSuchGroup"
;
53
}
54
55
//**********************************************************************
56
57
const
ChannelVector
&
FixedChannelGroupService::channels
(
Index
igrp)
const
{
58
if
( igrp <
m_chanvecs
.size() )
return
m_chanvecs
[igrp];
59
static
ChannelVector
empty
;
60
return
empty
;
61
}
62
63
//**********************************************************************
64
65
ostream&
FixedChannelGroupService::print
(ostream& out,
string
prefix
)
const
{
66
out << prefix <<
"FixedChannelGroupService: "
<<
endl
;
67
out << prefix <<
" # group: "
<<
size
() <<
endl
;
68
return
out;
69
}
70
71
//**********************************************************************
72
73
DEFINE_ART_SERVICE_INTERFACE_IMPL
(
FixedChannelGroupService
,
ChannelGroupService
)
74
75
//**********************************************************************
FixedChannelGroupService
Definition:
FixedChannelGroupService.h:14
FixedChannelGroupService::m_names
NameVector m_names
Definition:
FixedChannelGroupService.h:45
submit_ppfxjobs.prefix
string prefix
Definition:
submit_ppfxjobs.py:128
string
std::string string
Definition:
nybbler.cc:12
vector
struct vector vector
Name
ChannelGroupService::Name Name
Definition:
FixedChannelGroupService_service.cc:19
ChannelGroupService::Name
std::string Name
Definition:
ChannelGroupService.h:21
FixedChannelGroupService::size
Index size() const
Definition:
FixedChannelGroupService_service.cc:44
FixedChannelGroupService::print
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
Definition:
FixedChannelGroupService_service.cc:65
FixedChannelGroupService.h
ChannelGroupService
Definition:
ChannelGroupService.h:14
wirecell.gen.depos.move
def move(depos, offset)
Definition:
depos.py:107
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
FixedChannelGroupService::channels
const ChannelVector & channels(Index igrp) const
Definition:
FixedChannelGroupService_service.cc:57
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
ChannelVector
ChannelGroupService::ChannelVector ChannelVector
Definition:
FixedChannelGroupService_service.cc:20
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
fhicl::ParameterSet::get_names
std::vector< std::string > get_names() const
Definition:
ParameterSet.cc:179
ServiceDefinitionMacros.h
dune::names
static std::vector< std::string > const names
Definition:
FragmentType.hh:8
FixedChannelGroupService::FixedChannelGroupService
FixedChannelGroupService(fhicl::ParameterSet const &pset)
Definition:
FixedChannelGroupService_service.cc:25
ChannelGroupService::Index
unsigned int Index
Definition:
ChannelGroupService.h:18
FixedChannelGroupService::m_chanvecs
ChannelVectorVector m_chanvecs
Definition:
FixedChannelGroupService.h:46
setfill
Q_EXPORT QTSManip setfill(int f)
Definition:
qtextstream.h:337
util::empty
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition:
StdUtils.h:97
Index
ChannelGroupService::Index Index
Definition:
FixedChannelGroupService_service.cc:18
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
FixedChannelGroupService::name
Name name(Index igrp) const
Definition:
FixedChannelGroupService_service.cc:50
fhicl::ParameterSet
Definition:
ParameterSet.h:36
ChannelGroupService::ChannelVector
std::vector< Channel > ChannelVector
Definition:
ChannelGroupService.h:20
DEFINE_ART_SERVICE_INTERFACE_IMPL
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
Definition:
ServiceDefinitionMacros.h:42
Generated by
1.8.11