CMS 3D CMS Logo

PythonEventProcessor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Subsystem/Package
4 // Class : PythonEventProcessor
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: root
10 // Created: Fri, 20 Jan 2017 16:36:41 GMT
11 //
12 
13 // system include files
14 #include <mutex>
15 
16 // user include files
19 
22 
25 
27 
30 
31 namespace {
32  std::once_flag pluginFlag;
33  int setupPluginSystem() {
34  std::call_once(pluginFlag, []() { edmplugin::PluginManager::configure(edmplugin::standard::config()); });
35  return 0;
36  }
37 
38  std::shared_ptr<edm::ProcessDesc> addDefaultServicesToProcessDesc(std::shared_ptr<edm::ProcessDesc> iDesc) {
39  iDesc->addServices(edm::defaultCmsRunServices());
40  return iDesc;
41  }
42 
43  edm::ServiceToken createJobReport() {
46  std::make_unique<edm::JobReport>(nullptr)));
47  }
48 } // namespace
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62  : forcePluginSetupFirst_(setupPluginSystem()),
63  processor_(addDefaultServicesToProcessDesc(iDesc.processDesc()),
64  createJobReport(),
65  edm::serviceregistry::kOverlapIsError) {}
66 
68  auto gil = PyEval_SaveThread();
69  try {
71  } catch (...) {
72  }
73  PyEval_RestoreThread(gil);
74 }
75 
77  auto gil = PyEval_SaveThread();
78  try {
80  } catch (...) {
81  }
82  PyEval_RestoreThread(gil);
83 }
std::vector< std::string > defaultCmsRunServices()
static PluginManager & configure(const Config &)
edm::EventProcessor processor_
PythonEventProcessor(PyBind11ProcessDesc const &)
PluginManager::Config config()
Definition: standard.cc:21
StatusCode runToCompletion()
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
HLT enums.