9 using namespace boost::python;
15 std::string initCommand(
"from FWCore.ParameterSet.Types import makeCppPSet\n"
17 initCommand += fileName +
"')";
20 handle<>(PyRun_String(initCommand.c_str(),
23 mainNamespace.ptr()));
24 std::string
command(
"makeCppPSet(locals(), topPSet)");
25 handle<>(PyRun_String(command.c_str(),
28 mainNamespace.ptr()));
36 command +=
"\nfrom FWCore.ParameterSet.Types import makeCppPSet\nmakeCppPSet(locals(), topPSet)";
37 handle<>(PyRun_String(command.c_str(),
40 mainNamespace.ptr()));
46 boost::shared_ptr<ProcessDesc>
53 boost::shared_ptr<edm::ProcessDesc>
63 boost::shared_ptr<ParameterSet>&
main,
64 boost::shared_ptr<std::vector<ParameterSet> >& serviceparams)
67 boost::shared_ptr<edm::ProcessDesc> processDesc = pythonProcessDesc.
processDesc();
68 main = processDesc->getProcessPSet();
69 serviceparams = processDesc->getServicesPSets();
72 boost::shared_ptr<ParameterSet>
80 mainNamespace[
"topPSet"] = ptr(&theProcessPSet);
84 if(module.substr(module.size()-3) ==
".py")
93 catch( error_already_set ) {
97 boost::shared_ptr<ParameterSet> returnValue(
new ParameterSet);
98 theProcessPSet.
pset().
swap(*returnValue);
static void makePSetsFromFile(const std::string &fileName, boost::python::object &mainNamespace)
static void makePSetsFromString(const std::string &module, boost::python::object &mainNamespace)
void pythonToCppException(const std::string &iType)
def main
— Main —############################
boost::shared_ptr< ParameterSet > readPSetsFrom(const std::string &fileOrString)
void swap(ParameterSet &other)
edm::ParameterSet & pset()
boost::shared_ptr< edm::ProcessDesc > processDesc()
void makeParameterSets(std::string const &configtext, boost::shared_ptr< ParameterSet > &main, boost::shared_ptr< std::vector< ParameterSet > > &serviceparams)
essentially the same as the previous method
boost::shared_ptr< edm::ProcessDesc > readConfig(const std::string &config)