CMS 3D CMS Logo

cmsGetFnConnect.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Utilities
4 // Class : cmsGetFnConnect
5 //
6 // Implementation:
7 // Looks up a frontier connect string
8 //
9 // Original Author: Dave Dykstra
10 // Created: Tue Feb 22 16:54:06 CST 2011
11 //
12 
19 #include <iostream>
20 #include <cstring>
21 #include <memory>
22 
23 int main(int argc, char* argv[]) {
24  if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0)) {
25  std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
26  return 2;
27  }
28 
29  try {
30  std::unique_ptr<edm::SiteLocalConfig> slcptr =
31  std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
32  auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
34  edm::ServiceRegistry::Operate operate(slcToken);
35 
36  edm::Service<edm::SiteLocalConfig> localconfservice;
37 
38  std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
39  } catch (cms::Exception const& e) {
40  std::cerr << e.explainSelf() << std::endl;
41  return 2;
42  }
43  return 0;
44 }
main
int main(int argc, char *argv[])
Definition: cmsGetFnConnect.cc:23
cmsBatch.argv
argv
Definition: cmsBatch.py:279
ServiceRegistry.h
dir2webdir.argc
argc
Definition: dir2webdir.py:39
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ServiceToken
Definition: ServiceToken.h:40
Service.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Service
Definition: Service.h:30
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ServiceRegistry::createContaining
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
Definition: ServiceRegistry.h:99
edm::SiteLocalConfig::lookupCalibConnect
virtual const std::string lookupCalibConnect(std::string const &input) const =0
Exception.h
cms::Exception
Definition: Exception.h:70
ParameterSet.h
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
SiteLocalConfig.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SiteLocalConfigService.h