CMS 3D CMS Logo

Functions
PyBind11Module.h File Reference
#include "FWCore/PyDevParameterSet/interface/Python11ParameterSet.h"
#include "FWCore/PyDevParameterSet/interface/PyBind11ProcessDesc.h"
#include "DataFormats/Provenance/interface/EventRange.h"
#include "DataFormats/Provenance/interface/LuminosityBlockID.h"
#include "DataFormats/Provenance/interface/LuminosityBlockRange.h"
#include "DataFormats/Provenance/interface/EventID.h"
#include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
#include "FWCore/Utilities/interface/ESInputTag.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include <pybind11/stl.h>
#include <string>
#include <pybind11/pybind11.h>

Go to the source code of this file.

Functions

 PYBIND11_MODULE (libFWCorePyDevParameterSet, m)
 

Function Documentation

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( libFWCorePyDevParameterSet  ,
 
)

Definition at line 37 of file PyBind11Module.h.

37  {
38  pybind11::register_exception_translator([](std::exception_ptr p) {
39  try {
40  if (p)
41  std::rethrow_exception(p);
42  } catch (const cms::Exception &e) {
43  PyErr_SetString(PyExc_RuntimeError, e.what());
44  }
45  });
46 
47  pybind11::class_<edm::InputTag>(m, "InputTag")
48  .def(pybind11::init<>())
49  .def(pybind11::init<const std::string &>())
50  .def(pybind11::init<const std::string &, const std::string &, const std::string &>())
51  .def(pybind11::init<const std::string &, const std::string &>())
55 
56  pybind11::class_<edm::ESInputTag>(m, "ESInputTag")
57  .def(pybind11::init<std::string>())
58  .def(pybind11::init<std::string, std::string>())
61 
62  pybind11::class_<edm::EventID>(m, "EventID")
63  .def(pybind11::init<edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t>())
64  .def("run", &edm::EventID::run)
65  .def("luminosityBlock", &edm::EventID::luminosityBlock)
66  .def("event", &edm::EventID::event);
67 
68  pybind11::class_<edm::LuminosityBlockID>(m, "LuminosityBlockID")
69  .def(pybind11::init<unsigned int, unsigned int>())
70  .def("run", &edm::LuminosityBlockID::run)
71  .def("luminosityBlock", &edm::LuminosityBlockID::luminosityBlock);
72 
73  pybind11::class_<edm::FileInPath>(m, "FileInPath")
74  .def(pybind11::init<std::string>())
75  .def("fullPath", &edm::FileInPath::fullPath)
76  .def("relativePath", &edm::FileInPath::relativePath);
77 
78  pybind11::class_<edm::LuminosityBlockRange>(m, "LuminosityBlockRange")
79  .def(pybind11::init<unsigned int, unsigned int, unsigned int, unsigned int>())
81  .def("startSub", &edm::LuminosityBlockRange::startLumi)
83  .def("endSub", &edm::LuminosityBlockRange::endLumi);
84 
85  pybind11::class_<edm::EventRange>(m, "EventRange")
92  .def("start", &edm::EventRange::startRun)
93  .def("startLumi", &edm::EventRange::startLumi)
94  .def("startSub", &edm::EventRange::startEvent)
95  .def("end", &edm::EventRange::endRun)
96  .def("endLumi", &edm::EventRange::endLumi)
97  .def("endSub", &edm::EventRange::endEvent);
98 
99  pybind11::class_<Python11ParameterSet>(m, "ParameterSet")
100  .def(pybind11::init<>())
101  .def("addInt32", &Python11ParameterSet::addParameter<int>)
102  .def("getInt32", &Python11ParameterSet::getParameter<int>)
103  .def("addVInt32", &Python11ParameterSet::addParameters<int>)
104  .def("getVInt32", &Python11ParameterSet::getParameters<int>)
105  .def("addUInt32", &Python11ParameterSet::addParameter<unsigned int>)
106  .def("getUInt32", &Python11ParameterSet::getParameter<unsigned int>)
107  .def("addVUInt32", &Python11ParameterSet::addParameters<unsigned int>)
108  .def("getVUInt32", &Python11ParameterSet::getParameters<unsigned int>)
109  .def("addInt64", &Python11ParameterSet::addParameter<long long>)
110  .def("getInt64", &Python11ParameterSet::getParameter<long long>)
111  .def("addUInt64", &Python11ParameterSet::addParameter<unsigned long long>)
112  .def("getUInt64", &Python11ParameterSet::getParameter<unsigned long long>)
113  .def("addVInt64", &Python11ParameterSet::addParameters<long long>)
114  .def("getVInt64", &Python11ParameterSet::getParameters<long long>)
115  .def("addVUInt64", &Python11ParameterSet::addParameters<unsigned long long>)
116  .def("getVUInt64", &Python11ParameterSet::getParameters<unsigned long long>)
117  .def("addDouble", &Python11ParameterSet::addParameter<double>)
118  .def("getDouble", &Python11ParameterSet::getParameter<double>)
119  .def("addVDouble", &Python11ParameterSet::addParameters<double>)
120  .def("getVDouble", &Python11ParameterSet::getParameters<double>)
121  .def("addBool", &Python11ParameterSet::addParameter<bool>)
122  .def("getBool", &Python11ParameterSet::getParameter<bool>)
123  .def("addString", &Python11ParameterSet::addParameter<std::string>)
124  .def("getString", &Python11ParameterSet::getParameter<std::string>)
125  .def("addVString", &Python11ParameterSet::addParameters<std::string>)
126  .def("getVString", &Python11ParameterSet::getParameters<std::string>)
127  .def("addInputTag", &Python11ParameterSet::addParameter<edm::InputTag>)
128  .def("getInputTag", &Python11ParameterSet::getParameter<edm::InputTag>)
129  .def("addVInputTag", &Python11ParameterSet::addParameters<edm::InputTag>)
130  .def("getVInputTag", &Python11ParameterSet::getParameters<edm::InputTag>)
131  .def("addESInputTag", &Python11ParameterSet::addParameter<edm::ESInputTag>)
132  .def("getESInputTag", &Python11ParameterSet::getParameter<edm::ESInputTag>)
133  .def("addVESInputTag", &Python11ParameterSet::addParameters<edm::ESInputTag>)
134  .def("getVESInputTag", &Python11ParameterSet::getParameters<edm::ESInputTag>)
135  .def("addEventID", &Python11ParameterSet::addParameter<edm::EventID>)
136  .def("getEventID", &Python11ParameterSet::getParameter<edm::EventID>)
137  .def("addVEventID", &Python11ParameterSet::addParameters<edm::EventID>)
138  .def("getVEventID", &Python11ParameterSet::getParameters<edm::EventID>)
139  .def("addLuminosityBlockID", &Python11ParameterSet::addParameter<edm::LuminosityBlockID>)
140  .def("getLuminosityBlockID", &Python11ParameterSet::getParameter<edm::LuminosityBlockID>)
141  .def("addVLuminosityBlockID", &Python11ParameterSet::addParameters<edm::LuminosityBlockID>)
142  .def("getVLuminosityBlockID", &Python11ParameterSet::getParameters<edm::LuminosityBlockID>)
143  .def("addLuminosityBlockRange", &Python11ParameterSet::addParameter<edm::LuminosityBlockRange>)
144  .def("getLuminosityBlockRange", &Python11ParameterSet::getParameter<edm::LuminosityBlockRange>)
145  .def("addVLuminosityBlockRange", &Python11ParameterSet::addParameters<edm::LuminosityBlockRange>)
146  .def("getVLuminosityBlockRange", &Python11ParameterSet::getParameters<edm::LuminosityBlockRange>)
147  .def("addEventRange", &Python11ParameterSet::addParameter<edm::EventRange>)
148  .def("getEventRange", &Python11ParameterSet::getParameter<edm::EventRange>)
149  .def("addVEventRange", &Python11ParameterSet::addParameters<edm::EventRange>)
150  .def("getVEventRange", &Python11ParameterSet::getParameters<edm::EventRange>)
151  .def("addPSet", &Python11ParameterSet::addPSet)
152  .def("getPSet", &Python11ParameterSet::getPSet)
153  .def("addVPSet", &Python11ParameterSet::addVPSet)
154  .def("getVPSet", &Python11ParameterSet::getVPSet)
155  .def("addFileInPath", &Python11ParameterSet::addParameter<edm::FileInPath>)
156  .def("getFileInPath", &Python11ParameterSet::getParameter<edm::FileInPath>)
157  .def("newInputTag", &Python11ParameterSet::newInputTag)
158  .def("newESInputTag", &Python11ParameterSet::newESInputTag)
159  .def("newEventID", &Python11ParameterSet::newEventID)
160  .def("newLuminosityBlockID", &Python11ParameterSet::newLuminosityBlockID)
161  .def("newLuminosityBlockRange", &Python11ParameterSet::newLuminosityBlockRange)
162  .def("newEventRange", &Python11ParameterSet::newEventRange)
163  .def("addNewFileInPath", &Python11ParameterSet::addNewFileInPath)
164  .def("newPSet", &Python11ParameterSet::newPSet)
165  .def("dump", &Python11ParameterSet::dump);
166 
167  pybind11::class_<PyBind11ProcessDesc>(m, "ProcessDesc") //, pybind11::init<>())
168  .def(pybind11::init<>())
169  .def(pybind11::init<std::string>())
170  .def("newPSet", &PyBind11ProcessDesc::newPSet)
172  .def("dump", &PyBind11ProcessDesc::dump);
173 }

References cmspython3::Python11ParameterSet::addNewFileInPath(), cmspython3::Python11ParameterSet::addPSet(), cmspython3::Python11ParameterSet::addVPSet(), filterCSVwithJSON::copy, edm::ESInputTag::data(), cmspython3::PyBind11ProcessDesc::dump(), cmspython3::Python11ParameterSet::dump(), MillePedeFileConverter_cfg::e, edm::EventRange::endEvent(), edm::LuminosityBlockRange::endLumi(), edm::EventRange::endLumi(), edm::LuminosityBlockRange::endRun(), edm::EventRange::endRun(), edm::EventID::event(), edm::FileInPath::fullPath(), cmspython3::Python11ParameterSet::getPSet(), cmspython3::Python11ParameterSet::getVPSet(), init, edm::InputTag::instance(), edm::InputTag::label(), edm::EventID::luminosityBlock(), edm::LuminosityBlockID::luminosityBlock(), visualization-live-secondInstance_cfg::m, edm::ESInputTag::module(), cmspython3::Python11ParameterSet::newESInputTag(), cmspython3::Python11ParameterSet::newEventID(), cmspython3::Python11ParameterSet::newEventRange(), cmspython3::Python11ParameterSet::newInputTag(), cmspython3::Python11ParameterSet::newLuminosityBlockID(), cmspython3::Python11ParameterSet::newLuminosityBlockRange(), cmspython3::PyBind11ProcessDesc::newPSet(), cmspython3::Python11ParameterSet::newPSet(), AlCaHLTBitMon_ParallelJobs::p, edm::InputTag::process(), cmspython3::PyBind11ProcessDesc::pset(), RecoTauValidation_cfi::reference, edm::FileInPath::relativePath(), edm::EventID::run(), edm::LuminosityBlockID::run(), edm::EventRange::startEvent(), edm::LuminosityBlockRange::startLumi(), edm::EventRange::startLumi(), edm::LuminosityBlockRange::startRun(), and edm::EventRange::startRun().

edm::EventRange::startEvent
EventNumber_t startEvent() const
Definition: EventRange.h:52
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
Python11ParameterSet::newInputTag
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
Definition: Python11ParameterSet.h:75
init
int init
Definition: HydjetWrapper.h:64
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ESInputTag::data
const std::string & data() const
Definition: ESInputTag.h:104
Python11ParameterSet::getVPSet
pybind11::list getVPSet(bool tracked, std::string const &name)
Definition: Python11ParameterSet.cc:17
edm::InputTag::process
std::string const & process() const
Definition: InputTag.h:40
edm::LuminosityBlockRange::endRun
RunNumber_t endRun() const
Definition: LuminosityBlockRange.h:49
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
Python11ParameterSet::newLuminosityBlockID
edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi)
Definition: Python11ParameterSet.h:87
edm::EventRange::startRun
RunNumber_t startRun() const
Definition: EventRange.h:48
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
Python11ParameterSet::getPSet
Python11ParameterSet getPSet(bool tracked, std::string const &name) const
Definition: Python11ParameterSet.h:66
Python11ParameterSet::dump
std::string dump() const
Definition: Python11ParameterSet.h:115
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::LuminosityBlockRange::startLumi
LuminosityBlockNumber_t startLumi() const
Definition: LuminosityBlockRange.h:50
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
PyBind11ProcessDesc::pset
Python11ParameterSet & pset()
Definition: PyBind11ProcessDesc.h:34
edm::EventRange::startLumi
LuminosityBlockNumber_t startLumi() const
Definition: EventRange.h:50
Python11ParameterSet::newEventRange
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)
Definition: Python11ParameterSet.h:98
edm::LuminosityBlockRange::endLumi
LuminosityBlockNumber_t endLumi() const
Definition: LuminosityBlockRange.h:51
Python11ParameterSet::newPSet
Python11ParameterSet newPSet() const
Definition: Python11ParameterSet.h:109
edm::EventRange::endRun
RunNumber_t endRun() const
Definition: EventRange.h:49
RecoTauValidation_cfi.reference
reference
Definition: RecoTauValidation_cfi.py:234
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
edm::LuminosityBlockID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockID.h:42
Python11ParameterSet::addVPSet
void addVPSet(bool tracked, std::string const &name, pybind11::list value)
Definition: Python11ParameterSet.cc:6
PyBind11ProcessDesc::dump
std::string dump() const
Definition: PyBind11ProcessDesc.cc:96
edm::EventRange::endLumi
LuminosityBlockNumber_t endLumi() const
Definition: EventRange.h:51
Python11ParameterSet::addPSet
void addPSet(bool tracked, std::string const &name, Python11ParameterSet const &ppset)
Definition: Python11ParameterSet.h:62
edm::ESInputTag::module
const std::string & module() const
Definition: ESInputTag.h:99
edm::EventRange::endEvent
EventNumber_t endEvent() const
Definition: EventRange.h:53
Python11ParameterSet::newESInputTag
edm::ESInputTag newESInputTag(std::string const &module, std::string const &data)
Definition: Python11ParameterSet.h:79
edm::LuminosityBlockID::run
RunNumber_t run() const
Definition: LuminosityBlockID.h:41
edm::FileInPath::relativePath
std::string relativePath() const
Definition: FileInPath.cc:157
edm::LuminosityBlockRange::startRun
RunNumber_t startRun() const
Definition: LuminosityBlockRange.h:48
cms::Exception
Definition: Exception.h:70
Python11ParameterSet::newLuminosityBlockRange
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
Definition: Python11ParameterSet.h:91
Python11ParameterSet::newEventID
edm::EventID newEventID(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
Definition: Python11ParameterSet.h:83
Python11ParameterSet::addNewFileInPath
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
Definition: Python11ParameterSet.cc:31
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161
PyBind11ProcessDesc::newPSet
Python11ParameterSet newPSet() const
Definition: PyBind11ProcessDesc.h:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37