CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PythonModule.h
Go to the documentation of this file.
1 #ifndef FWCore_PythonParameterSet_PythonModule_h
2 #define FWCore_PythonParameterSet_PythonModule_h
3 
6 
14 
15 #include <string>
16 
17 BOOST_PYTHON_MODULE(libFWCoreParameterSet)
18 {
19  boost::python::class_<edm::InputTag>("InputTag", boost::python::init<std::string>())
20  .def(boost::python::init<std::string, std::string, std::string>())
21  .def(boost::python::init<std::string, std::string>())
22  .def("label", &edm::InputTag::label, boost::python::return_value_policy<boost::python::copy_const_reference>())
23  .def("instance", &edm::InputTag::instance, boost::python::return_value_policy<boost::python::copy_const_reference>())
24  .def("process", &edm::InputTag::process, boost::python::return_value_policy<boost::python::copy_const_reference>())
25  ;
26 
27  boost::python::class_<edm::ESInputTag>("ESInputTag", boost::python::init<std::string>())
28  .def(boost::python::init<std::string, std::string>())
29  .def("module", &edm::ESInputTag::module, boost::python::return_value_policy<boost::python::copy_const_reference>())
30  .def("data", &edm::ESInputTag::data, boost::python::return_value_policy<boost::python::copy_const_reference>())
31  ;
32 
33  boost::python::class_<edm::EventID>("EventID", boost::python::init<unsigned int, unsigned int, unsigned int>())
34  .def("run", &edm::EventID::run)
35  .def("luminosityBlock", &edm::EventID::luminosityBlock)
36  .def("event", &edm::EventID::event)
37  ;
38 
39  boost::python::class_<edm::LuminosityBlockID>("LuminosityBlockID", boost::python::init<unsigned int, unsigned int>())
40  .def("run", &edm::LuminosityBlockID::run)
41  .def("luminosityBlock", &edm::LuminosityBlockID::luminosityBlock)
42  ;
43 
44  boost::python::class_<edm::FileInPath>("FileInPath", boost::python::init<std::string>())
45  .def("fullPath", &edm::FileInPath::fullPath)
46  .def("relativePath", &edm::FileInPath::relativePath)
47  .def("isLocal", &edm::FileInPath::isLocal)
48  ;
49 
50  boost::python::class_<edm::LuminosityBlockRange>("LuminosityBlockRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int>())
52  .def("startSub", &edm::LuminosityBlockRange::startLumi)
54  .def("endSub", &edm::LuminosityBlockRange::endLumi)
55  ;
56 
57  boost::python::class_<edm::EventRange>("EventRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int>())
58  .def("start", &edm::EventRange::startRun)
59  .def("startLumi", &edm::EventRange::startLumi)
60  .def("startSub", &edm::EventRange::startEvent)
61  .def("end", &edm::EventRange::endRun)
62  .def("endLumi", &edm::EventRange::endLumi)
63  .def("endSub", &edm::EventRange::endEvent)
64  ;
65 
66 
67 
68  boost::python::class_<PythonParameterSet>("ParameterSet")
69  .def("addInt32", &PythonParameterSet::addParameter<int>)
70  .def("getInt32", &PythonParameterSet::getParameter<int>)
71  .def("addVInt32", &PythonParameterSet::addParameters<int>)
72  .def("getVInt32", &PythonParameterSet::getParameters<int>)
73  .def("addUInt32", &PythonParameterSet::addParameter<unsigned int>)
74  .def("getUInt32", &PythonParameterSet::getParameter<unsigned int>)
75  .def("addVUInt32", &PythonParameterSet::addParameters<unsigned int>)
76  .def("getVUInt32", &PythonParameterSet::getParameters<unsigned int>)
77  .def("addInt64", &PythonParameterSet::addParameter<long long>)
78  .def("getInt64", &PythonParameterSet::getParameter<long long>)
79  .def("addUInt64", &PythonParameterSet::addParameter<unsigned long long>)
80  .def("getUInt64", &PythonParameterSet::getParameter<unsigned long long>)
81  .def("addVInt64", &PythonParameterSet::addParameters<long long>)
82  .def("getVInt64", &PythonParameterSet::getParameters<long long>)
83  .def("addVUInt64", &PythonParameterSet::addParameters<unsigned long long>)
84  .def("getVUInt64", &PythonParameterSet::getParameters<unsigned long long>)
85  .def("addDouble", &PythonParameterSet::addParameter<double>)
86  .def("getDouble", &PythonParameterSet::getParameter<double>)
87  .def("addVDouble", &PythonParameterSet::addParameters<double>)
88  .def("getVDouble", &PythonParameterSet::getParameters<double>)
89  .def("addBool", &PythonParameterSet::addParameter<bool>)
90  .def("getBool", &PythonParameterSet::getParameter<bool>)
91  .def("addString", &PythonParameterSet::addParameter<std::string>)
92  .def("getString", &PythonParameterSet::getParameter<std::string>)
93  .def("addVString", &PythonParameterSet::addParameters<std::string>)
94  .def("getVString", &PythonParameterSet::getParameters<std::string>)
95  .def("addInputTag", &PythonParameterSet::addParameter<edm::InputTag>)
96  .def("getInputTag", &PythonParameterSet::getParameter<edm::InputTag>)
97  .def("addVInputTag", &PythonParameterSet::addParameters<edm::InputTag>)
98  .def("getVInputTag", &PythonParameterSet::getParameters<edm::InputTag>)
99  .def("addESInputTag", &PythonParameterSet::addParameter<edm::ESInputTag>)
100  .def("getESInputTag", &PythonParameterSet::getParameter<edm::ESInputTag>)
101  .def("addVESInputTag", &PythonParameterSet::addParameters<edm::ESInputTag>)
102  .def("getVESInputTag", &PythonParameterSet::getParameters<edm::ESInputTag>)
103  .def("addEventID", &PythonParameterSet::addParameter<edm::EventID>)
104  .def("getEventID", &PythonParameterSet::getParameter<edm::EventID>)
105  .def("addVEventID", &PythonParameterSet::addParameters<edm::EventID>)
106  .def("getVEventID", &PythonParameterSet::getParameters<edm::EventID>)
107  .def("addLuminosityBlockID", &PythonParameterSet::addParameter<edm::LuminosityBlockID>)
108  .def("getLuminosityBlockID", &PythonParameterSet::getParameter<edm::LuminosityBlockID>)
109  .def("addVLuminosityBlockID", &PythonParameterSet::addParameters<edm::LuminosityBlockID>)
110  .def("getVLuminosityBlockID", &PythonParameterSet::getParameters<edm::LuminosityBlockID>)
111  .def("addLuminosityBlockRange", &PythonParameterSet::addParameter<edm::LuminosityBlockRange>)
112  .def("getLuminosityBlockRange", &PythonParameterSet::getParameter<edm::LuminosityBlockRange>)
113  .def("addVLuminosityBlockRange", &PythonParameterSet::addParameters<edm::LuminosityBlockRange>)
114  .def("getVLuminosityBlockRange", &PythonParameterSet::getParameters<edm::LuminosityBlockRange>)
115  .def("addEventRange", &PythonParameterSet::addParameter<edm::EventRange>)
116  .def("getEventRange", &PythonParameterSet::getParameter<edm::EventRange>)
117  .def("addVEventRange", &PythonParameterSet::addParameters<edm::EventRange>)
118  .def("getVEventRange", &PythonParameterSet::getParameters<edm::EventRange>)
119  .def("addPSet", &PythonParameterSet::addPSet)
120  .def("getPSet", &PythonParameterSet::getPSet)
121  .def("addVPSet", &PythonParameterSet::addVPSet)
122  .def("getVPSet", &PythonParameterSet::getVPSet)
123  .def("addFileInPath", &PythonParameterSet::addParameter<edm::FileInPath>)
124  .def("getFileInPath", &PythonParameterSet::getParameter<edm::FileInPath>)
125  .def("newInputTag", &PythonParameterSet::newInputTag)
126  .def("newESInputTag", &PythonParameterSet::newESInputTag)
127  .def("newEventID", &PythonParameterSet::newEventID)
128  .def("newLuminosityBlockID", &PythonParameterSet::newLuminosityBlockID)
129  .def("newLuminosityBlockRange", &PythonParameterSet::newLuminosityBlockRange)
130  .def("newEventRange", &PythonParameterSet::newEventRange)
131  .def("addNewFileInPath", &PythonParameterSet::addNewFileInPath)
132  .def("newPSet", &PythonParameterSet::newPSet)
133  .def("dump", &PythonParameterSet::dump)
134  ;
135 
136 
137  boost::python::class_<PythonProcessDesc>("ProcessDesc", boost::python::init<>())
138  .def(boost::python::init<std::string>())
139  .def("addService", &PythonProcessDesc::addService)
140  .def("newPSet", &PythonProcessDesc::newPSet)
141  .def("dump", &PythonProcessDesc::dump)
142  ;
143 
144 }
145 #endif
RunNumber_t run() const
Definition: EventID.h:42
std::string dump() const
EventNumber_t event() const
Definition: EventID.h:44
edm::EventID newEventID(unsigned int run, unsigned int lumi, unsigned int event)
bool isLocal() const
Was the file found under the &quot;local&quot; area?
Definition: FileInPath.cc:164
PythonParameterSet getPSet(bool tracked, std::string const &name) const
LumiNumber_t startLumi() const
Definition: EventRange.h:51
PythonParameterSet newPSet() const
RunNumber_t startRun() const
Definition: EventRange.h:49
std::string relativePath() const
Definition: FileInPath.cc:151
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
LuminosityBlockNumber_t startLumi() const
RunNumber_t endRun() const
Definition: EventRange.h:50
EventNumber_t endEvent() const
Definition: EventRange.h:54
boost::python::list getVPSet(bool tracked, std::string const &name)
edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi)
RunNumber_t run() const
std::string dump() const
edm::ESInputTag newESInputTag(std::string const &module, std::string const &data)
edm::EventRange newEventRange(unsigned int start, unsigned int startLumi, unsigned int startSub, unsigned int end, unsigned int endLumi, unsigned int endSub)
void addPSet(bool tracked, std::string const &name, PythonParameterSet const &ppset)
LumiNumber_t endLumi() const
Definition: EventRange.h:52
const std::string & data() const
Definition: ESInputTag.h:62
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
RunNumber_t startRun() const
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
void addService(PythonParameterSet &pset)
EventNumber_t startEvent() const
Definition: EventRange.h:53
LuminosityBlockNumber_t luminosityBlock() const
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
std::string const & label() const
Definition: InputTag.h:25
std::string const & process() const
Definition: InputTag.h:29
void addVPSet(bool tracked, std::string const &name, boost::python::list value)
BOOST_PYTHON_MODULE(pluginEcalPyUtils)
Definition: EcalPyUtils.cc:54
RunNumber_t endRun() const
LuminosityBlockNumber_t endLumi() const
std::string fullPath() const
Definition: FileInPath.cc:170
const std::string & module() const
Definition: ESInputTag.h:57
JetCorrectorParameters::Definitions def
Definition: classes.h:10
std::string const & instance() const
Definition: InputTag.h:26
PythonParameterSet newPSet() const