Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
DoubleProducer_module.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------
2
//
3
// Produces an DoubleProduct instance.
4
//
5
//--------------------------------------------------------------------
6
7
#include "
art/Framework/Core/EDProducer.h
"
8
#include "
art/Framework/Core/ModuleMacros.h
"
9
#include "
art/Framework/Principal/Event.h
"
10
#include "
art/Framework/Principal/Handle.h
"
11
#include "
art/test/TestObjects/ToyProducts.h
"
12
#include "
fhiclcpp/ParameterSet.h
"
13
14
#include <iostream>
15
#include <memory>
16
17
namespace
arttest
{
18
class
DoubleProducer;
19
}
20
21
class
arttest::DoubleProducer
:
public
art::EDProducer
{
22
public
:
23
explicit
DoubleProducer
(
fhicl::ParameterSet
const
&
p
)
24
:
EDProducer
{p},
value_
(
p
.get<
double
>(
"dvalue"
))
25
{
26
produces<DoubleProduct>();
27
}
28
29
private
:
30
void
produce
(
art::Event
&
e
)
override
;
31
32
double
const
value_
;
33
};
// DoubleProducer
34
35
void
36
arttest::DoubleProducer::produce
(
art::Event
&
e
)
37
{
38
e.
put
(std::make_unique<DoubleProduct>(
value_
));
39
}
40
41
DEFINE_ART_MODULE
(
arttest::DoubleProducer
)
arttest::DoubleProducer::DoubleProducer
DoubleProducer(fhicl::ParameterSet const &p)
Definition:
DoubleProducer_module.cc:23
Handle.h
art::EDProducer::EDProducer
EDProducer()=default
ParameterSet.h
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
ToyProducts.h
arttest::DoubleProducer::produce
void produce(art::Event &e) override
Definition:
DoubleProducer_module.cc:36
arttest
Definition:
GroupSelector_t.h:4
ModuleMacros.h
art::EDProducer
Definition:
EDProducer.h:15
EDProducer.h
test.p
p
Definition:
test.py:228
arttest::DoubleProducer
Definition:
DoubleProducer_module.cc:21
art::Event
Definition:
Event.h:40
arttest::DoubleProducer::value_
double const value_
Definition:
DoubleProducer_module.cc:32
Event.h
art::DataViewImpl::put
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition:
DataViewImpl.h:692
fhicl::ParameterSet
Definition:
ParameterSet.h:34
Generated by
1.8.11