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 <string.h>

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 23 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().

24 {
25  if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0))
26  {
27  std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
28  return 2;
29  }
30 
31  try {
32  std::unique_ptr<edm::SiteLocalConfig> slcptr = std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
33  auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
36 
37  edm::Service<edm::SiteLocalConfig> localconfservice;
38 
39  std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
40  } catch(cms::Exception const& e) {
41  std::cerr << e.explainSelf() << std::endl;
42  return 2;
43  }
44  return 0;
45 }
virtual std::string const lookupCalibConnect(std::string const &input) const =0
virtual std::string explainSelf() const
Definition: Exception.cc:146
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:510
def operate(timelog, memlog, json_f, num)