HeterogeneousCore
SonicTriton
interface
TritonEDProducer.h
Go to the documentation of this file.
1
#ifndef HeterogeneousCore_SonicTriton_TritonEDProducer
2
#define HeterogeneousCore_SonicTriton_TritonEDProducer
3
4
//TritonDummyCache include comes first for overload resolution
5
#include "
HeterogeneousCore/SonicTriton/interface/TritonDummyCache.h
"
6
#include "
HeterogeneousCore/SonicCore/interface/SonicEDProducer.h
"
7
#include "
HeterogeneousCore/SonicTriton/interface/TritonClient.h
"
8
#include "
FWCore/ServiceRegistry/interface/Service.h
"
9
#include "
HeterogeneousCore/SonicTriton/interface/TritonService.h
"
10
11
//inherited classes that use a non-default GlobalCache should be sure to call the parent initializeGlobalCache()
12
template
<
typename
G
,
typename
... Capabilities>
13
class
TritonEDProducerT
:
public
SonicEDProducer
<TritonClient, edm::GlobalCache<G>, Capabilities...> {
14
public
:
15
TritonEDProducerT
(
edm::ParameterSet
const
&
cfg
,
const
std::string
& debugName)
16
:
SonicEDProducer
<
TritonClient
,
edm
::
GlobalCache
<
G
>, Capabilities...>(
17
cfg
, debugName,
cfg
.
getParameterSet
(
"Client"
).getUntrackedParameter<
bool
>(
"verbose"
)) {}
18
19
//use this function to avoid calling TritonService functions Nstreams times
20
static
std::unique_ptr<G>
initializeGlobalCache
(
edm::ParameterSet
const
&
pset
) {
21
edm::Service<TritonService>
ts;
22
const
auto
& clientPset =
pset
.getParameterSet(
"Client"
);
23
ts->
addModel
(clientPset.getParameter<
std::string
>(
"modelName"
),
24
clientPset.getParameter<
edm::FileInPath
>(
"modelConfigPath"
).
fullPath
());
25
return
nullptr
;
26
}
27
28
static
void
globalEndJob
(
G
*) {}
29
};
30
31
template
<
typename
... Capabilities>
32
using
TritonEDProducer
=
TritonEDProducerT
<
TritonDummyCache
, Capabilities...>;
33
34
#endif
edm::stream::EDProducer< edm::ExternalWork, Capabilities... >::GlobalCache
typename CacheTypes::GlobalCache GlobalCache
Definition:
EDProducer.h:43
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
edm
HLT enums.
Definition:
AlignableModifier.h:19
TritonClient.h
SonicEDProducer.h
TritonEDProducerT::initializeGlobalCache
static std::unique_ptr< G > initializeGlobalCache(edm::ParameterSet const &pset)
Definition:
TritonEDProducer.h:20
TritonDummyCache
Definition:
TritonDummyCache.h:4
edm::FileInPath
Definition:
FileInPath.h:61
Service.h
TritonEDProducerT
Definition:
TritonEDProducer.h:13
TritonService.h
edm::ParameterSet
Definition:
ParameterSet.h:47
TritonService::addModel
void addModel(const std::string &modelName, const std::string &path)
Definition:
TritonService.cc:141
edm::Service
Definition:
Service.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition:
looper.py:296
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition:
ParameterSet.cc:862
TritonEDProducerT::globalEndJob
static void globalEndJob(G *)
Definition:
TritonEDProducer.h:28
SonicEDProducer
Definition:
SonicEDProducer.h:14
TritonDummyCache.h
cmssw_cycle_finder.G
G
Definition:
cmssw_cycle_finder.py:154
TritonClient
Definition:
TritonClient.h:19
edm::FileInPath::fullPath
std::string fullPath() const
Definition:
FileInPath.cc:161
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
TritonEDProducerT::TritonEDProducerT
TritonEDProducerT(edm::ParameterSet const &cfg, const std::string &debugName)
Definition:
TritonEDProducer.h:15
Generated for CMSSW Reference Manual by
1.8.16