CMS 3D CMS Logo

Classes | Functions
cmspython3 Namespace Reference

Classes

class  PyBind11ProcessDesc
 
class  Python11ParameterSet
 

Functions

void pythonToCppException (const std::string &iType, const std::string &error)
 
template<typename T >
pybind11::list toPython11List (const std::vector< T > &v)
 
template<typename T >
std::vector< TtoVector (pybind11::list &l)
 

Function Documentation

◆ pythonToCppException()

void cmspython3::pythonToCppException ( const std::string &  iType,
const std::string &  error 
)

Definition at line 6 of file PyBind11Wrapper.cc.

6  {
7  throw cms::Exception(iType) << " unknown python problem occurred.\n" << error << std::endl;
8  }

References relativeConstraints::error, and Exception.

Referenced by cmspython3::PyBind11ProcessDesc::read(), and edm::cmspybind11_p3::readPSetsFrom().

◆ toPython11List()

template<typename T >
pybind11::list cmspython3::toPython11List ( const std::vector< T > &  v)

Definition at line 17 of file PyBind11Wrapper.h.

17  {
18  pybind11::list result = pybind11::cast(v);
19  return result;
20  }

References mps_fire::result, and findQualityFiles::v.

Referenced by cmspython3::Python11ParameterSet::getParameters().

◆ toVector()

template<typename T >
std::vector<T> cmspython3::toVector ( pybind11::list &  l)

Definition at line 24 of file PyBind11Wrapper.h.

24  {
25  std::vector<T> result;
26  result.reserve(l.size());
27  for (unsigned i = 0; i < l.size(); ++i) {
28  result.push_back(l[i].cast<T>());
29  }
30  return result;
31  }

References mps_fire::i, cmsLHEtoEOSManager::l, and mps_fire::result.

mps_fire.i
i
Definition: mps_fire.py:428
findQualityFiles.v
v
Definition: findQualityFiles.py:179
relativeConstraints.error
error
Definition: relativeConstraints.py:53
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
Exception
Definition: hltDiff.cc:245
mps_fire.result
result
Definition: mps_fire.py:311