CMS 3D CMS Logo

Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondCore/Utilities/plugins/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 <iostream>

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (pluginCondDBPyInterface)

Function Documentation

BOOST_PYTHON_MODULE ( pluginCondDBPyInterface  )

Definition at line 115 of file CondPyWrappers.cc.

References cond::CondDB::allTags(), begin, cond::IOVProxy::begin(), cond::IOVProxy::comment(), def, cond::LogDBEntry::destinationDB, end, cond::IOVProxy::end(), cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::RDBMS::getDB(), cond::RDBMS::getReadOnlyDB(), cond::RDBMS::globalTag(), cond::IOVProxy::head(), cond::CondDB::iov(), cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::CondDB::iovWithLib(), cond::TagMetadata::labelname, cond::CondDB::lastLogEntry(), cond::CondDB::lastLogEntryOK(), cond::LogDBEntry::logId, cond::lumiid, cond::TagMetadata::objectname, cond::CondDB::payLoad(), cond::LogDBEntry::payloadContainer, cond::IOVProxy::payloadContainerName(), cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadName, cond::LogDBEntry::payloadToken, cond::TagMetadata::pfn, cond::LogDBEntry::provenance, cond::TagMetadata::recordname, cond::IOVProxy::resetRange(), cond::IOVProxy::revision(), cond::runnumber, cond::RDBMS::setLogger(), cond::IOVProxy::setRange(), cond::IOVElementProxy::since(), findQualityFiles::size, cond::IOVProxy::size(), cond::TagMetadata::tag, cond::IOVProxy::tail(), cond::IOVElementProxy::till(), cond::timestamp, cond::IOVProxy::timestamp(), cond::IOVProxy::timetype(), cond::userid, cond::LogDBEntry::usertext, relativeConstraints::value, and cond::IOVElementProxy::wrapperToken().

                                             {

  def("append2VS",&append2VS);

  def("unpackTime",&unpackTime);

  class_<cond::LogDBEntry>("LogDBEntry")
    .def("getState",getLogState)
    .def_readonly("logId",  &cond::LogDBEntry::logId)
    .def_readonly("destinationDB",   &cond::LogDBEntry::destinationDB)   
    .def_readonly("provenance",  &cond::LogDBEntry::provenance)
    .def_readonly("usertext",  &cond::LogDBEntry::usertext)
    .def_readonly("iovtag",  &cond::LogDBEntry::iovtag)
    .def_readonly("iovtimetype",   &cond::LogDBEntry::iovtimetype)
    .def_readonly("payloadIdx",   &cond::LogDBEntry::payloadIdx)
    .def_readonly("payloadName",   &cond::LogDBEntry::payloadName)
    .def_readonly("payloadToken",   &cond::LogDBEntry::payloadToken)
    .def_readonly("payloadContainer",   &cond::LogDBEntry::payloadContainer)
    .def_readonly("exectime",   &cond::LogDBEntry::exectime)
    .def_readonly("execmessage",  &cond::LogDBEntry::execmessage)
    ;
  
  class_<cond::TagMetadata>("TagEntry")
    .def("getState",getTagState)
    .def_readonly("tag", &cond::TagMetadata::tag)
    .def_readonly("pfn", &cond::TagMetadata::pfn)
    .def_readonly("record", &cond::TagMetadata::recordname)
    .def_readonly("label", &cond::TagMetadata::labelname)
    .def_readonly("object", &cond::TagMetadata::objectname)
    ;
  
  class_<cond::GlobalTag >("GlobalTag", init<>())
    .def("size", &cond::GlobalTag::size)
    .add_property("elements",  boost::python::range( &cond::GlobalTag::begin,  &cond::GlobalTag::end))
    ;

  class_<std::vector<std::string> >("VString")
    .def(vector_indexing_suite<std::vector<std::string> >())
    ;

  class_<std::vector<float> >("VFloat")
    .def(vector_indexing_suite<std::vector<float> >())
    ;

  class_<std::vector<int> >("VInt")
    .def(vector_indexing_suite<std::vector<int> >())
    ;
   
  class_<cond::IOVElementProxy>("IOVElement", init<>())
    .def("since", &cond::IOVElementProxy::since)
    .def("till", &cond::IOVElementProxy::till)
    .def("payloadToken", &cond::IOVElementProxy::wrapperToken, return_value_policy<copy_const_reference>())
    ;
  
  enum_<cond::TimeType>("timetype")
    .value("runnumber",cond::runnumber)
    .value("timestamp",cond::timestamp)
    .value("lumiid",cond::lumiid)
    .value("userid",cond::userid)
    ;
  
  class_<cond::IOVProxy>("IOV", init<>())
    .def("size", &cond::IOVProxy::size)
    .def("resetRange", &cond::IOVProxy::resetRange)
    .def("setRange", &cond::IOVProxy::setRange)
    .def("head", &cond::IOVProxy::head)
    .def("tail", &cond::IOVProxy::tail)
    .def("timetype", &cond::IOVProxy::timetype)
    .def("payloadContainerName", &cond::IOVProxy::payloadContainerName)
    .def("comment", &cond::IOVProxy::comment)
    .def("revision",&cond::IOVProxy::revision)
    .def("timestamp",&cond::IOVProxy::timestamp)
    .add_property("elements", boost::python::range( &cond::IOVProxy::begin,  &cond::IOVProxy::end))
    ;
  
  
  class_<cond::FWIncantation>("FWIncantation", init<>());
  
  class_<cond::CondDB>("CondDB", init<>())
    .def("allTags", &cond::CondDB::allTags)
    .def("iov", &cond::CondDB::iov)
    .def("iovWithLib", &cond::CondDB::iovWithLib)
    .def("payLoad", &cond::CondDB::payLoad)
    .def("moduleName",moduleName)
    .def("lastLogEntry", &cond::CondDB::lastLogEntry)
    .def("lastLogEntryOK", &cond::CondDB::lastLogEntryOK)
    ;
  

  class_<cond::RDBMS>("RDBMS", init<>())
    .def(init<std::string>())
    .def(init<std::string, std::string>())
    .def("setLogger",&cond::RDBMS::setLogger)
    .def("getDB", &cond::RDBMS::getDB)
    .def("getReadOnlyDB", &cond::RDBMS::getReadOnlyDB)
    .def("globalTag",  &cond::RDBMS::globalTag, return_value_policy<copy_const_reference>())
    ;


//  register_exception_translator<edm::Exception>(exceptionTranslator);
  register_exception_translator<std::exception>(exceptionTranslator);


}