Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
event-processor
ThrowingAnalyzer_module.cc
Go to the documentation of this file.
1
#include "
art/Framework/Core/EDAnalyzer.h
"
2
#include "
art/Framework/Core/ModuleMacros.h
"
3
#include "
art/test/Integration/event-processor/ThrowAfterConfig.h
"
4
#include "
canvas/Utilities/Exception.h
"
5
#include "
fhiclcpp/types/Atom.h
"
6
7
namespace
art
{
8
namespace
test
{
9
class
ThrowingAnalyzer;
10
}
11
}
// namespace art
12
13
class
art::test::ThrowingAnalyzer
:
public
EDAnalyzer
{
14
unsigned
count_
{};
15
unsigned
threshold_
;
16
17
public
:
18
using
Parameters
=
EDAnalyzer::Table<ThrowAfterConfig>
;
19
20
ThrowingAnalyzer
(
Parameters
const
&
p
)
21
:
EDAnalyzer
{p}, threshold_{
p
().throwAfter()}
22
{
23
if
(
p
().throwFromCtor()) {
24
throw
Exception
{
errors::OtherArt
} <<
"Throw from c'tor.\n"
;
25
}
26
}
27
28
void
29
analyze
(
Event
const
&)
override
30
{
31
if
(++
count_
> threshold_) {
32
throw
Exception
{
errors::OtherArt
} <<
"Throw from analyze.\n"
;
33
}
34
}
35
};
36
37
DEFINE_ART_MODULE
(
art::test::ThrowingAnalyzer
)
art::test::ThrowingAnalyzer::ThrowingAnalyzer
ThrowingAnalyzer(Parameters const &p)
Definition:
ThrowingAnalyzer_module.cc:20
test
Definition:
test.py:1
Exception.h
art::test::ThrowingAnalyzer::threshold_
unsigned threshold_
Definition:
ThrowingAnalyzer_module.cc:15
art::test::ThrowingAnalyzer::analyze
void analyze(Event const &) override
Definition:
ThrowingAnalyzer_module.cc:29
art::test::ThrowingAnalyzer
Definition:
ThrowingAnalyzer_module.cc:13
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
art::errors::OtherArt
Definition:
Exception.h:24
art::detail::Analyzer::Table
Definition:
Analyzer.h:32
EDAnalyzer.h
ModuleMacros.h
test.p
p
Definition:
test.py:228
art::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:66
art::Event
Definition:
Event.h:40
art::test::ThrowingAnalyzer::count_
unsigned count_
Definition:
ThrowingAnalyzer_module.cc:14
art::EDAnalyzer
Definition:
EDAnalyzer.h:22
Atom.h
art
Definition:
BasicOptionsHandler.h:11
ThrowAfterConfig.h
Generated by
1.8.11