Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
ToyProductFilterAsync_module.cc
Go to the documentation of this file.
1
// vim: set sw=2 expandtab :
2
#include "
art/Framework/Core/ModuleMacros.h
"
3
#include "
art/Framework/Core/SharedFilter.h
"
4
#include "
art/Framework/Principal/Event.h
"
5
#include "
art/Framework/Principal/Handle.h
"
6
#include "
art/test/TestObjects/ToyProducts.h
"
7
#include "
fhiclcpp/ParameterSet.h
"
8
9
#include <iostream>
10
#include <sstream>
11
#include <string>
12
13
using namespace
art
;
14
using namespace
std
;
15
16
namespace
{
17
18
double
19
f
(
int
val
)
20
{
21
return
sqrt(val);
22
}
23
24
void
25
use_cpu_time(
double
&
val
)
26
{
27
for
(
int
i
= 0;
i
< 100
'000'
000; ++
i
) {
28
val =
f
(
i
);
29
}
30
}
31
32
}
// unnamed namespace
33
34
namespace
arttest
{
35
36
class
ToyProductFilterAsync
:
public
SharedFilter
{
37
public
:
38
struct
Config
{
39
fhicl::Atom<std::string>
inputLabel{
fhicl::Name
{
"inputLabel"
}};
40
};
41
using
Parameters
=
Table<Config>
;
42
explicit
ToyProductFilterAsync
(
Parameters
const
&
p
,
ProcessingFrame
const
&);
43
44
private
:
45
bool
filter
(
Event
&
e
,
ProcessingFrame
const
&)
override
;
46
47
string
const
inputLabel_{};
48
};
49
50
ToyProductFilterAsync::ToyProductFilterAsync(
Parameters
const
& pset,
51
ProcessingFrame
const
&)
52
:
SharedFilter
{pset},
inputLabel_
{pset().inputLabel()}
53
{
54
async<InEvent>();
55
}
56
57
bool
58
ToyProductFilterAsync::filter
(
Event
&,
ProcessingFrame
const
&)
59
{
60
double
val
= 0.0;
61
use_cpu_time(val);
62
return
true
;
63
}
64
65
}
// namespace arttest
66
67
DEFINE_ART_MODULE
(
arttest::ToyProductFilterAsync
)
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:140
val
Definition:
registry_via_id_test_2.cc:15
Handle.h
arttest::ToyProductFilterAsync
Definition:
ToyProductFilterAsync_module.cc:36
art::SharedFilter
Definition:
SharedFilter.h:17
SharedFilter.h
std
STL namespace.
art::ProducerTable
Definition:
ProducerTable.h:19
ParameterSet.h
sensitivity_comps.i
int i
Definition:
sensitivity_comps.py:15
arttest::ToyProductFilterAsync::filter
bool filter(Event &e, ProcessingFrame const &) override
Definition:
ToyProductFilterAsync_module.cc:58
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
ToyProducts.h
art::ProcessingFrame
Definition:
ProcessingFrame.h:8
arttest
Definition:
GroupSelector_t.h:4
fhicl::Atom< std::string >
ModuleMacros.h
art::ModuleType::filter
test.p
p
Definition:
test.py:228
art::Event
Definition:
Event.h:40
arttest::ToyProductFilterAsync::inputLabel_
string const inputLabel_
Definition:
ToyProductFilterAsync_module.cc:47
art
Definition:
BasicOptionsHandler.h:11
Event.h
arttest::ToyProductFilterAsync::Config
Definition:
ToyProductFilterAsync_module.cc:38
fhicl::Name
Definition:
Name.h:11
Generated by
1.8.11