Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:39

0001 #ifndef RecoLuminosity_LumiProducer_testSiteService_h
0002 #define RecoLuminosity_LumiProducer_testSiteService_h
0003 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/Run.h"
0007 #include "FWCore/Framework/interface/LuminosityBlock.h"
0008 #include "FWCore/Catalog/interface/SiteLocalConfig.h"
0009 //#include "DataFormats/Common/interface/Handle.h"
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 #include "FWCore/Catalog/interface/SiteLocalConfig.h"
0012 #include "FWCore/ServiceRegistry/interface/Service.h"
0013 
0014 #include <iostream>
0015 
0016 class testSiteService : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
0017 public:
0018   explicit testSiteService(edm::ParameterSet const&);
0019 
0020 private:
0021   void beginJob() override;
0022   void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
0023   void analyze(edm::Event const& e, edm::EventSetup const& c) override;
0024   void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
0025   void endJob() override;
0026 };  //end class
0027 // -----------------------------------------------------------------
0028 testSiteService::testSiteService(edm::ParameterSet const& iConfig) {}
0029 // -----------------------------------------------------------------
0030 void testSiteService::analyze(edm::Event const& e, edm::EventSetup const&) {}
0031 // -----------------------------------------------------------------
0032 void testSiteService::endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) {
0033   std::cout << "testSiteService::endLuminosityBlock" << std::endl;
0034   std::cout << "I'm in run " << lumiBlock.run() << " lumi block " << lumiBlock.id().luminosityBlock() << std::endl;
0035   edm::Service<edm::SiteLocalConfig> localconfservice;
0036   if (!localconfservice.isAvailable()) {
0037     throw cms::Exception("edm::SiteLocalConfigService is not available");
0038   }
0039   std::string a("frontier://cmsfrontier.cern.ch:8000/CMS_LUMI_DEV_OFFLINE");
0040   std::cout << "a: " << localconfservice->lookupCalibConnect(a) << std::endl;
0041   std::string b("frontier://(serverurl=cmsfrontier.cern.ch:8000/LumiPrep)/CMS_LUMI_DEV_OFFLINE");
0042   std::cout << "b: " << localconfservice->lookupCalibConnect(b) << std::endl;
0043   ;
0044   std::string cc("frontier://LumiPrep/CMS_LUMI_DEV_OFFLINE");
0045   std::cout << "cc: " << localconfservice->lookupCalibConnect(cc) << std::endl;
0046   std::string dd("frontier://LumiPrep(retrieve-ziplevel=0)/CMS_LUMI_DEV_OFFLINE");
0047   std::cout << "dd: " << localconfservice->lookupCalibConnect(dd) << std::endl;
0048 }
0049 // -----------------------------------------------------------------
0050 void testSiteService::beginJob() { std::cout << "testEvtLoop::beginJob" << std::endl; }
0051 // -----------------------------------------------------------------
0052 void testSiteService::endJob() {}
0053 DEFINE_FWK_MODULE(testSiteService);
0054 #endif