1 #ifndef FWCore_PythonParameterSet_PyBind11Module_h
2 #define FWCore_PythonParameterSet_PyBind11Module_h
15 #include <pybind11/stl.h>
33 #include <pybind11/pybind11.h>
36 pybind11::register_exception_translator([](std::exception_ptr
p) {
39 std::rethrow_exception(p);
41 PyErr_SetString(PyExc_RuntimeError, e.
what());
45 pybind11::class_<edm::InputTag>(
m,
"InputTag")
46 .
def(pybind11::init<>())
47 .
def(pybind11::init<const std::string &>())
48 .
def(pybind11::init<const std::string &, const std::string &, const std::string &>())
49 .
def(pybind11::init<const std::string &, const std::string &>())
54 pybind11::class_<edm::ESInputTag>(
m,
"ESInputTag")
55 .
def(pybind11::init<std::string>())
56 .
def(pybind11::init<std::string, std::string>())
60 pybind11::class_<edm::EventID>(
m,
"EventID")
61 .
def(pybind11::init<edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t>())
66 pybind11::class_<edm::LuminosityBlockID>(
m,
"LuminosityBlockID")
67 .
def(pybind11::init<unsigned int, unsigned int>())
71 pybind11::class_<edm::FileInPath>(
m,
"FileInPath")
72 .
def(pybind11::init<std::string>())
76 pybind11::class_<edm::LuminosityBlockRange>(
m,
"LuminosityBlockRange")
77 .
def(pybind11::init<unsigned int, unsigned int, unsigned int, unsigned int>())
83 pybind11::class_<edm::EventRange>(
m,
"EventRange")
97 pybind11::class_<Python11ParameterSet>(
m,
"ParameterSet")
98 .
def(pybind11::init<>())
99 .
def(
"addInt32", &Python11ParameterSet::addParameter<int>)
100 .def(
"getInt32", &Python11ParameterSet::getParameter<int>)
101 .def(
"addVInt32", &Python11ParameterSet::addParameters<int>)
102 .def(
"getVInt32", &Python11ParameterSet::getParameters<int>)
103 .def(
"addUInt32", &Python11ParameterSet::addParameter<unsigned int>)
104 .def(
"getUInt32", &Python11ParameterSet::getParameter<unsigned int>)
105 .def(
"addVUInt32", &Python11ParameterSet::addParameters<unsigned int>)
106 .def(
"getVUInt32", &Python11ParameterSet::getParameters<unsigned int>)
107 .def(
"addInt64", &Python11ParameterSet::addParameter<long long>)
108 .def(
"getInt64", &Python11ParameterSet::getParameter<long long>)
109 .def(
"addUInt64", &Python11ParameterSet::addParameter<unsigned long long>)
110 .def(
"getUInt64", &Python11ParameterSet::getParameter<unsigned long long>)
111 .def(
"addVInt64", &Python11ParameterSet::addParameters<long long>)
112 .def(
"getVInt64", &Python11ParameterSet::getParameters<long long>)
113 .def(
"addVUInt64", &Python11ParameterSet::addParameters<unsigned long long>)
114 .def(
"getVUInt64", &Python11ParameterSet::getParameters<unsigned long long>)
115 .def(
"addDouble", &Python11ParameterSet::addParameter<double>)
116 .def(
"getDouble", &Python11ParameterSet::getParameter<double>)
117 .def(
"addVDouble", &Python11ParameterSet::addParameters<double>)
118 .def(
"getVDouble", &Python11ParameterSet::getParameters<double>)
119 .def(
"addBool", &Python11ParameterSet::addParameter<bool>)
120 .def(
"getBool", &Python11ParameterSet::getParameter<bool>)
121 .def(
"addString", &Python11ParameterSet::addParameter<std::string>)
122 .def(
"getString", &Python11ParameterSet::getParameter<std::string>)
123 .def(
"addVString", &Python11ParameterSet::addParameters<std::string>)
124 .def(
"getVString", &Python11ParameterSet::getParameters<std::string>)
125 .def(
"addInputTag", &Python11ParameterSet::addParameter<edm::InputTag>)
126 .def(
"getInputTag", &Python11ParameterSet::getParameter<edm::InputTag>)
127 .def(
"addVInputTag", &Python11ParameterSet::addParameters<edm::InputTag>)
128 .def(
"getVInputTag", &Python11ParameterSet::getParameters<edm::InputTag>)
129 .def(
"addESInputTag", &Python11ParameterSet::addParameter<edm::ESInputTag>)
130 .def(
"getESInputTag", &Python11ParameterSet::getParameter<edm::ESInputTag>)
131 .def(
"addVESInputTag", &Python11ParameterSet::addParameters<edm::ESInputTag>)
132 .def(
"getVESInputTag", &Python11ParameterSet::getParameters<edm::ESInputTag>)
133 .def(
"addEventID", &Python11ParameterSet::addParameter<edm::EventID>)
134 .def(
"getEventID", &Python11ParameterSet::getParameter<edm::EventID>)
135 .def(
"addVEventID", &Python11ParameterSet::addParameters<edm::EventID>)
136 .def(
"getVEventID", &Python11ParameterSet::getParameters<edm::EventID>)
137 .def(
"addLuminosityBlockID", &Python11ParameterSet::addParameter<edm::LuminosityBlockID>)
138 .def(
"getLuminosityBlockID", &Python11ParameterSet::getParameter<edm::LuminosityBlockID>)
139 .def(
"addVLuminosityBlockID", &Python11ParameterSet::addParameters<edm::LuminosityBlockID>)
140 .def(
"getVLuminosityBlockID", &Python11ParameterSet::getParameters<edm::LuminosityBlockID>)
141 .def(
"addLuminosityBlockRange", &Python11ParameterSet::addParameter<edm::LuminosityBlockRange>)
142 .def(
"getLuminosityBlockRange", &Python11ParameterSet::getParameter<edm::LuminosityBlockRange>)
143 .def(
"addVLuminosityBlockRange", &Python11ParameterSet::addParameters<edm::LuminosityBlockRange>)
144 .def(
"getVLuminosityBlockRange", &Python11ParameterSet::getParameters<edm::LuminosityBlockRange>)
145 .def(
"addEventRange", &Python11ParameterSet::addParameter<edm::EventRange>)
146 .def(
"getEventRange", &Python11ParameterSet::getParameter<edm::EventRange>)
147 .def(
"addVEventRange", &Python11ParameterSet::addParameters<edm::EventRange>)
148 .def(
"getVEventRange", &Python11ParameterSet::getParameters<edm::EventRange>)
153 .def(
"addFileInPath", &Python11ParameterSet::addParameter<edm::FileInPath>)
154 .def(
"getFileInPath", &Python11ParameterSet::getParameter<edm::FileInPath>)
165 pybind11::class_<PyBind11ProcessDesc>(
m,
"ProcessDesc")
166 .
def(pybind11::init<>())
167 .
def(pybind11::init<std::string>())
edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi)
EventNumber_t event() const
int def(FILE *, FILE *, int)
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
edm::ESInputTag newESInputTag(std::string const &module, std::string const &data)
unsigned long long EventNumber_t
pybind11::list getVPSet(bool tracked, std::string const &name)
RunNumber_t startRun() const
Python11ParameterSet newPSet() const
LuminosityBlockNumber_t luminosityBlock() const
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t startLumi() const
RunNumber_t endRun() const
EventNumber_t endEvent() const
void addPSet(bool tracked, std::string const &name, Python11ParameterSet const &ppset)
char const * what() const noexceptoverride
Python11ParameterSet & pset()
RunNumber_t startRun() const
PYBIND11_MODULE(pluginTrackerAlignment_PayloadInspector, m)
LuminosityBlockNumber_t endLumi() const
edm::EventRange newEventRange(edm::RunNumber_t start, edm::LuminosityBlockNumber_t startLumi, edm::EventNumber_t startSub, edm::RunNumber_t end, edm::LuminosityBlockNumber_t endLumi, edm::EventNumber_t endSub)
EventNumber_t startEvent() const
LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockNumber_t startLumi() const
edm::EventID newEventID(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
std::string fullPath() const
RunNumber_t endRun() const
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
void addVPSet(bool tracked, std::string const &name, pybind11::list value)
LuminosityBlockNumber_t endLumi() const
std::string relativePath() const
Python11ParameterSet getPSet(bool tracked, std::string const &name) const
Python11ParameterSet newPSet() const