CMS 3D CMS Logo

Functions
cmsGetFnConnect.cc File Reference
#include "FWCore/Catalog/interface/SiteLocalConfig.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Services/src/SiteLocalConfigService.h"
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <iostream>
#include <cstring>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 22 of file cmsGetFnConnect.cc.

References MessageLogger_cfi::cerr, gather_cfg::cout, edm::ServiceRegistry::createContaining(), MillePedeFileConverter_cfg::e, cms::Exception::explainSelf(), edm::SiteLocalConfig::lookupCalibConnect(), eostools::move(), and cmsPerfStripChart::operate().

22  {
23  if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0)) {
24  std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
25  return 2;
26  }
27 
28  try {
29  std::unique_ptr<edm::SiteLocalConfig> slcptr =
30  std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
31  auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
34 
35  edm::Service<edm::SiteLocalConfig> localconfservice;
36 
37  std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
38  } catch (cms::Exception const& e) {
39  std::cerr << e.explainSelf() << std::endl;
40  return 2;
41  }
42  return 0;
43 }
virtual std::string const lookupCalibConnect(std::string const &input) const =0
virtual std::string explainSelf() const
Definition: Exception.cc:108
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
def move(src, dest)
Definition: eostools.py:511
def operate(timelog, memlog, json_f, num)