CMS 3D CMS Logo

PyBind11Wrapper.h
Go to the documentation of this file.
1 #ifndef FWCore_PyBind11ParameterSet_PyBind11Wrapper_h
2 #define FWCore_PyBind11ParameterSet_PyBind11Wrapper_h
3 
4 #include <vector>
5 #include <string>
6 #include <pybind11/pybind11.h>
7 #include <pybind11/stl.h>
8 #include <iostream>
9 
10 namespace edm {
11  void pythonToCppException(const std::string& iType, const std::string& error);
12 
13  // utility to translate from an STL vector of strings to
14  // a Python list
15 
16  template <typename T>
17  pybind11::list toPython11List(const std::vector<T>& v) {
18  pybind11::list result = pybind11::cast(v);
19  return result;
20  }
21 
22  // and back. Destroys the input via pop()s - well probably not
23  template <typename T>
24  std::vector<T> toVector(pybind11::list& l) {
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  }
32 } // namespace edm
33 
34 #endif
edm::toPython11List
pybind11::list toPython11List(const std::vector< T > &v)
Definition: PyBind11Wrapper.h:17
mps_fire.i
i
Definition: mps_fire.py:355
edm::pythonToCppException
void pythonToCppException(const std::string &iType, const std::string &error)
Definition: PyBind11Wrapper.cc:6
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::toVector
std::vector< T > toVector(pybind11::list &l)
Definition: PyBind11Wrapper.h:24
findQualityFiles.v
v
Definition: findQualityFiles.py:179
relativeConstraints.error
error
Definition: relativeConstraints.py:53
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
mps_fire.result
result
Definition: mps_fire.py:303
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run