Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoLuminosity_LumiProducer_testEvtLoop_h
0002 #define RecoLuminosity_LumiProducer_testEvtLoop_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 "DataFormats/Common/interface/Handle.h"
0009 #include "FWCore/Framework/interface/MakerMacros.h"
0010 #include <iostream>
0011 
0012 class testEvtLoop : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
0013 public:
0014   explicit testEvtLoop(edm::ParameterSet const&);
0015 
0016 private:
0017   void beginJob() override;
0018   void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
0019   void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
0020   void analyze(edm::Event const& e, edm::EventSetup const& c) override;
0021   void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
0022   void endRun(edm::Run const&, edm::EventSetup const&) override;
0023   void endJob() override;
0024 };  //end class
0025 
0026 // -----------------------------------------------------------------
0027 
0028 testEvtLoop::testEvtLoop(edm::ParameterSet const& iConfig) {}
0029 
0030 // -----------------------------------------------------------------
0031 
0032 void testEvtLoop::analyze(edm::Event const& e, edm::EventSetup const&) {
0033   //std::cout<<"testEvtLoop::analyze"<<std::endl;
0034 }
0035 
0036 // -----------------------------------------------------------------
0037 void testEvtLoop::endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) {
0038   std::cout << "testEvtLoop::endLuminosityBlock" << std::endl;
0039   std::cout << "I'm in run " << lumiBlock.run() << " lumi block " << lumiBlock.id().luminosityBlock() << std::endl;
0040 }
0041 // -----------------------------------------------------------------
0042 
0043 void testEvtLoop::beginJob() { std::cout << "testEvtLoop::beginJob" << std::endl; }
0044 
0045 // -----------------------------------------------------------------
0046 
0047 void testEvtLoop::beginRun(const edm::Run& run, const edm::EventSetup& c) {
0048   std::cout << "testEvtLoop::beginRun" << std::endl;
0049 }
0050 
0051 // -----------------------------------------------------------------
0052 void testEvtLoop::endRun(edm::Run const& run, edm::EventSetup const& c) {
0053   std::cout << "testEvtLoop::endRun" << std::endl;
0054 }
0055 
0056 // -----------------------------------------------------------------
0057 void testEvtLoop::endJob() { std::cout << "testEvtLoop::endJob" << std::endl; }
0058 
0059 DEFINE_FWK_MODULE(testEvtLoop);
0060 #endif