File indexing completed on 2024-04-06 12:12:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/Framework/interface/one/EDProducer.h"
0012 #include "DataFormats/TestObjects/interface/MissingDictionaryTestObject.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Utilities/interface/EDGetToken.h"
0016 #include "FWCore/Utilities/interface/InputTag.h"
0017 #include "FWCore/Framework/interface/MakerMacros.h"
0018 #include "DataFormats/Common/interface/View.h"
0019
0020 #include <list>
0021 #include <vector>
0022
0023 namespace edm {
0024 class EventSetup;
0025 }
0026
0027 namespace edmtest {
0028
0029 class MissingDictionaryTestProducer : public edm::one::EDProducer<> {
0030 public:
0031 explicit MissingDictionaryTestProducer(edm::ParameterSet const&);
0032 ~MissingDictionaryTestProducer() override;
0033
0034 void produce(edm::Event&, edm::EventSetup const&) override;
0035
0036 private:
0037 edm::EDGetTokenT<MissingDictionaryTestA> inputToken1_;
0038 edm::EDGetTokenT<std::vector<MissingDictionaryTestA> > inputToken2_;
0039 edm::EDGetTokenT<std::list<MissingDictionaryTestA> > inputToken3_;
0040 };
0041
0042 MissingDictionaryTestProducer::MissingDictionaryTestProducer(edm::ParameterSet const& pset) {
0043 consumes<edm::View<MissingDictionaryTestA> >(pset.getParameter<edm::InputTag>("inputTag"));
0044 inputToken1_ = consumes<MissingDictionaryTestA>(pset.getParameter<edm::InputTag>("inputTag"));
0045 inputToken2_ = consumes<std::vector<MissingDictionaryTestA> >(pset.getParameter<edm::InputTag>("inputTag"));
0046 inputToken3_ = consumes<std::list<MissingDictionaryTestA> >(pset.getParameter<edm::InputTag>("inputTag"));
0047
0048 produces<MissingDictionaryTestA>();
0049 produces<MissingDictionaryTestA>("anInstance");
0050 produces<std::vector<MissingDictionaryTestA> >();
0051 produces<std::vector<MissingDictionaryTestA> >("anInstance");
0052 produces<std::list<MissingDictionaryTestA> >();
0053 }
0054
0055 MissingDictionaryTestProducer::~MissingDictionaryTestProducer() {}
0056
0057 void MissingDictionaryTestProducer::produce(edm::Event& event, edm::EventSetup const&) {
0058 edm::Handle<MissingDictionaryTestA> h1;
0059
0060
0061 edm::Handle<std::vector<MissingDictionaryTestA> > h2;
0062
0063
0064 auto result1 = std::make_unique<MissingDictionaryTestA>();
0065 event.put(std::move(result1));
0066
0067 auto result2 = std::make_unique<MissingDictionaryTestA>();
0068 event.put(std::move(result2), "anInstance");
0069
0070 auto result3 = std::make_unique<std::vector<MissingDictionaryTestA> >();
0071 event.put(std::move(result3));
0072
0073 auto result4 = std::make_unique<std::vector<MissingDictionaryTestA> >();
0074 event.put(std::move(result4), "anInstance");
0075 }
0076 }
0077 using edmtest::MissingDictionaryTestProducer;
0078 DEFINE_FWK_MODULE(MissingDictionaryTestProducer);