Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
RecoTracker
FinalTrackSelectors
plugins
TfGraphDefProducer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: RecoTracker/FinalTrackSelectors
4
// Class: TFGraphDefProducer
5
//
9
//
10
// Original Author: Joona Havukainen
11
// Created: Fri, 24 Jul 2020 08:04:00 GMT
12
//
13
//
14
15
// system include files
16
#include <memory>
17
18
// user include files
19
#include "
FWCore/Framework/interface/ModuleFactory.h
"
20
#include "
FWCore/Framework/interface/ESProducer.h
"
21
22
#include "
FWCore/Framework/interface/ESHandle.h
"
23
#include "
TrackingTools/Records/interface/TfGraphRecord.h
"
24
#include "
RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h
"
25
26
// class declaration
27
28
class
TfGraphDefProducer
:
public
edm::ESProducer
{
29
public
:
30
TfGraphDefProducer
(
const
edm::ParameterSet
&);
31
using
ReturnType
= std::unique_ptr<TfGraphDefWrapper>;
32
33
ReturnType
produce
(
const
TfGraphRecord
&);
34
35
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
36
37
private
:
38
const
std::string
filename_
;
39
// ----------member data ---------------------------
40
};
41
42
TfGraphDefProducer::TfGraphDefProducer
(
const
edm::ParameterSet
& iConfig)
43
: filename_(iConfig.getParameter<
edm
::FileInPath>(
"FileName"
).
fullPath
()) {
44
auto
componentName = iConfig.
getParameter
<
std::string
>(
"ComponentName"
);
45
setWhatProduced
(
this
, componentName);
46
}
47
48
// ------------ method called to produce the data ------------
49
TfGraphDefProducer::ReturnType
TfGraphDefProducer::produce
(
const
TfGraphRecord
& iRecord) {
50
auto
* graph =
tensorflow::loadGraphDef
(
filename_
);
51
return
std::make_unique<TfGraphDefWrapper>(
tensorflow::createSession
(graph, 1), graph);
52
}
53
54
void
TfGraphDefProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
55
edm::ParameterSetDescription
desc
;
56
desc
.add<
std::string
>(
"ComponentName"
,
"tfGraphDef"
);
57
desc
.add<
edm::FileInPath
>(
"FileName"
);
58
descriptions.
add
(
"tfGraphDefProducer"
,
desc
);
59
}
60
61
//define this as a plug-in
62
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
63
#include "
FWCore/Framework/interface/MakerMacros.h
"
64
DEFINE_FWK_EVENTSETUP_MODULE
(
TfGraphDefProducer
);
TfGraphDefWrapper.h
tensorflow::createSession
Session * createSession(SessionOptions &sessionOptions)
Definition:
TensorFlow.cc:85
ESHandle.h
contentValuesFiles.fullPath
fullPath
Definition:
contentValuesFiles.py:64
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
TfGraphDefProducer::ReturnType
std::unique_ptr< TfGraphDefWrapper > ReturnType
Definition:
TfGraphDefProducer.cc:31
TfGraphRecord
Definition:
TfGraphRecord.h:20
TfGraphDefProducer::TfGraphDefProducer
TfGraphDefProducer(const edm::ParameterSet &)
Definition:
TfGraphDefProducer.cc:42
edm::FileInPath
Definition:
FileInPath.h:64
TfGraphDefProducer::filename_
const std::string filename_
Definition:
TfGraphDefProducer.cc:38
MakerMacros.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
ModuleDef.h
TfGraphDefProducer::produce
ReturnType produce(const TfGraphRecord &)
Definition:
TfGraphDefProducer.cc:49
tensorflow::loadGraphDef
GraphDef * loadGraphDef(const std::string &pbFile)
Definition:
TensorFlow.cc:68
TfGraphRecord.h
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
TfGraphDefProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TfGraphDefProducer.cc:54
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
edm::ESProducer
Definition:
ESProducer.h:104
TfGraphDefProducer
Definition:
TfGraphDefProducer.cc:28
Generated for CMSSW Reference Manual by
1.8.16