Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-14 03:16:37

0001 // -*- C++ -*-
0002 //
0003 // Package:    FWCore/Integration
0004 // Class:      ConsumeIOVTestInfoAnalyzer
0005 //
0006 /**\class edmtest::ConsumeIOVTestInfoAnalyzer
0007 
0008  Description: Used in tests. Declares it consumes products
0009  of type IOVTestInfo. The purpose is to cause the ESProducer
0010  that produces that product to run.
0011 */
0012 // Original Author:  W. David Dagenhart
0013 //         Created:  2 January 2025
0014 
0015 #include "GadgetRcd.h"
0016 
0017 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/EventSetup.h"
0020 #include "FWCore/Framework/interface/MakerMacros.h"
0021 #include "FWCore/Integration/interface/IOVTestInfo.h"
0022 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0025 #include "FWCore/Utilities/interface/ESGetToken.h"
0026 #include "FWCore/Utilities/interface/ESInputTag.h"
0027 #include "FWCore/Utilities/interface/StreamID.h"
0028 
0029 namespace edmtest {
0030 
0031   class ConsumeIOVTestInfoAnalyzer : public edm::global::EDAnalyzer<> {
0032   public:
0033     explicit ConsumeIOVTestInfoAnalyzer(edm::ParameterSet const&);
0034 
0035     void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;
0036 
0037     static void fillDescriptions(edm::ConfigurationDescriptions&);
0038 
0039   private:
0040     edm::ESGetToken<IOVTestInfo, GadgetRcd> const esToken_;
0041   };
0042 
0043   ConsumeIOVTestInfoAnalyzer::ConsumeIOVTestInfoAnalyzer(edm::ParameterSet const& pset)
0044       : esToken_{esConsumes(pset.getUntrackedParameter<edm::ESInputTag>("esInputTag"))} {}
0045 
0046   void ConsumeIOVTestInfoAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {}
0047 
0048   void ConsumeIOVTestInfoAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0049     edm::ParameterSetDescription desc;
0050     desc.addUntracked<edm::ESInputTag>("esInputTag", edm::ESInputTag("", ""));
0051     descriptions.addDefault(desc);
0052   }
0053 
0054 }  // namespace edmtest
0055 using namespace edmtest;
0056 DEFINE_FWK_MODULE(ConsumeIOVTestInfoAnalyzer);