CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
CondPyWrappers.cc File Reference
#include "CondCore/DBCommon/interface/Exception.h"
#include "CondCore/Utilities/interface/CondPyInterface.h"
#include "CondCore/IOVService/interface/IOVProxy.h"
#include "CondCore/DBCommon/interface/LogDBEntry.h"
#include "CondFormats/Common/interface/TimeConversions.h"
#include "CondCore/DBCommon/interface/ClassID.h"
#include "FWCore/PluginManager/interface/PluginManager.h"
#include "FWCore/PluginManager/interface/standard.h"
#include "CondCore/TagCollection/interface/TagCollectionRetriever.h"
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "CondCore/Utilities/interface/PayLoadInspector.h"
#include <set>
#include <vector>
#include <string>
#include <iostream>

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (pluginCondDBPyInterface)
 

Function Documentation

BOOST_PYTHON_MODULE ( pluginCondDBPyInterface  )

Definition at line 146 of file CondPyWrappers.cc.

References cond::CondDB::allTags(), cond::IOVRange::back(), begin, cond::IOVRange::begin(), cond::IOVProxy::begin(), cond::CondDB::closeSession(), cond::IOVProxy::comment(), cond::CondDB::commitTransaction(), spu::def(), cond::LogDBEntry::destinationDB, end, cond::IOVRange::end(), cond::IOVProxy::end(), cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::IOVProxy::firstSince(), cond::IOVRange::front(), cond::RDBMS::getDB(), cond::RDBMS::getReadOnlyDB(), cond::RDBMS::globalTag(), cond::hash, cond::IOVProxy::head(), cond::CondDB::iov(), cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::CondDB::iovToken(), cond::CondDB::iovWithLib(), cond::TagMetadata::labelname, cond::CondDB::lastLogEntry(), cond::CondDB::lastLogEntryOK(), cond::IOVProxy::lastTill(), cond::LogDBEntry::logId, cond::lumiid, cond::TagMetadata::objectname, cond::CondDB::payLoad(), cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::TagMetadata::pfn, cond::LogDBEntry::provenance, cond::IOVProxy::range(), cond::IOVProxy::rangeHead(), cond::IOVProxy::rangeTail(), cond::TagMetadata::recordname, cond::IOVProxy::revision(), cond::runnumber, cond::RDBMS::setLogger(), cond::IOVElementProxy::since(), cond::IOVRange::size(), cond::IOVProxy::size(), findQualityFiles::size, cond::CondDB::startReadOnlyTransaction(), cond::CondDB::startTransaction(), cond::TagMetadata::tag, cond::IOVProxy::tail(), cond::IOVElementProxy::till(), cond::timestamp, cond::IOVProxy::timestamp(), cond::IOVProxy::timetype(), cond::IOVElementProxy::token(), cond::IOVProxy::token(), cond::userid, cond::LogDBEntry::usertext, and relativeConstraints::value.

146  {
147 
148  def("append2VS",&append2VS);
149 
150  def("unpackTime",&unpackTime);
151 
152  class_<cond::LogDBEntry>("LogDBEntry")
153  .def("getState",getLogState)
154  .def_readonly("logId", &cond::LogDBEntry::logId)
155  .def_readonly("destinationDB", &cond::LogDBEntry::destinationDB)
156  .def_readonly("provenance", &cond::LogDBEntry::provenance)
157  .def_readonly("usertext", &cond::LogDBEntry::usertext)
158  .def_readonly("iovtag", &cond::LogDBEntry::iovtag)
159  .def_readonly("iovtimetype", &cond::LogDBEntry::iovtimetype)
160  .def_readonly("payloadIdx", &cond::LogDBEntry::payloadIdx)
161  .def_readonly("payloadClass", &cond::LogDBEntry::payloadClass)
162  .def_readonly("payloadToken", &cond::LogDBEntry::payloadToken)
163  .def_readonly("exectime", &cond::LogDBEntry::exectime)
164  .def_readonly("execmessage", &cond::LogDBEntry::execmessage)
165  ;
166 
167  class_<cond::TagMetadata>("TagEntry")
168  .def("getState",getTagState)
169  .def_readonly("tag", &cond::TagMetadata::tag)
170  .def_readonly("pfn", &cond::TagMetadata::pfn)
171  .def_readonly("record", &cond::TagMetadata::recordname)
172  .def_readonly("label", &cond::TagMetadata::labelname)
173  .def_readonly("object", &cond::TagMetadata::objectname)
174  ;
175 
176  class_<cond::GlobalTag >("GlobalTag", init<>())
177  .def("size", &cond::GlobalTag::size)
178  .add_property("elements", boost::python::range( &cond::GlobalTag::begin, &cond::GlobalTag::end))
179  ;
180 
181  class_<std::vector<std::string> >("VString")
182  .def(vector_indexing_suite<std::vector<std::string> >())
183  ;
184 
185  class_<std::vector<float> >("VFloat")
186  .def(vector_indexing_suite<std::vector<float> >())
187  ;
188 
189  class_<std::vector<int> >("VInt")
190  .def(vector_indexing_suite<std::vector<int> >())
191  ;
192 
193  enum_<cond::TimeType>("timetype")
194  .value("runnumber",cond::runnumber)
195  .value("timestamp",cond::timestamp)
196  .value("lumiid",cond::lumiid)
197  .value("hash",cond::hash)
198  .value("userid",cond::userid)
199  ;
200 
201  class_<cond::IOVElementProxy>("IOVElement", init<>())
202  .def(init<cond::Time_t, cond::Time_t, std::string>())
203  .def("since", &cond::IOVElementProxy::since)
204  .def("till", &cond::IOVElementProxy::till)
205  .def("payloadToken", &cond::IOVElementProxy::token, return_value_policy<copy_const_reference>())
206  ;
207 
208  class_<cond::IOVRange>("IOVRange", init<>())
209  .def("front", &cond::IOVRange::front)
210  .def("back", &cond::IOVRange::back)
211  .def("size", &cond::IOVRange::size)
212  .add_property("elements", boost::python::range(&cond::IOVRange::begin, &cond::IOVRange::end))
213  ;
214 
215  class_<cond::IOVProxy>("IOV", init<>())
216  .def("token", &cond::IOVProxy::token, return_value_policy<copy_const_reference>())
217  .def("head", &cond::IOVProxy::head)
218  .def("tail", &cond::IOVProxy::tail)
219  .def("range", &cond::IOVProxy::range)
220  .def("rangeHead", &cond::IOVProxy::rangeHead)
221  .def("rangeTail", &cond::IOVProxy::rangeTail)
222  .def("size", &cond::IOVProxy::size)
223  .def("timetype", &cond::IOVProxy::timetype)
224  .def("firstSince", &cond::IOVProxy::firstSince)
225  .def("lastTill", &cond::IOVProxy::lastTill)
226  .def("payloadClasses", payloadContainers)
227  .def("comment", &cond::IOVProxy::comment)
228  .def("revision",&cond::IOVProxy::revision)
229  .def("timestamp",&cond::IOVProxy::timestamp)
230  .add_property("elements", boost::python::range(&cond::IOVProxy::begin, &cond::IOVProxy::end))
231  ;
232 
233  class_<cond::FWIncantation>("FWIncantation", init<>());
234 
235  class_<cond::CondDB>("CondDB", init<>())
236  .def("allTags", &cond::CondDB::allTags)
237  .def("iov", &cond::CondDB::iov)
238  .def("iovToken", &cond::CondDB::iovToken)
239  .def("iovWithLib", &cond::CondDB::iovWithLib)
240  .def("payLoad", &cond::CondDB::payLoad)
241  .def("payloadModules",payloadModules)
242  .def("lastLogEntry", &cond::CondDB::lastLogEntry)
243  .def("lastLogEntryOK", &cond::CondDB::lastLogEntryOK)
244  .def("startTransaction", &cond::CondDB::startTransaction)
245  .def("startReadOnlyTransaction", &cond::CondDB::startReadOnlyTransaction)
246  .def("commitTransaction", &cond::CondDB::commitTransaction)
247  .def("closeSession", &cond::CondDB::closeSession)
248  ;
249 
250 
251  class_<cond::RDBMS>("RDBMS", init<>())
252  .def(init<std::string>())
253  .def(init<std::string, bool>())
254  .def(init<std::string, std::string>())
255  .def("setLogger",&cond::RDBMS::setLogger)
256  .def("getDB", &cond::RDBMS::getDB)
257  .def("getReadOnlyDB", &cond::RDBMS::getReadOnlyDB)
258  .def("globalTag", &cond::RDBMS::globalTag, return_value_policy<copy_const_reference>())
259  ;
260 
261 // register_exception_translator<edm::Exception>(exceptionTranslator);
262  register_exception_translator<std::exception>(exceptionTranslator);
263 
264 
265 }
std::string exectime
Definition: LogDBEntry.h:27
int def(FILE *, FILE *, int)
std::string usertext
Definition: LogDBEntry.h:20
std::string iovtimetype
Definition: LogDBEntry.h:22
CondDB getDB(std::string const &db)
IOVProxy iov(std::string const &tag) const
IOVRange range(cond::Time_t since, cond::Time_t till) const
Definition: IOVProxy.cc:239
cond::LogDBEntry lastLogEntryOK(std::string const &tag) const
GlobalTag const & globalTag(std::string const &connstr, std::string const &gname, std::string const &prefix, std::string const &postfix) const
unsigned int payloadIdx
Definition: LogDBEntry.h:23
IOVProxy iovWithLib(std::string const &tag) const
std::string payloadToken
Definition: LogDBEntry.h:26
unsigned long long logId
Definition: LogDBEntry.h:17
std::string objectname
Definition: TagMetadata.h:12
const_iterator begin() const
Definition: IOVProxy.h:128
void commitTransaction() const
void startTransaction() const
std::string payloadClass
Definition: LogDBEntry.h:25
const_iterator begin() const
Definition: IOVProxy.h:188
IOVRange head(int n) const
Definition: IOVProxy.cc:256
cond::Time_t till() const
Definition: IOVProxy.h:71
std::string destinationDB
Definition: LogDBEntry.h:18
std::string allTags() const
const_iterator end() const
Definition: IOVProxy.h:193
cond::LogDBEntry lastLogEntry(std::string const &tag) const
IOVElementProxy front() const
Definition: IOVProxy.cc:155
std::string labelname
Definition: TagMetadata.h:11
IOVRange tail(int n) const
Definition: IOVProxy.cc:260
IOVElementProxy payLoad(std::string const &token) const
std::string tag
Definition: TagMetadata.h:8
cond::Time_t lastTill() const
Definition: IOVProxy.cc:289
std::string const & token() const
Definition: IOVProxy.h:75
std::string execmessage
Definition: LogDBEntry.h:28
int size() const
Definition: IOVProxy.cc:272
IOVRange rangeHead(cond::Time_t since, cond::Time_t till, int n) const
Definition: IOVProxy.cc:244
int revision() const
Definition: IOVProxy.cc:304
#define end
Definition: vmac.h:37
std::string iovToken(std::string const &tag) const
void closeSession() const
const_iterator end() const
Definition: IOVProxy.h:133
cond::Time_t timestamp() const
Definition: IOVProxy.cc:308
IOVRange rangeTail(cond::Time_t since, cond::Time_t till, int n) const
Definition: IOVProxy.cc:250
size_t size() const
Definition: IOVProxy.cc:165
cond::Time_t since() const
Definition: IOVProxy.h:67
std::string provenance
Definition: LogDBEntry.h:19
std::string pfn
Definition: TagMetadata.h:9
cond::Time_t firstSince() const
Definition: IOVProxy.cc:285
#define begin
Definition: vmac.h:30
TimeType timetype() const
Definition: IOVProxy.cc:281
void startReadOnlyTransaction() const
CondDB getReadOnlyDB(std::string const &db)
std::string recordname
Definition: TagMetadata.h:10
std::string iovtag
Definition: LogDBEntry.h:21
const std::string & token()
Definition: IOVProxy.cc:217
tuple size
Write out results.
std::string comment() const
Definition: IOVProxy.cc:299
void setLogger(std::string const &connstr)
IOVElementProxy back() const
Definition: IOVProxy.cc:160