CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
PythonModule.h File Reference
#include "FWCore/PythonParameterSet/interface/BoostPython.h"
#include "FWCore/PythonParameterSet/interface/PythonParameterSet.h"
#include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h"
#include "DataFormats/Provenance/interface/EventRange.h"
#include "DataFormats/Provenance/interface/LuminosityBlockID.h"
#include "DataFormats/Provenance/interface/LuminosityBlockRange.h"
#include "DataFormats/Provenance/interface/EventID.h"
#include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
#include "FWCore/Utilities/interface/ESInputTag.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include <string>

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (libFWCoreParameterSet)
 

Function Documentation

BOOST_PYTHON_MODULE ( libFWCoreParameterSet  )

Definition at line 34 of file PythonModule.h.

References PythonParameterSet::addNewFileInPath(), PythonParameterSet::addPSet(), PythonParameterSet::addVPSet(), edm::ESInputTag::data(), def, PythonProcessDesc::dump(), PythonParameterSet::dump(), edm::EventRange::endEvent(), edm::LuminosityBlockRange::endLumi(), edm::EventRange::endLumi(), edm::EventRange::endRun(), edm::LuminosityBlockRange::endRun(), edm::EventID::event(), edm::FileInPath::fullPath(), PythonParameterSet::getPSet(), PythonParameterSet::getVPSet(), edm::InputTag::instance(), edm::InputTag::label(), edm::EventID::luminosityBlock(), edm::LuminosityBlockID::luminosityBlock(), edm::ESInputTag::module(), PythonParameterSet::newESInputTag(), PythonParameterSet::newEventID(), PythonParameterSet::newEventRange(), PythonParameterSet::newInputTag(), PythonParameterSet::newLuminosityBlockID(), PythonParameterSet::newLuminosityBlockRange(), PythonProcessDesc::newPSet(), PythonParameterSet::newPSet(), edm::InputTag::process(), edm::FileInPath::relativePath(), edm::EventID::run(), edm::LuminosityBlockID::run(), edm::EventRange::startEvent(), edm::EventRange::startLumi(), edm::LuminosityBlockRange::startLumi(), edm::EventRange::startRun(), and edm::LuminosityBlockRange::startRun().

35 {
36  boost::python::register_exception_translator<cms::Exception>(translator);
37 
38  boost::python::class_<edm::InputTag>("InputTag", boost::python::init<std::string>())
39  .def(boost::python::init<std::string, std::string, std::string>())
40  .def(boost::python::init<std::string, std::string>())
41  .def("label", &edm::InputTag::label, boost::python::return_value_policy<boost::python::copy_const_reference>())
42  .def("instance", &edm::InputTag::instance, boost::python::return_value_policy<boost::python::copy_const_reference>())
43  .def("process", &edm::InputTag::process, boost::python::return_value_policy<boost::python::copy_const_reference>())
44  ;
45 
46  boost::python::class_<edm::ESInputTag>("ESInputTag", boost::python::init<std::string>())
47  .def(boost::python::init<std::string, std::string>())
48  .def("module", &edm::ESInputTag::module, boost::python::return_value_policy<boost::python::copy_const_reference>())
49  .def("data", &edm::ESInputTag::data, boost::python::return_value_policy<boost::python::copy_const_reference>())
50  ;
51 
52  boost::python::class_<edm::EventID>("EventID", boost::python::init<edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t>())
53  .def("run", &edm::EventID::run)
54  .def("luminosityBlock", &edm::EventID::luminosityBlock)
55  .def("event", &edm::EventID::event)
56  ;
57 
58  boost::python::class_<edm::LuminosityBlockID>("LuminosityBlockID", boost::python::init<unsigned int, unsigned int>())
59  .def("run", &edm::LuminosityBlockID::run)
60  .def("luminosityBlock", &edm::LuminosityBlockID::luminosityBlock)
61  ;
62 
63  boost::python::class_<edm::FileInPath>("FileInPath", boost::python::init<std::string>())
64  .def("fullPath", &edm::FileInPath::fullPath)
65  .def("relativePath", &edm::FileInPath::relativePath)
66  ;
67 
68  boost::python::class_<edm::LuminosityBlockRange>("LuminosityBlockRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int>())
70  .def("startSub", &edm::LuminosityBlockRange::startLumi)
72  .def("endSub", &edm::LuminosityBlockRange::endLumi)
73  ;
74 
75  boost::python::class_<edm::EventRange>("EventRange", boost::python::init<edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t>())
76  .def("start", &edm::EventRange::startRun)
77  .def("startLumi", &edm::EventRange::startLumi)
78  .def("startSub", &edm::EventRange::startEvent)
79  .def("end", &edm::EventRange::endRun)
80  .def("endLumi", &edm::EventRange::endLumi)
81  .def("endSub", &edm::EventRange::endEvent)
82  ;
83 
84  boost::python::class_<PythonParameterSet>("ParameterSet")
85  .def("addInt32", &PythonParameterSet::addParameter<int>)
86  .def("getInt32", &PythonParameterSet::getParameter<int>)
87  .def("addVInt32", &PythonParameterSet::addParameters<int>)
88  .def("getVInt32", &PythonParameterSet::getParameters<int>)
89  .def("addUInt32", &PythonParameterSet::addParameter<unsigned int>)
90  .def("getUInt32", &PythonParameterSet::getParameter<unsigned int>)
91  .def("addVUInt32", &PythonParameterSet::addParameters<unsigned int>)
92  .def("getVUInt32", &PythonParameterSet::getParameters<unsigned int>)
93  .def("addInt64", &PythonParameterSet::addParameter<long long>)
94  .def("getInt64", &PythonParameterSet::getParameter<long long>)
95  .def("addUInt64", &PythonParameterSet::addParameter<unsigned long long>)
96  .def("getUInt64", &PythonParameterSet::getParameter<unsigned long long>)
97  .def("addVInt64", &PythonParameterSet::addParameters<long long>)
98  .def("getVInt64", &PythonParameterSet::getParameters<long long>)
99  .def("addVUInt64", &PythonParameterSet::addParameters<unsigned long long>)
100  .def("getVUInt64", &PythonParameterSet::getParameters<unsigned long long>)
101  .def("addDouble", &PythonParameterSet::addParameter<double>)
102  .def("getDouble", &PythonParameterSet::getParameter<double>)
103  .def("addVDouble", &PythonParameterSet::addParameters<double>)
104  .def("getVDouble", &PythonParameterSet::getParameters<double>)
105  .def("addBool", &PythonParameterSet::addParameter<bool>)
106  .def("getBool", &PythonParameterSet::getParameter<bool>)
107  .def("addString", &PythonParameterSet::addParameter<std::string>)
108  .def("getString", &PythonParameterSet::getParameter<std::string>)
109  .def("addVString", &PythonParameterSet::addParameters<std::string>)
110  .def("getVString", &PythonParameterSet::getParameters<std::string>)
111  .def("addInputTag", &PythonParameterSet::addParameter<edm::InputTag>)
112  .def("getInputTag", &PythonParameterSet::getParameter<edm::InputTag>)
113  .def("addVInputTag", &PythonParameterSet::addParameters<edm::InputTag>)
114  .def("getVInputTag", &PythonParameterSet::getParameters<edm::InputTag>)
115  .def("addESInputTag", &PythonParameterSet::addParameter<edm::ESInputTag>)
116  .def("getESInputTag", &PythonParameterSet::getParameter<edm::ESInputTag>)
117  .def("addVESInputTag", &PythonParameterSet::addParameters<edm::ESInputTag>)
118  .def("getVESInputTag", &PythonParameterSet::getParameters<edm::ESInputTag>)
119  .def("addEventID", &PythonParameterSet::addParameter<edm::EventID>)
120  .def("getEventID", &PythonParameterSet::getParameter<edm::EventID>)
121  .def("addVEventID", &PythonParameterSet::addParameters<edm::EventID>)
122  .def("getVEventID", &PythonParameterSet::getParameters<edm::EventID>)
123  .def("addLuminosityBlockID", &PythonParameterSet::addParameter<edm::LuminosityBlockID>)
124  .def("getLuminosityBlockID", &PythonParameterSet::getParameter<edm::LuminosityBlockID>)
125  .def("addVLuminosityBlockID", &PythonParameterSet::addParameters<edm::LuminosityBlockID>)
126  .def("getVLuminosityBlockID", &PythonParameterSet::getParameters<edm::LuminosityBlockID>)
127  .def("addLuminosityBlockRange", &PythonParameterSet::addParameter<edm::LuminosityBlockRange>)
128  .def("getLuminosityBlockRange", &PythonParameterSet::getParameter<edm::LuminosityBlockRange>)
129  .def("addVLuminosityBlockRange", &PythonParameterSet::addParameters<edm::LuminosityBlockRange>)
130  .def("getVLuminosityBlockRange", &PythonParameterSet::getParameters<edm::LuminosityBlockRange>)
131  .def("addEventRange", &PythonParameterSet::addParameter<edm::EventRange>)
132  .def("getEventRange", &PythonParameterSet::getParameter<edm::EventRange>)
133  .def("addVEventRange", &PythonParameterSet::addParameters<edm::EventRange>)
134  .def("getVEventRange", &PythonParameterSet::getParameters<edm::EventRange>)
135  .def("addPSet", &PythonParameterSet::addPSet)
136  .def("getPSet", &PythonParameterSet::getPSet)
137  .def("addVPSet", &PythonParameterSet::addVPSet)
138  .def("getVPSet", &PythonParameterSet::getVPSet)
139  .def("addFileInPath", &PythonParameterSet::addParameter<edm::FileInPath>)
140  .def("getFileInPath", &PythonParameterSet::getParameter<edm::FileInPath>)
141  .def("newInputTag", &PythonParameterSet::newInputTag)
142  .def("newESInputTag", &PythonParameterSet::newESInputTag)
143  .def("newEventID", &PythonParameterSet::newEventID)
144  .def("newLuminosityBlockID", &PythonParameterSet::newLuminosityBlockID)
145  .def("newLuminosityBlockRange", &PythonParameterSet::newLuminosityBlockRange)
146  .def("newEventRange", &PythonParameterSet::newEventRange)
147  .def("addNewFileInPath", &PythonParameterSet::addNewFileInPath)
148  .def("newPSet", &PythonParameterSet::newPSet)
149  .def("dump", &PythonParameterSet::dump)
150  ;
151 
152  boost::python::class_<PythonProcessDesc>("ProcessDesc", boost::python::init<>())
153  .def(boost::python::init<std::string>())
154  .def("newPSet", &PythonProcessDesc::newPSet)
155  .def("dump", &PythonProcessDesc::dump)
156  ;
157 }
RunNumber_t run() const
Definition: EventID.h:39
std::string dump() const
EventNumber_t event() const
Definition: EventID.h:41
PythonParameterSet getPSet(bool tracked, std::string const &name) const
PythonParameterSet newPSet() const
RunNumber_t startRun() const
Definition: EventRange.h:46
std::string relativePath() const
Definition: FileInPath.cc:152
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
LuminosityBlockNumber_t startLumi() const
RunNumber_t endRun() const
Definition: EventRange.h:47
EventNumber_t endEvent() const
Definition: EventRange.h:51
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)
void addPSet(bool tracked, std::string const &name, PythonParameterSet const &ppset)
const std::string & data() const
Definition: ESInputTag.h:106
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
RunNumber_t startRun() const
edm::EventID newEventID(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
LuminosityBlockNumber_t endLumi() const
Definition: EventRange.h:49
EventNumber_t startEvent() const
Definition: EventRange.h:50
LuminosityBlockNumber_t luminosityBlock() const
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
std::string const & label() const
Definition: InputTag.h:43
LuminosityBlockNumber_t startLumi() const
Definition: EventRange.h:48
std::string const & process() const
Definition: InputTag.h:47
void addVPSet(bool tracked, std::string const &name, boost::python::list value)
RunNumber_t endRun() const
LuminosityBlockNumber_t endLumi() const
std::string fullPath() const
Definition: FileInPath.cc:165
const std::string & module() const
Definition: ESInputTag.h:101
JetCorrectorParameters::Definitions def
Definition: classes.h:6
edm::EventRange newEventRange(edm::RunNumber_t start, edm::LuminosityBlockNumber_t startLumi, edm::EventNumber_t startSub, edm::RunNumber_t end, edm::LuminosityBlockNumber_t endLumi, edm::EventNumber_t endSub)
std::string const & instance() const
Definition: InputTag.h:44
PythonParameterSet newPSet() const