DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
trigger
include
trigger
AlgorithmPlugins.hpp
Go to the documentation of this file.
1
10
11
#ifndef TRIGGER_INCLUDE_TRIGGER_ALGORITHMPLUGINS_HPP_
12
#define TRIGGER_INCLUDE_TRIGGER_ALGORITHMPLUGINS_HPP_
13
14
#include "
triggeralgs/TriggerDecisionMaker.hpp
"
15
#include "
triggeralgs/TriggerActivityFactory.hpp
"
16
#include "
triggeralgs/TriggerCandidateFactory.hpp
"
17
#include "
trigger/Issues.hpp
"
18
19
#include "cetlib/BasicPluginFactory.h"
20
21
#include <memory>
22
#include <string>
23
24
namespace
dunedaq::trigger
{
31
inline
std::unique_ptr<triggeralgs::TriggerActivityMaker>
32
make_ta_maker
(std::string
const
& plugin_name)
33
{
34
auto
ta_factory =
triggeralgs::TriggerActivityFactory::get_instance
();
35
auto
ta_maker = ta_factory->build_maker(plugin_name);
36
if
(!ta_maker) {
37
throw
MissingFactoryItemError(
ERS_HERE
, plugin_name);
38
}
39
return
ta_maker;
40
}
41
42
}
// namespace dunedaq::trigger
43
44
namespace
dunedaq::trigger
{
51
inline
std::unique_ptr<triggeralgs::TriggerCandidateMaker>
52
make_tc_maker
(std::string
const
& plugin_name)
53
{
54
auto
tc_factory =
triggeralgs::TriggerCandidateFactory::get_instance
();
55
auto
tc_maker = tc_factory->build_maker(plugin_name);
56
if
(!tc_maker) {
57
throw
MissingFactoryItemError(
ERS_HERE
, plugin_name);
58
}
59
return
tc_maker;
60
}
61
62
}
// namespace dunedaq::trigger
63
68
// NOLINTNEXTLINE(build/define_used)
69
#define DEFINE_DUNE_TD_MAKER(klass) \
70
extern "C" \
71
{ \
72
std::unique_ptr<triggeralgs::TriggerDecisionMaker> make() \
73
{ \
74
return std::unique_ptr<triggeralgs::TriggerDecisionMaker>(new klass()); \
75
} \
76
}
77
78
namespace
dunedaq::trigger
{
85
inline
std::unique_ptr<triggeralgs::TriggerDecisionMaker>
86
make_td_maker
(std::string
const
& plugin_name)
87
{
88
static
cet::BasicPluginFactory bpf(
"duneTDMaker"
,
"make"
);
89
90
// TODO Philip Rodrigues <philiprodrigues@github.com> Apr-04-2021: Rethrow any cetlib exception as an ERS issue
91
return
bpf.makePlugin<std::unique_ptr<triggeralgs::TriggerDecisionMaker>>(plugin_name);
92
}
93
94
}
// namespace dunedaq::trigger
95
96
#endif
// TRIGGER_INCLUDE_TRIGGER_ALGORITHMPLUGINS_HPP_
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:141
TriggerActivityFactory.hpp
TriggerCandidateFactory.hpp
TriggerDecisionMaker.hpp
triggeralgs::AbstractFactory< TriggerActivityMaker >::get_instance
static std::shared_ptr< AbstractFactory< TriggerActivityMaker > > get_instance()
Definition
AbstractFactory.hxx:54
dunedaq::trigger
Definition
AlgorithmPlugins.hpp:24
dunedaq::trigger::make_tc_maker
std::unique_ptr< triggeralgs::TriggerCandidateMaker > make_tc_maker(std::string const &plugin_name)
Load a TriggerCandidateMaker plugin and return a unique_ptr to the contained class.
Definition
AlgorithmPlugins.hpp:52
dunedaq::trigger::make_ta_maker
std::unique_ptr< triggeralgs::TriggerActivityMaker > make_ta_maker(std::string const &plugin_name)
Load a TriggerActivityMaker plugin and return a unique_ptr to the contained class.
Definition
AlgorithmPlugins.hpp:32
dunedaq::trigger::make_td_maker
std::unique_ptr< triggeralgs::TriggerDecisionMaker > make_td_maker(std::string const &plugin_name)
Load a TriggerDecisionMaker plugin and return a unique_ptr to the contained class.
Definition
AlgorithmPlugins.hpp:86
Issues.hpp
Generated on
for DUNE-DAQ by
1.17.0