Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
TestFilterSpecificEvents_module.cc
Go to the documentation of this file.
1
#include "
art/Framework/Core/EDFilter.h
"
2
#include "
art/Framework/Core/ModuleMacros.h
"
3
#include "
art/Framework/Principal/Event.h
"
4
#include "
cetlib/container_algorithms.h
"
5
#include "
fhiclcpp/types/Sequence.h
"
6
7
#include <vector>
8
9
namespace
{
10
using namespace
fhicl
;
11
struct
Config {
12
Sequence<unsigned>
eventsToAccept{
Name
(
"eventsToAccept"
)};
13
};
14
}
// namespace
15
16
namespace
art
{
17
namespace
test
{
18
class
TestFilterSpecificEvents;
19
}
20
}
// namespace art
21
22
class
art::test::TestFilterSpecificEvents
:
public
EDFilter
{
23
public
:
24
using
Parameters
=
EDFilter::Table<Config>
;
25
26
explicit
TestFilterSpecificEvents
(
Parameters
const
&
ps
)
27
:
EDFilter
{ps}, eventsToAccept_{
ps
().eventsToAccept()}
28
{
29
cet::sort_all
(eventsToAccept_);
30
}
31
32
private
:
33
bool
34
filter
(
art::Event
&
e
)
override
35
{
36
return
cet::binary_search_all
(eventsToAccept_, e.
event
());
37
}
38
39
std::vector<unsigned>
eventsToAccept_
;
40
};
41
42
DEFINE_ART_MODULE
(
art::test::TestFilterSpecificEvents
)
Sequence.h
art::DataViewImpl::event
EventNumber_t event() const
Definition:
DataViewImpl.cc:96
art::EDFilter
Definition:
EDFilter.h:17
container_algorithms.h
art::test::TestFilterSpecificEvents::eventsToAccept_
std::vector< unsigned > eventsToAccept_
Definition:
TestFilterSpecificEvents_module.cc:39
genie::units::ps
static const double ps
Definition:
Units.h:103
test
Definition:
test.py:1
art::test::TestFilterSpecificEvents::filter
bool filter(art::Event &e) override
Definition:
TestFilterSpecificEvents_module.cc:34
art::ProducerTable
Definition:
ProducerTable.h:19
cet::sort_all
void sort_all(RandCont &)
Definition:
container_algorithms.h:246
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:68
EDFilter.h
art::test::TestFilterSpecificEvents::TestFilterSpecificEvents
TestFilterSpecificEvents(Parameters const &ps)
Definition:
TestFilterSpecificEvents_module.cc:26
fhicl
parameter set interface
Definition:
prune_configuration.h:9
ModuleMacros.h
art::Event
Definition:
Event.h:40
cet::binary_search_all
bool binary_search_all(FwdCont const &, Datum const &)
Definition:
container_algorithms.h:199
art
Definition:
BasicOptionsHandler.h:11
fhicl::Sequence
Definition:
type_traits.h:43
Event.h
Name
AdcRoiViewer::Name Name
Definition:
AdcRoiViewer_tool.cc:30
art::test::TestFilterSpecificEvents
Definition:
TestFilterSpecificEvents_module.cc:22
Generated by
1.8.11