Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:00

0001 #include "FWCore/PythonParameterSet/interface/Python11ParameterSet.h"
0002 #include "FWCore/Utilities/interface/FileInPath.h"
0003 
0004 Python11ParameterSet::Python11ParameterSet() : theParameterSet() {}
0005 
0006 void Python11ParameterSet::addVPSet(bool tracked, std::string const& name, pybind11::list value) {
0007   std::vector<Python11ParameterSet> v = edm::toVector<Python11ParameterSet>(value);
0008   std::vector<edm::ParameterSet> v2;
0009   v2.reserve(v.size());
0010   for (std::vector<Python11ParameterSet>::iterator ppsetItr = v.begin(), ppsetItrEnd = v.end(); ppsetItr != ppsetItrEnd;
0011        ++ppsetItr) {
0012     v2.push_back(ppsetItr->theParameterSet);
0013   }
0014   addParameter(tracked, name, v2);
0015 }
0016 
0017 pybind11::list Python11ParameterSet::getVPSet(bool tracked, std::string const& name) {
0018   std::vector<edm::ParameterSet> const& v =
0019       (tracked ? theParameterSet.getParameterSetVector(name) : theParameterSet.getUntrackedParameterSetVector(name));
0020 
0021   // convert to Python11ParameterSets
0022   pybind11::list l;
0023   for (std::vector<edm::ParameterSet>::const_iterator psetItr = v.begin(), psetItrEnd = v.end(); psetItr != psetItrEnd;
0024        ++psetItr) {
0025     l.append(Python11ParameterSet(*psetItr));
0026   }
0027 
0028   return l;
0029 }
0030 
0031 void Python11ParameterSet::addNewFileInPath(bool tracked, std::string const& name, std::string const& value) {
0032   addParameter(tracked, name, edm::FileInPath(value));
0033 }