Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
ProductIDGetterNoPut_module.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Class: ProductIDGetterNoPut
3
// Module Type: producer
4
// File: ProductIDGetterNoPut_module.cc
5
////////////////////////////////////////////////////////////////////////
6
7
#include "
cetlib/quiet_unit_test.hpp
"
8
9
#include "
art/Framework/Core/EDProducer.h
"
10
#include "
art/Framework/Core/ModuleMacros.h
"
11
#include "
art/Framework/Principal/Event.h
"
12
#include "
canvas/Persistency/Common/Ptr.h
"
13
#include "
canvas/Persistency/Provenance/ProductID.h
"
14
15
#include <vector>
16
17
namespace
art
{
18
namespace
test
{
19
class
ProductIDGetterNoPut;
20
}
21
}
// namespace art
22
23
class
art::test::ProductIDGetterNoPut
:
public
EDProducer
{
24
public
:
25
explicit
ProductIDGetterNoPut
(
fhicl::ParameterSet
const
&);
26
27
private
:
28
void
produce
(
art::Event
&)
override
;
29
};
30
31
art::test::ProductIDGetterNoPut::ProductIDGetterNoPut
(
32
fhicl::ParameterSet
const
&
ps
)
33
:
EDProducer
{ps}
34
{
35
produces<int>();
36
produces<int>(
"i1"
);
37
}
38
39
void
40
art::test::ProductIDGetterNoPut::produce
(
Event
&
e
)
41
{
42
ProductID
const
p1{e.
getProductID
<
int
>()};
43
BOOST_REQUIRE
(p1.isValid());
44
ProductID
const
p2{e.
getProductID
<
int
>(
"i1"
)};
45
BOOST_REQUIRE
(p2.isValid());
46
BOOST_REQUIRE_NE(p1, p2);
47
}
48
49
DEFINE_ART_MODULE
(
art::test::ProductIDGetterNoPut
)
art::DataViewImpl::getProductID
ProductID getProductID(std::string const &instance_name="") const
Definition:
DataViewImpl.h:347
genie::units::ps
static const double ps
Definition:
Units.h:103
art::test::ProductIDGetterNoPut::produce
void produce(art::Event &) override
Definition:
ProductIDGetterNoPut_module.cc:40
test
Definition:
test.py:1
art::test::ProductIDGetterNoPut
Definition:
ProductIDGetterNoPut_module.cc:23
ProductID.h
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
quiet_unit_test.hpp
Ptr.h
ModuleMacros.h
art::EDProducer
Definition:
EDProducer.h:15
BOOST_REQUIRE
BOOST_REQUIRE(inFile)
EDProducer.h
art::Event
Definition:
Event.h:40
art
Definition:
BasicOptionsHandler.h:11
Event.h
art::test::ProductIDGetterNoPut::ProductIDGetterNoPut
ProductIDGetterNoPut(fhicl::ParameterSet const &)
Definition:
ProductIDGetterNoPut_module.cc:31
art::ProductID
Definition:
ProductID.h:16
fhicl::ParameterSet
Definition:
ParameterSet.h:34
Generated by
1.8.11