00001 #ifndef FWCore_PythonParameterSet_PythonModule_h 00002 #define FWCore_PythonParameterSet_PythonModule_h 00003 00004 #include "FWCore/PythonParameterSet/interface/PythonParameterSet.h" 00005 #include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h" 00006 00007 #include "FWCore/Utilities/interface/InputTag.h" 00008 #include "FWCore/Utilities/interface/ESInputTag.h" 00009 #include "DataFormats/Provenance/interface/EventRange.h" 00010 #include "DataFormats/Provenance/interface/LuminosityBlockID.h" 00011 #include "DataFormats/Provenance/interface/LuminosityBlockRange.h" 00012 #include "DataFormats/Provenance/interface/EventID.h" 00013 #include "FWCore/PythonParameterSet/interface/BoostPython.h" 00014 00015 #include <string> 00016 00017 BOOST_PYTHON_MODULE(libFWCoreParameterSet) 00018 { 00019 boost::python::class_<edm::InputTag>("InputTag", boost::python::init<std::string>()) 00020 .def(boost::python::init<std::string, std::string, std::string>()) 00021 .def(boost::python::init<std::string, std::string>()) 00022 .def("label", &edm::InputTag::label, boost::python::return_value_policy<boost::python::copy_const_reference>()) 00023 .def("instance", &edm::InputTag::instance, boost::python::return_value_policy<boost::python::copy_const_reference>()) 00024 .def("process", &edm::InputTag::process, boost::python::return_value_policy<boost::python::copy_const_reference>()) 00025 ; 00026 00027 boost::python::class_<edm::ESInputTag>("ESInputTag", boost::python::init<std::string>()) 00028 .def(boost::python::init<std::string, std::string>()) 00029 .def("module", &edm::ESInputTag::module, boost::python::return_value_policy<boost::python::copy_const_reference>()) 00030 .def("data", &edm::ESInputTag::data, boost::python::return_value_policy<boost::python::copy_const_reference>()) 00031 ; 00032 00033 boost::python::class_<edm::EventID>("EventID", boost::python::init<unsigned int, unsigned int, unsigned int>()) 00034 .def("run", &edm::EventID::run) 00035 .def("luminosityBlock", &edm::EventID::luminosityBlock) 00036 .def("event", &edm::EventID::event) 00037 ; 00038 00039 boost::python::class_<edm::LuminosityBlockID>("LuminosityBlockID", boost::python::init<unsigned int, unsigned int>()) 00040 .def("run", &edm::LuminosityBlockID::run) 00041 .def("luminosityBlock", &edm::LuminosityBlockID::luminosityBlock) 00042 ; 00043 00044 boost::python::class_<edm::FileInPath>("FileInPath", boost::python::init<std::string>()) 00045 .def("fullPath", &edm::FileInPath::fullPath) 00046 .def("relativePath", &edm::FileInPath::relativePath) 00047 .def("isLocal", &edm::FileInPath::isLocal) 00048 ; 00049 00050 boost::python::class_<edm::LuminosityBlockRange>("LuminosityBlockRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int>()) 00051 .def("start", &edm::LuminosityBlockRange::startRun) 00052 .def("startSub", &edm::LuminosityBlockRange::startLumi) 00053 .def("end", &edm::LuminosityBlockRange::endRun) 00054 .def("endSub", &edm::LuminosityBlockRange::endLumi) 00055 ; 00056 00057 boost::python::class_<edm::EventRange>("EventRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int>()) 00058 .def("start", &edm::EventRange::startRun) 00059 .def("startLumi", &edm::EventRange::startLumi) 00060 .def("startSub", &edm::EventRange::startEvent) 00061 .def("end", &edm::EventRange::endRun) 00062 .def("endLumi", &edm::EventRange::endLumi) 00063 .def("endSub", &edm::EventRange::endEvent) 00064 ; 00065 00066 00067 00068 boost::python::class_<PythonParameterSet>("ParameterSet") 00069 .def("addInt32", &PythonParameterSet::addParameter<int>) 00070 .def("getInt32", &PythonParameterSet::getParameter<int>) 00071 .def("addVInt32", &PythonParameterSet::addParameters<int>) 00072 .def("getVInt32", &PythonParameterSet::getParameters<int>) 00073 .def("addUInt32", &PythonParameterSet::addParameter<unsigned int>) 00074 .def("getUInt32", &PythonParameterSet::getParameter<unsigned int>) 00075 .def("addVUInt32", &PythonParameterSet::addParameters<unsigned int>) 00076 .def("getVUInt32", &PythonParameterSet::getParameters<unsigned int>) 00077 .def("addInt64", &PythonParameterSet::addParameter<long long>) 00078 .def("getInt64", &PythonParameterSet::getParameter<long long>) 00079 .def("addUInt64", &PythonParameterSet::addParameter<unsigned long long>) 00080 .def("getUInt64", &PythonParameterSet::getParameter<unsigned long long>) 00081 .def("addVInt64", &PythonParameterSet::addParameters<long long>) 00082 .def("getVInt64", &PythonParameterSet::getParameters<long long>) 00083 .def("addVUInt64", &PythonParameterSet::addParameters<unsigned long long>) 00084 .def("getVUInt64", &PythonParameterSet::getParameters<unsigned long long>) 00085 .def("addDouble", &PythonParameterSet::addParameter<double>) 00086 .def("getDouble", &PythonParameterSet::getParameter<double>) 00087 .def("addVDouble", &PythonParameterSet::addParameters<double>) 00088 .def("getVDouble", &PythonParameterSet::getParameters<double>) 00089 .def("addBool", &PythonParameterSet::addParameter<bool>) 00090 .def("getBool", &PythonParameterSet::getParameter<bool>) 00091 .def("addString", &PythonParameterSet::addParameter<std::string>) 00092 .def("getString", &PythonParameterSet::getParameter<std::string>) 00093 .def("addVString", &PythonParameterSet::addParameters<std::string>) 00094 .def("getVString", &PythonParameterSet::getParameters<std::string>) 00095 .def("addInputTag", &PythonParameterSet::addParameter<edm::InputTag>) 00096 .def("getInputTag", &PythonParameterSet::getParameter<edm::InputTag>) 00097 .def("addVInputTag", &PythonParameterSet::addParameters<edm::InputTag>) 00098 .def("getVInputTag", &PythonParameterSet::getParameters<edm::InputTag>) 00099 .def("addESInputTag", &PythonParameterSet::addParameter<edm::ESInputTag>) 00100 .def("getESInputTag", &PythonParameterSet::getParameter<edm::ESInputTag>) 00101 .def("addVESInputTag", &PythonParameterSet::addParameters<edm::ESInputTag>) 00102 .def("getVESInputTag", &PythonParameterSet::getParameters<edm::ESInputTag>) 00103 .def("addEventID", &PythonParameterSet::addParameter<edm::EventID>) 00104 .def("getEventID", &PythonParameterSet::getParameter<edm::EventID>) 00105 .def("addVEventID", &PythonParameterSet::addParameters<edm::EventID>) 00106 .def("getVEventID", &PythonParameterSet::getParameters<edm::EventID>) 00107 .def("addLuminosityBlockID", &PythonParameterSet::addParameter<edm::LuminosityBlockID>) 00108 .def("getLuminosityBlockID", &PythonParameterSet::getParameter<edm::LuminosityBlockID>) 00109 .def("addVLuminosityBlockID", &PythonParameterSet::addParameters<edm::LuminosityBlockID>) 00110 .def("getVLuminosityBlockID", &PythonParameterSet::getParameters<edm::LuminosityBlockID>) 00111 .def("addLuminosityBlockRange", &PythonParameterSet::addParameter<edm::LuminosityBlockRange>) 00112 .def("getLuminosityBlockRange", &PythonParameterSet::getParameter<edm::LuminosityBlockRange>) 00113 .def("addVLuminosityBlockRange", &PythonParameterSet::addParameters<edm::LuminosityBlockRange>) 00114 .def("getVLuminosityBlockRange", &PythonParameterSet::getParameters<edm::LuminosityBlockRange>) 00115 .def("addEventRange", &PythonParameterSet::addParameter<edm::EventRange>) 00116 .def("getEventRange", &PythonParameterSet::getParameter<edm::EventRange>) 00117 .def("addVEventRange", &PythonParameterSet::addParameters<edm::EventRange>) 00118 .def("getVEventRange", &PythonParameterSet::getParameters<edm::EventRange>) 00119 .def("addPSet", &PythonParameterSet::addPSet) 00120 .def("getPSet", &PythonParameterSet::getPSet) 00121 .def("addVPSet", &PythonParameterSet::addVPSet) 00122 .def("getVPSet", &PythonParameterSet::getVPSet) 00123 .def("addFileInPath", &PythonParameterSet::addParameter<edm::FileInPath>) 00124 .def("getFileInPath", &PythonParameterSet::getParameter<edm::FileInPath>) 00125 .def("newInputTag", &PythonParameterSet::newInputTag) 00126 .def("newESInputTag", &PythonParameterSet::newESInputTag) 00127 .def("newEventID", &PythonParameterSet::newEventID) 00128 .def("newLuminosityBlockID", &PythonParameterSet::newLuminosityBlockID) 00129 .def("newLuminosityBlockRange", &PythonParameterSet::newLuminosityBlockRange) 00130 .def("newEventRange", &PythonParameterSet::newEventRange) 00131 .def("addNewFileInPath", &PythonParameterSet::addNewFileInPath) 00132 .def("newPSet", &PythonParameterSet::newPSet) 00133 .def("dump", &PythonParameterSet::dump) 00134 ; 00135 00136 00137 boost::python::class_<PythonProcessDesc>("ProcessDesc", boost::python::init<>()) 00138 .def(boost::python::init<std::string>()) 00139 .def("addService", &PythonProcessDesc::addService) 00140 .def("newPSet", &PythonProcessDesc::newPSet) 00141 .def("dump", &PythonProcessDesc::dump) 00142 ; 00143 00144 } 00145 #endif