File indexing completed on 2024-04-06 12:15:47
0001 #include "DummyClient.h"
0002 #include "HeterogeneousCore/SonicCore/interface/SonicEDFilter.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 SonicDummyFilter : public SonicEDFilter<DummyClient> {
0011 public:
0012 explicit SonicDummyFilter(edm::ParameterSet const& cfg)
0013 : SonicEDFilter<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 bool filter(edm::Event& iEvent, edm::EventSetup const& iSetup, Output const& iOutput) override {
0020 iEvent.emplace(putToken_, iOutput);
0021 return true;
0022 }
0023
0024 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0025 edm::ParameterSetDescription desc;
0026 DummyClient::fillPSetDescription(desc);
0027 desc.add<int>("input");
0028
0029 descriptions.addWithDefaultLabel(desc);
0030 }
0031
0032 private:
0033
0034 int input_;
0035 edm::EDPutTokenT<edmtest::IntProduct> putToken_;
0036 };
0037 }
0038
0039 using sonictest::SonicDummyFilter;
0040 DEFINE_FWK_MODULE(SonicDummyFilter);