CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PythonWrapper.h
Go to the documentation of this file.
1 #ifndef FWCore_PythonParameterSet_PythonWrapper_h
2 #define FWCore_PythonParameterSet_PythonWrapper_h
3 
4 #include <vector>
5 #include <string>
7 
8 namespace edm {
9 void
10 pythonToCppException(const std::string& iType);
11 
12 // boost::python::list toPythonList(const std::vector<std::string> & v);
13  // utility to translate from an STL vector of strings to
14  // a Python list
15  template<typename T>
16  boost::python::list toPythonList(const std::vector<T> & v) {
18  for(unsigned i = 0; i < v.size(); ++i) {
19  result.append(v[i]);
20  }
21  return result;
22  }
23 
24 
25 
26  // and back. Destroys the input via pop()s
27  template<typename T>
28  std::vector<T> toVector(boost::python::list & l)
29  {
30  std::vector<T> result;
31  unsigned n = PyList_Size(l.ptr());
32  boost::python::object iter_obj(boost::python::handle<>(PyObject_GetIter(l.ptr())));
33  for(unsigned i = 0; i < n; ++i)
34  {
35  boost::python::object obj = boost::python::extract<boost::python::object>(iter_obj.attr("next")());
36  result.push_back(boost::python::extract<T>(obj));
37  }
38  return result;
39  }
40 }
41 
42 #endif
int i
Definition: DBlmapReader.cc:9
void pythonToCppException(const std::string &iType)
Definition: PythonWrapper.cc:6
tuple result
Definition: mps_fire.py:95
boost::python::list toPythonList(const std::vector< T > &v)
Definition: PythonWrapper.h:16
std::vector< T > toVector(boost::python::list &l)
Definition: PythonWrapper.h:28
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