CMS 3D CMS Logo

Namespaces | Functions
MakePyBind11ParameterSets.cc File Reference
#include "FWCore/PythonParameterSet/interface/MakePyBind11ParameterSets.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/PythonParameterSet/interface/Python11ParameterSet.h"
#include "FWCore/PythonParameterSet/interface/PyBind11ProcessDesc.h"
#include "initializePyBind11Module.h"
#include <pybind11/embed.h>

Go to the source code of this file.

Namespaces

 edm
 HLT enums.
 
 edm::cmspybind11
 

Functions

void edm::cmspybind11::makeParameterSets (std::string const &configtext, std::unique_ptr< ParameterSet > &main)
 essentially the same as the previous method More...
 
static void makePSetsFromFile (std::string const &fileName)
 
static void makePSetsFromString (std::string const &module)
 
std::unique_ptr< ParameterSetedm::cmspybind11::readConfig (std::string const &config)
 
std::unique_ptr< ParameterSetedm::cmspybind11::readConfig (std::string const &config, int argc, char *argv[])
 same, but with arguments More...
 
std::unique_ptr< ParameterSetedm::cmspybind11::readPSetsFrom (std::string const &fileOrString)
 

Function Documentation

◆ makePSetsFromFile()

static void makePSetsFromFile ( std::string const &  fileName)
static

Definition at line 9 of file MakePyBind11ParameterSets.cc.

9  {
10  std::string initCommand(
11  "from FWCore.ParameterSet.Types import makeCppPSet\n"
12  "exec(open('");
13  initCommand += fileName + "').read())";
14  pybind11::exec(initCommand);
15  pybind11::exec("makeCppPSet(locals(), topPSet)");
16 }

References MillePedeFileConverter_cfg::fileName, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::cmspybind11::readPSetsFrom().

◆ makePSetsFromString()

static void makePSetsFromString ( std::string const &  module)
static

Definition at line 18 of file MakePyBind11ParameterSets.cc.

18  {
19  std::string command = module;
20  command += "\nfrom FWCore.ParameterSet.Types import makeCppPSet\nmakeCppPSet(locals(), topPSet)";
21  pybind11::exec(command);
22 }

References mps_check::command, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::cmspybind11::readPSetsFrom().

MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
mps_check.command
list command
Definition: mps_check.py:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256