CMS 3D CMS Logo

Macros | Functions
PythonModule.cc File Reference
#include "FWCore/PythonParameterSet/interface/PyBind11ProcessDesc.h"
#include "FWCore/PythonFramework/interface/PythonEventProcessor.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <pybind11/pybind11.h>

Go to the source code of this file.

Macros

#define FWCore_PythonFramework_PythonModule_h
 

Functions

 PYBIND11_MODULE (libFWCorePythonFramework, m)
 

Macro Definition Documentation

◆ FWCore_PythonFramework_PythonModule_h

#define FWCore_PythonFramework_PythonModule_h

Definition at line 2 of file PythonModule.cc.

Function Documentation

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( libFWCorePythonFramework  ,
 
)

Definition at line 21 of file PythonModule.cc.

References spu::def(), MillePedeFileConverter_cfg::e, visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, PythonEventProcessor::run(), PythonEventProcessor::totalEvents(), PythonEventProcessor::totalEventsFailed(), and PythonEventProcessor::totalEventsPassed().

21  {
22  pybind11::register_exception_translator([](std::exception_ptr p) {
23  try {
24  if (p)
25  std::rethrow_exception(p);
26  } catch (const cms::Exception &e) {
27  PyErr_SetString(PyExc_RuntimeError, e.what());
28  }
29  });
30 
31  pybind11::class_<PythonEventProcessor>(m, "PythonEventProcessor")
32  .def(pybind11::init<PyBind11ProcessDesc const &>())
34  .def("totalEvents", &PythonEventProcessor::totalEvents)
35  .def("totalEventsPassed", &PythonEventProcessor::totalEventsPassed)
36  .def("totalEventsFailed", &PythonEventProcessor::totalEventsFailed);
37 }
int def(FILE *, FILE *, int)