Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:26

0001 #include "FWCore/PluginManager/interface/PluginManager.h"
0002 #include "FWCore/PluginManager/interface/standard.h"
0003 #include "FWCore/PluginManager/interface/SharedLibrary.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
0006 //
0007 #include "CondCore/CondDB/interface/ConnectionPool.h"
0008 #include "CondCore/CondDB/interface/PayloadProxy.h"
0009 //
0010 #include "MyTestData.h"
0011 //
0012 #include <fstream>
0013 #include <iomanip>
0014 #include <cstdlib>
0015 #include <iostream>
0016 
0017 using namespace cond::persistency;
0018 
0019 int main(int argc, char** argv) {
0020   edmplugin::PluginManager::Config config;
0021   edmplugin::PluginManager::configure(edmplugin::standard::config());
0022 
0023   std::vector<edm::ParameterSet> psets;
0024   edm::ParameterSet pSet;
0025   pSet.addParameter("@service_type", std::string("SiteLocalConfigService"));
0026   psets.push_back(pSet);
0027   const edm::ServiceToken services(edm::ServiceRegistry::createSet(psets));
0028   const edm::ServiceRegistry::Operate operate(services);
0029 
0030   std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");
0031   std::cout << "# Connecting with db in " << connectionString << std::endl;
0032   try {
0033     //*************
0034     ConnectionPool connPool;
0035     connPool.setMessageVerbosity(coral::Debug);
0036     Session session = connPool.createSession(connectionString);
0037     session.transaction().start();
0038     IOVProxy iov = session.readIov("runinfo_31X_hlt");
0039     std::cout << "Loaded size=" << iov.loadedSize() << std::endl;
0040     session.transaction().commit();
0041   } catch (const std::exception& e) {
0042     std::cout << "ERROR: " << e.what() << std::endl;
0043     return -1;
0044   } catch (...) {
0045     std::cout << "UNEXPECTED FAILURE." << std::endl;
0046     return -1;
0047   }
0048 }