Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:47

0001 #include "DummyClient.h"
0002 #include "HeterogeneousCore/SonicCore/interface/SonicEDProducer.h"
0003 #include "DataFormats/TestObjects/interface/ToyProducts.h"
0004 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0005 #include "FWCore/Framework/interface/MakerMacros.h"
0006 
0007 #include <memory>
0008 
0009 namespace sonictest {
0010   class SonicDummyProducer : public SonicEDProducer<DummyClient> {
0011   public:
0012     explicit SonicDummyProducer(edm::ParameterSet const& cfg)
0013         : SonicEDProducer<DummyClient>(cfg), input_(cfg.getParameter<int>("input")) {
0014       putToken_ = produces<edmtest::IntProduct>();
0015     }
0016 
0017     void acquire(edm::Event const& iEvent, edm::EventSetup const& iSetup, Input& iInput) override { iInput = input_; }
0018 
0019     void produce(edm::Event& iEvent, edm::EventSetup const& iSetup, Output const& iOutput) override {
0020       iEvent.emplace(putToken_, iOutput);
0021     }
0022 
0023     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0024       edm::ParameterSetDescription desc;
0025       DummyClient::fillPSetDescription(desc);
0026       desc.add<int>("input");
0027       //to ensure distinct cfi names
0028       descriptions.addWithDefaultLabel(desc);
0029     }
0030 
0031   private:
0032     //members
0033     int input_;
0034     edm::EDPutTokenT<edmtest::IntProduct> putToken_;
0035   };
0036 }  // namespace sonictest
0037 
0038 using sonictest::SonicDummyProducer;
0039 DEFINE_FWK_MODULE(SonicDummyProducer);