00001 #ifndef FWCore_PythonParameterSet_PythonModule_h 00002 #define FWCore_PythonParameterSet_PythonModule_h 00003 00004 #include "FWCore/PythonParameterSet/interface/BoostPython.h" 00005 #include "FWCore/PythonParameterSet/interface/PythonParameterSet.h" 00006 #include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h" 00007 00008 #include "DataFormats/Provenance/interface/EventRange.h" 00009 #include "DataFormats/Provenance/interface/LuminosityBlockID.h" 00010 #include "DataFormats/Provenance/interface/LuminosityBlockRange.h" 00011 #include "DataFormats/Provenance/interface/EventID.h" 00012 #include "FWCore/Utilities/interface/ESInputTag.h" 00013 #include "FWCore/Utilities/interface/InputTag.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 boost::python::class_<PythonParameterSet>("ParameterSet") 00067 .def("addInt32", &PythonParameterSet::addParameter<int>) 00068 .def("getInt32", &PythonParameterSet::getParameter<int>) 00069 .def("addVInt32", &PythonParameterSet::addParameters<int>) 00070 .def("getVInt32", &PythonParameterSet::getParameters<int>) 00071 .def("addUInt32", &PythonParameterSet::addParameter<unsigned int>) 00072 .def("getUInt32", &PythonParameterSet::getParameter<unsigned int>) 00073 .def("addVUInt32", &PythonParameterSet::addParameters<unsigned int>) 00074 .def("getVUInt32", &PythonParameterSet::getParameters<unsigned int>) 00075 .def("addInt64", &PythonParameterSet::addParameter<long long>) 00076 .def("getInt64", &PythonParameterSet::getParameter<long long>) 00077 .def("addUInt64", &PythonParameterSet::addParameter<unsigned long long>) 00078 .def("getUInt64", &PythonParameterSet::getParameter<unsigned long long>) 00079 .def("addVInt64", &PythonParameterSet::addParameters<long long>) 00080 .def("getVInt64", &PythonParameterSet::getParameters<long long>) 00081 .def("addVUInt64", &PythonParameterSet::addParameters<unsigned long long>) 00082 .def("getVUInt64", &PythonParameterSet::getParameters<unsigned long long>) 00083 .def("addDouble", &PythonParameterSet::addParameter<double>) 00084 .def("getDouble", &PythonParameterSet::getParameter<double>) 00085 .def("addVDouble", &PythonParameterSet::addParameters<double>) 00086 .def("getVDouble", &PythonParameterSet::getParameters<double>) 00087 .def("addBool", &PythonParameterSet::addParameter<bool>) 00088 .def("getBool", &PythonParameterSet::getParameter<bool>) 00089 .def("addString", &PythonParameterSet::addParameter<std::string>) 00090 .def("getString", &PythonParameterSet::getParameter<std::string>) 00091 .def("addVString", &PythonParameterSet::addParameters<std::string>) 00092 .def("getVString", &PythonParameterSet::getParameters<std::string>) 00093 .def("addInputTag", &PythonParameterSet::addParameter<edm::InputTag>) 00094 .def("getInputTag", &PythonParameterSet::getParameter<edm::InputTag>) 00095 .def("addVInputTag", &PythonParameterSet::addParameters<edm::InputTag>) 00096 .def("getVInputTag", &PythonParameterSet::getParameters<edm::InputTag>) 00097 .def("addESInputTag", &PythonParameterSet::addParameter<edm::ESInputTag>) 00098 .def("getESInputTag", &PythonParameterSet::getParameter<edm::ESInputTag>) 00099 .def("addVESInputTag", &PythonParameterSet::addParameters<edm::ESInputTag>) 00100 .def("getVESInputTag", &PythonParameterSet::getParameters<edm::ESInputTag>) 00101 .def("addEventID", &PythonParameterSet::addParameter<edm::EventID>) 00102 .def("getEventID", &PythonParameterSet::getParameter<edm::EventID>) 00103 .def("addVEventID", &PythonParameterSet::addParameters<edm::EventID>) 00104 .def("getVEventID", &PythonParameterSet::getParameters<edm::EventID>) 00105 .def("addLuminosityBlockID", &PythonParameterSet::addParameter<edm::LuminosityBlockID>) 00106 .def("getLuminosityBlockID", &PythonParameterSet::getParameter<edm::LuminosityBlockID>) 00107 .def("addVLuminosityBlockID", &PythonParameterSet::addParameters<edm::LuminosityBlockID>) 00108 .def("getVLuminosityBlockID", &PythonParameterSet::getParameters<edm::LuminosityBlockID>) 00109 .def("addLuminosityBlockRange", &PythonParameterSet::addParameter<edm::LuminosityBlockRange>) 00110 .def("getLuminosityBlockRange", &PythonParameterSet::getParameter<edm::LuminosityBlockRange>) 00111 .def("addVLuminosityBlockRange", &PythonParameterSet::addParameters<edm::LuminosityBlockRange>) 00112 .def("getVLuminosityBlockRange", &PythonParameterSet::getParameters<edm::LuminosityBlockRange>) 00113 .def("addEventRange", &PythonParameterSet::addParameter<edm::EventRange>) 00114 .def("getEventRange", &PythonParameterSet::getParameter<edm::EventRange>) 00115 .def("addVEventRange", &PythonParameterSet::addParameters<edm::EventRange>) 00116 .def("getVEventRange", &PythonParameterSet::getParameters<edm::EventRange>) 00117 .def("addPSet", &PythonParameterSet::addPSet) 00118 .def("getPSet", &PythonParameterSet::getPSet) 00119 .def("addVPSet", &PythonParameterSet::addVPSet) 00120 .def("getVPSet", &PythonParameterSet::getVPSet) 00121 .def("addFileInPath", &PythonParameterSet::addParameter<edm::FileInPath>) 00122 .def("getFileInPath", &PythonParameterSet::getParameter<edm::FileInPath>) 00123 .def("newInputTag", &PythonParameterSet::newInputTag) 00124 .def("newESInputTag", &PythonParameterSet::newESInputTag) 00125 .def("newEventID", &PythonParameterSet::newEventID) 00126 .def("newLuminosityBlockID", &PythonParameterSet::newLuminosityBlockID) 00127 .def("newLuminosityBlockRange", &PythonParameterSet::newLuminosityBlockRange) 00128 .def("newEventRange", &PythonParameterSet::newEventRange) 00129 .def("addNewFileInPath", &PythonParameterSet::addNewFileInPath) 00130 .def("newPSet", &PythonParameterSet::newPSet) 00131 .def("dump", &PythonParameterSet::dump) 00132 ; 00133 00134 boost::python::class_<PythonProcessDesc>("ProcessDesc", boost::python::init<>()) 00135 .def(boost::python::init<std::string>()) 00136 .def("newPSet", &PythonProcessDesc::newPSet) 00137 .def("dump", &PythonProcessDesc::dump) 00138 ; 00139 } 00140 #endif