Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
FailingProducer_module.cc
Go to the documentation of this file.
1
#include "
art/Framework/Core/EDProducer.h
"
2
#include "
art/Framework/Core/ModuleMacros.h
"
3
#include "
art/test/TestObjects/ToyProducts.h
"
4
5
namespace
arttest
{
6
class
FailingProducer;
7
}
8
9
//--------------------------------------------------------------------
10
//
11
// throws an exception.
12
// Announces an IntProduct but does not produce one;
13
// every call to FailingProducer::produce throws an art::Exception
14
//
15
class
arttest::FailingProducer
:
public
art::EDProducer
{
16
public
:
17
explicit
FailingProducer
(
fhicl::ParameterSet
const
&
ps
) :
EDProducer
{ps}
18
{
19
produces<arttest::IntProduct>();
20
}
21
22
private
:
23
void
produce
(
art::Event
&
e
)
override
;
24
};
25
26
void
27
arttest::FailingProducer::produce
(
art::Event
&)
28
{
29
// We throw an edm exception with a configurable action.
30
throw
art::Exception
(
art::errors::ProductNotFound
)
31
<<
"Intentional 'ProductNotFound' exception for testing purposes\n"
;
32
}
33
34
DEFINE_ART_MODULE
(
arttest::FailingProducer
)
genie::units::ps
static const double ps
Definition:
Units.h:103
art::EDProducer::EDProducer
EDProducer()=default
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
arttest::FailingProducer
Definition:
FailingProducer_module.cc:15
ToyProducts.h
art::errors::ProductNotFound
Definition:
Exception.h:29
arttest
Definition:
GroupSelector_t.h:4
ModuleMacros.h
art::EDProducer
Definition:
EDProducer.h:15
EDProducer.h
art::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:66
arttest::FailingProducer::produce
void produce(art::Event &e) override
Definition:
FailingProducer_module.cc:27
art::Event
Definition:
Event.h:40
arttest::FailingProducer::FailingProducer
FailingProducer(fhicl::ParameterSet const &ps)
Definition:
FailingProducer_module.cc:17
fhicl::ParameterSet
Definition:
ParameterSet.h:34
Generated by
1.8.11