Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-14 23:36:18

0001 
0002 /*----------------------------------------------------------------------
0003 
0004 Toy EDProducers of Ints for testing purposes only.
0005 
0006 ----------------------------------------------------------------------*/
0007 
0008 #ifdef __clang__
0009 #pragma GCC diagnostic ignored "-Wc++20-extensions"
0010 #endif
0011 
0012 #include "DataFormats/Common/interface/Handle.h"
0013 #include "DataFormats/Common/interface/TriggerResults.h"
0014 #include "DataFormats/TestObjects/interface/ToyProducts.h"
0015 //
0016 #include "FWCore/Framework/interface/stream/EDProducer.h"
0017 #include "FWCore/Framework/interface/global/EDProducer.h"
0018 #include "FWCore/Framework/interface/limited/EDProducer.h"
0019 #include "FWCore/Framework/interface/one/EDProducer.h"
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 #include "FWCore/Framework/interface/ProcessBlock.h"
0023 #include "FWCore/Framework/interface/GetterOfProducts.h"
0024 #include "FWCore/Framework/interface/TypeMatch.h"
0025 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0026 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0028 #include "FWCore/Utilities/interface/EDMException.h"
0029 #include "FWCore/Utilities/interface/InputTag.h"
0030 #include "FWCore/Utilities/interface/transform.h"
0031 //
0032 #include <cassert>
0033 #include <string>
0034 #include <vector>
0035 #include <chrono>
0036 
0037 namespace edmtest {
0038 
0039   //--------------------------------------------------------------------
0040   //
0041   // Int producers
0042   //
0043   //--------------------------------------------------------------------
0044 
0045   //--------------------------------------------------------------------
0046   //
0047   // throws an exception.
0048   // Announces an IntProduct but does not produce one;
0049   // every call to FailingProducer::produce throws a cms exception
0050   //
0051   class FailingProducer : public edm::global::EDProducer<> {
0052   public:
0053     explicit FailingProducer(edm::ParameterSet const& /*p*/) { produces<IntProduct>(); }
0054     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0055   };
0056 
0057   void FailingProducer::produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const {
0058     // We throw an edm exception with a configurable action.
0059     throw edm::Exception(edm::errors::NotFound) << "Intentional 'NotFound' exception for testing purposes\n";
0060   }
0061   //--------------------------------------------------------------------
0062   //
0063   // throws an exception.
0064   // Announces an IntProduct but does not produce one;
0065   // every call to FailingInLumiProducer::produce throws a cms exception
0066   //
0067   class FailingInLumiProducer : public edm::global::EDProducer<edm::BeginLuminosityBlockProducer> {
0068   public:
0069     explicit FailingInLumiProducer(edm::ParameterSet const& /*p*/) {
0070       produces<IntProduct, edm::Transition::BeginLuminosityBlock>();
0071     }
0072     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0073 
0074     void globalBeginLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) const override;
0075   };
0076 
0077   void FailingInLumiProducer::produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const {}
0078   void FailingInLumiProducer::globalBeginLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) const {
0079     // We throw an edm exception with a configurable action.
0080     throw edm::Exception(edm::errors::NotFound) << "Intentional 'NotFound' exception for testing purposes\n";
0081   }
0082 
0083   //--------------------------------------------------------------------
0084   //
0085   // throws an exception.
0086   // Announces an IntProduct but does not produce one;
0087   // every call to FailingProducer::produce throws a cms exception
0088   //
0089   class FailingInRunProducer : public edm::global::EDProducer<edm::BeginRunProducer> {
0090   public:
0091     explicit FailingInRunProducer(edm::ParameterSet const& /*p*/) { produces<IntProduct, edm::Transition::BeginRun>(); }
0092     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0093 
0094     void globalBeginRunProduce(edm::Run&, edm::EventSetup const&) const override;
0095   };
0096 
0097   void FailingInRunProducer::produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const {}
0098   void FailingInRunProducer::globalBeginRunProduce(edm::Run&, edm::EventSetup const&) const {
0099     // We throw an edm exception with a configurable action.
0100     throw edm::Exception(edm::errors::NotFound) << "Intentional 'NotFound' exception for testing purposes\n";
0101   }
0102 
0103   //--------------------------------------------------------------------
0104   //
0105   // Announces an IntProduct but does not produce one;
0106   // every call to NonProducer::produce does nothing.
0107   //
0108   class NonProducer : public edm::global::EDProducer<> {
0109   public:
0110     explicit NonProducer(edm::ParameterSet const& /*p*/) { produces<IntProduct>(); }
0111     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0112   };
0113 
0114   void NonProducer::produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const {}
0115 
0116   //--------------------------------------------------------------------
0117   //
0118   // Produces an IntProduct instance.
0119   //
0120   // NOTE: this really should be a global::EDProducer<> but for testing we use stream
0121   class IntProducer : public edm::stream::EDProducer<> {
0122   public:
0123     explicit IntProducer(edm::ParameterSet const& p)
0124         : token_{produces<IntProduct>()}, value_(p.getParameter<int>("ivalue")) {}
0125     void produce(edm::Event& e, edm::EventSetup const& c) override;
0126 
0127     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0128       edm::ParameterSetDescription desc;
0129       desc.add<int>("ivalue");
0130       descriptions.addDefault(desc);
0131     }
0132 
0133   private:
0134     edm::EDPutTokenT<IntProduct> token_;
0135     int value_;
0136   };
0137 
0138   void IntProducer::produce(edm::Event& e, edm::EventSetup const&) {
0139     // EventSetup is not used.
0140     e.emplace(token_, value_);
0141   }
0142 
0143   //--------------------------------------------------------------------
0144   //
0145   // Produces an IntProduct instance.
0146   //
0147   class IntOneSharedProducer : public edm::one::EDProducer<edm::one::SharedResources> {
0148   public:
0149     explicit IntOneSharedProducer(edm::ParameterSet const& p) : value_(p.getParameter<int>("ivalue")) {
0150       produces<IntProduct>();
0151       for (auto const& r : p.getUntrackedParameter<std::vector<std::string>>("resourceNames")) {
0152         usesResource(r);
0153       }
0154     }
0155     explicit IntOneSharedProducer(int i) : value_(i) {
0156       produces<IntProduct>();
0157       usesResource("IntOneShared");
0158     }
0159     void produce(edm::Event& e, edm::EventSetup const& c) override;
0160 
0161     static void fillDescriptions(edm::ConfigurationDescriptions& iConfig) {
0162       edm::ParameterSetDescription desc;
0163       desc.add<int>("ivalue");
0164       desc.addUntracked<std::vector<std::string>>("resourceNames", std::vector<std::string>{});
0165 
0166       iConfig.addDefault(desc);
0167     }
0168 
0169   private:
0170     int value_;
0171   };
0172 
0173   void IntOneSharedProducer::produce(edm::Event& e, edm::EventSetup const&) {
0174     // EventSetup is not used.
0175     e.put(std::make_unique<IntProduct>(value_));
0176   }
0177 
0178   //--------------------------------------------------------------------
0179   //
0180   // Produces an IntProduct instance.
0181   //
0182   //
0183   class BusyWaitIntProducer : public edm::global::EDProducer<> {
0184   public:
0185     explicit BusyWaitIntProducer(edm::ParameterSet const& p)
0186         : token_{produces<IntProduct>()},
0187           value_(p.getParameter<int>("ivalue")),
0188           iterations_(p.getParameter<unsigned int>("iterations")),
0189           pi_(std::acos(-1)),
0190           lumiNumberToThrow_(p.getParameter<unsigned int>("lumiNumberToThrow")) {}
0191 
0192     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0193 
0194     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0195 
0196   private:
0197     const edm::EDPutTokenT<IntProduct> token_;
0198     const int value_;
0199     const unsigned int iterations_;
0200     const double pi_;
0201     const unsigned int lumiNumberToThrow_;
0202   };
0203 
0204   void BusyWaitIntProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0205     double sum = 0.;
0206     const double stepSize = pi_ / iterations_;
0207     for (unsigned int i = 0; i < iterations_; ++i) {
0208       sum += stepSize * cos(i * stepSize);
0209     }
0210 
0211     e.emplace(token_, value_ + sum);
0212 
0213     if (e.luminosityBlock() == lumiNumberToThrow_) {
0214       throw cms::Exception("Test");
0215     }
0216   }
0217 
0218   void BusyWaitIntProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0219     edm::ParameterSetDescription desc;
0220     desc.add<int>("ivalue");
0221     desc.add<unsigned int>("iterations");
0222     desc.add<unsigned int>("lumiNumberToThrow", 0);
0223     descriptions.addDefault(desc);
0224   }
0225 
0226   //--------------------------------------------------------------------
0227   class BusyWaitIntLimitedProducer : public edm::limited::EDProducer<> {
0228   public:
0229     explicit BusyWaitIntLimitedProducer(edm::ParameterSet const& p)
0230         : edm::limited::EDProducerBase(p),
0231           edm::limited::EDProducer<>(p),
0232           token_{produces<IntProduct>()},
0233           value_(p.getParameter<int>("ivalue")),
0234           iterations_(p.getParameter<unsigned int>("iterations")),
0235           pi_(std::acos(-1)) {}
0236 
0237     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0238 
0239   private:
0240     const edm::EDPutTokenT<IntProduct> token_;
0241     const int value_;
0242     const unsigned int iterations_;
0243     const double pi_;
0244     mutable std::atomic<unsigned int> reentrancy_{0};
0245   };
0246 
0247   void BusyWaitIntLimitedProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0248     auto v = ++reentrancy_;
0249     if (v > concurrencyLimit()) {
0250       --reentrancy_;
0251       throw cms::Exception("NotLimited", "produce called to many times concurrently.");
0252     }
0253 
0254     double sum = 0.;
0255     const double stepSize = pi_ / iterations_;
0256     for (unsigned int i = 0; i < iterations_; ++i) {
0257       sum += stepSize * cos(i * stepSize);
0258     }
0259 
0260     e.emplace(token_, value_ + sum);
0261     --reentrancy_;
0262   }
0263 
0264   //--------------------------------------------------------------------
0265   class BusyWaitIntOneSharedProducer : public edm::one::EDProducer<edm::one::SharedResources> {
0266   public:
0267     explicit BusyWaitIntOneSharedProducer(edm::ParameterSet const& p)
0268         : value_(p.getParameter<int>("ivalue")),
0269           iterations_(p.getParameter<unsigned int>("iterations")),
0270           pi_(std::acos(-1)) {
0271       for (auto const& r : p.getUntrackedParameter<std::vector<std::string>>("resourceNames")) {
0272         usesResource(r);
0273       }
0274       produces<IntProduct>();
0275     }
0276 
0277     static void fillDescriptions(edm::ConfigurationDescriptions& iConfig) {
0278       edm::ParameterSetDescription desc;
0279       desc.add<int>("ivalue");
0280       desc.add<unsigned int>("iterations");
0281       desc.addUntracked<std::vector<std::string>>("resourceNames", std::vector<std::string>{});
0282 
0283       iConfig.addDefault(desc);
0284     }
0285 
0286     void produce(edm::Event& e, edm::EventSetup const& c) override;
0287 
0288   private:
0289     const int value_;
0290     const unsigned int iterations_;
0291     const double pi_;
0292   };
0293 
0294   void BusyWaitIntOneSharedProducer::produce(edm::Event& e, edm::EventSetup const&) {
0295     double sum = 0.;
0296     const double stepSize = pi_ / iterations_;
0297     for (unsigned int i = 0; i < iterations_; ++i) {
0298       sum += stepSize * cos(i * stepSize);
0299     }
0300 
0301     e.put(std::make_unique<IntProduct>(value_ + sum));
0302   }
0303 
0304   //--------------------------------------------------------------------
0305 
0306   class ConsumingIntProducer : public edm::stream::EDProducer<> {
0307   public:
0308     explicit ConsumingIntProducer(edm::ParameterSet const& p)
0309         : getterOfTriggerResults_(edm::TypeMatch(), this),
0310           token_{produces<IntProduct>()},
0311           value_(p.getParameter<int>("ivalue")) {
0312       // not used, only exists to test PathAndConsumesOfModules
0313       consumes<edm::TriggerResults>(edm::InputTag("TriggerResults"));
0314       callWhenNewProductsRegistered(getterOfTriggerResults_);
0315     }
0316     void produce(edm::Event& e, edm::EventSetup const& c) override;
0317 
0318   private:
0319     edm::GetterOfProducts<edm::TriggerResults> getterOfTriggerResults_;
0320     const edm::EDPutTokenT<IntProduct> token_;
0321     const int value_;
0322   };
0323 
0324   void ConsumingIntProducer::produce(edm::Event& e, edm::EventSetup const&) { e.emplace(token_, value_); }
0325 
0326   //--------------------------------------------------------------------
0327   //
0328   // Produces an IntProduct instance whose value is the event number,
0329   // rather than the value of a configured parameter.
0330   //
0331   class EventNumberIntProducer : public edm::global::EDProducer<> {
0332   public:
0333     explicit EventNumberIntProducer(edm::ParameterSet const&) : token_{produces<UInt64Product>()} {}
0334     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0335 
0336   private:
0337     const edm::EDPutTokenT<UInt64Product> token_;
0338   };
0339 
0340   void EventNumberIntProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0341     // EventSetup is not used.
0342     e.emplace(token_, e.id().event());
0343   }
0344 
0345   //--------------------------------------------------------------------
0346   //
0347   // Produces a TransientIntProduct instance.
0348   //
0349   class TransientIntProducer : public edm::global::EDProducer<> {
0350   public:
0351     explicit TransientIntProducer(edm::ParameterSet const& p)
0352         : token_{produces<TransientIntProduct>()}, value_(p.getParameter<int>("ivalue")) {}
0353     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0354 
0355   private:
0356     const edm::EDPutTokenT<TransientIntProduct> token_;
0357     const int value_;
0358   };
0359 
0360   void TransientIntProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0361     // EventSetup is not used.
0362     e.emplace(token_, value_);
0363   }
0364 
0365   //--------------------------------------------------------------------
0366   //
0367   // Produces a IntProduct instance from a TransientIntProduct
0368   //
0369   class IntProducerFromTransient : public edm::global::EDProducer<> {
0370   public:
0371     explicit IntProducerFromTransient(edm::ParameterSet const&)
0372         : putToken_{produces<IntProduct>()}, getToken_{consumes(edm::InputTag{"TransientThing"})} {}
0373     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0374 
0375   private:
0376     const edm::EDPutTokenT<IntProduct> putToken_;
0377     const edm::EDGetTokenT<TransientIntProduct> getToken_;
0378   };
0379 
0380   void IntProducerFromTransient::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0381     // EventSetup is not used.
0382     auto result = e.getHandle(getToken_);
0383     assert(result);
0384     e.emplace(putToken_, result.product()->value);
0385   }
0386 
0387   //--------------------------------------------------------------------
0388   //
0389   // Produces a TransientIntParent instance.
0390   //
0391   class TransientIntParentProducer : public edm::global::EDProducer<> {
0392   public:
0393     explicit TransientIntParentProducer(edm::ParameterSet const& p)
0394         : token_{produces<TransientIntParent>()}, value_(p.getParameter<int>("ivalue")) {}
0395     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0396 
0397   private:
0398     const edm::EDPutTokenT<TransientIntParent> token_;
0399     const int value_;
0400   };
0401 
0402   void TransientIntParentProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0403     // EventSetup is not used.
0404     e.emplace(token_, value_);
0405   }
0406 
0407   //--------------------------------------------------------------------
0408   //
0409   // Produces a IntProduct instance from a TransientIntParent
0410   //
0411   class IntProducerFromTransientParent : public edm::global::EDProducer<> {
0412   public:
0413     explicit IntProducerFromTransientParent(edm::ParameterSet const& p)
0414         : putToken_{produces<IntProduct>()}, getToken_{consumes(p.getParameter<edm::InputTag>("src"))} {}
0415     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0416 
0417   private:
0418     const edm::EDPutTokenT<IntProduct> putToken_;
0419     const edm::EDGetTokenT<TransientIntParent> getToken_;
0420   };
0421 
0422   void IntProducerFromTransientParent::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0423     // EventSetup is not used.
0424     e.emplace(putToken_, e.get(getToken_).value);
0425   }
0426 
0427   //--------------------------------------------------------------------
0428   //
0429   // Produces an Int16_tProduct instance.
0430   //
0431   class Int16_tProducer : public edm::global::EDProducer<> {
0432   public:
0433     explicit Int16_tProducer(edm::ParameterSet const& p)
0434         : token_{produces<Int16_tProduct>()}, value_(p.getParameter<int>("ivalue")) {}
0435     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0436 
0437   private:
0438     const edm::EDPutTokenT<Int16_tProduct> token_;
0439     const int16_t value_;
0440   };
0441 
0442   void Int16_tProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0443     // EventSetup is not used.
0444     e.emplace(token_, value_);
0445   }
0446 
0447   //
0448   // Produces an IntProduct instance, using an IntProduct as input.
0449   //
0450 
0451   class AddIntsProducer : public edm::global::EDProducer<> {
0452   public:
0453     explicit AddIntsProducer(edm::ParameterSet const& p)
0454         : putToken_{produces<IntProduct>()},
0455           otherPutToken_{produces<IntProduct>("other")},
0456           onlyGetOnEvent_(p.getUntrackedParameter<unsigned int>("onlyGetOnEvent")) {
0457       auto const& labels = p.getParameter<std::vector<edm::InputTag>>("labels");
0458       for (auto const& label : labels) {
0459         tokens_.emplace_back(consumes(label));
0460       }
0461       {
0462         auto const& labels = p.getUntrackedParameter<std::vector<edm::InputTag>>("untrackedLabels");
0463         for (auto const& label : labels) {
0464           tokens_.emplace_back(consumes(label));
0465         }
0466       }
0467     }
0468     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0469 
0470     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0471       edm::ParameterSetDescription desc;
0472       desc.addUntracked<unsigned int>("onlyGetOnEvent", 0u);
0473       desc.add<std::vector<edm::InputTag>>("labels");
0474       desc.addUntracked<std::vector<edm::InputTag>>("untrackedLabels", {})
0475           ->setComment(
0476               "Using this can change the stored ProductRegistry for the same ProcessHistory if this is the only module "
0477               "that depends on these labels.");
0478       descriptions.addDefault(desc);
0479     }
0480 
0481   private:
0482     std::vector<edm::EDGetTokenT<IntProduct>> tokens_;
0483     const edm::EDPutTokenT<IntProduct> putToken_;
0484     const edm::EDPutTokenT<IntProduct> otherPutToken_;
0485     unsigned int onlyGetOnEvent_;
0486   };
0487 
0488   void AddIntsProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0489     // EventSetup is not used.
0490     int value = 0;
0491 
0492     if (onlyGetOnEvent_ == 0u || e.eventAuxiliary().event() == onlyGetOnEvent_) {
0493       for (auto const& token : tokens_) {
0494         value += e.get(token).value;
0495       }
0496     }
0497     e.emplace(putToken_, value);
0498     e.emplace(otherPutToken_, value);
0499   }
0500 
0501   //
0502   // Produces an IntProduct instance, using many IntProducts as input.
0503   //
0504 
0505   class AddAllIntsProducer : public edm::global::EDProducer<> {
0506   public:
0507     explicit AddAllIntsProducer(edm::ParameterSet const& p) : putToken_{produces()} {
0508       getter_ = edm::GetterOfProducts<IntProduct>(edm::TypeMatch(), this);
0509       callWhenNewProductsRegistered(*getter_);
0510     }
0511     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0512 
0513     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0514       edm::ParameterSetDescription desc;
0515       descriptions.addDefault(desc);
0516     }
0517 
0518   private:
0519     const edm::EDPutTokenT<int> putToken_;
0520     std::optional<edm::GetterOfProducts<IntProduct>> getter_;
0521   };
0522 
0523   void AddAllIntsProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0524     std::vector<edm::Handle<IntProduct>> ints;
0525     getter_->fillHandles(e, ints);
0526 
0527     int value = 0;
0528     for (auto const& i : ints) {
0529       value += i->value;
0530     }
0531 
0532     e.emplace(putToken_, value);
0533   }
0534 
0535   //
0536   // Produces multiple IntProduct products
0537   //
0538 
0539   class ManyIntProducer : public edm::global::EDProducer<> {
0540   public:
0541     explicit ManyIntProducer(edm::ParameterSet const& p)
0542         : tokenValues_{vector_transform(
0543               p.getParameter<std::vector<edm::ParameterSet>>("values"),
0544               [this](edm::ParameterSet const& pset) {
0545                 auto const& branchAlias = pset.getParameter<std::string>("branchAlias");
0546                 if (not branchAlias.empty()) {
0547                   return TokenValue{
0548                       produces<IntProduct>(pset.getParameter<std::string>("instance")).setBranchAlias(branchAlias),
0549                       pset.getParameter<int>("value")};
0550                 }
0551                 return TokenValue{produces<IntProduct>(pset.getParameter<std::string>("instance")),
0552                                   pset.getParameter<int>("value")};
0553               })},
0554           transientTokenValues_{vector_transform(
0555               p.getParameter<std::vector<edm::ParameterSet>>("transientValues"),
0556               [this](edm::ParameterSet const& pset) {
0557                 auto const& branchAlias = pset.getParameter<std::string>("branchAlias");
0558                 if (not branchAlias.empty()) {
0559                   return TransientTokenValue{produces<TransientIntProduct>(pset.getParameter<std::string>("instance"))
0560                                                  .setBranchAlias(branchAlias),
0561                                              pset.getParameter<int>("value")};
0562                 }
0563                 return TransientTokenValue{produces<TransientIntProduct>(pset.getParameter<std::string>("instance")),
0564                                            pset.getParameter<int>("value")};
0565               })},
0566           throw_{p.getUntrackedParameter<bool>("throw")} {
0567       tokenValues_.push_back(TokenValue{produces<IntProduct>(), p.getParameter<int>("ivalue")});
0568     }
0569 
0570     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0571       edm::ParameterSetDescription desc;
0572       desc.add<int>("ivalue");
0573       desc.addUntracked<bool>("throw", false);
0574 
0575       {
0576         edm::ParameterSetDescription pset;
0577         pset.add<std::string>("instance");
0578         pset.add<int>("value");
0579         pset.add<std::string>("branchAlias", "");
0580         desc.addVPSet("values", pset, std::vector<edm::ParameterSet>{});
0581         desc.addVPSet("transientValues", pset, std::vector<edm::ParameterSet>{});
0582       }
0583 
0584       descriptions.addDefault(desc);
0585     }
0586 
0587     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0588 
0589   private:
0590     struct TokenValue {
0591       edm::EDPutTokenT<IntProduct> token;
0592       int value;
0593     };
0594     std::vector<TokenValue> tokenValues_;
0595 
0596     struct TransientTokenValue {
0597       edm::EDPutTokenT<TransientIntProduct> token;
0598       int value;
0599     };
0600     std::vector<TransientTokenValue> transientTokenValues_;
0601 
0602     bool throw_;
0603   };
0604 
0605   void ManyIntProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0606     if (throw_) {
0607       throw edm::Exception(edm::errors::NotFound) << "Intentional 'NotFound' exception for testing purposes\n";
0608     }
0609 
0610     // EventSetup is not used.
0611     for (auto const& tv : tokenValues_) {
0612       e.emplace(tv.token, tv.value);
0613     }
0614     for (auto const& tv : transientTokenValues_) {
0615       e.emplace(tv.token, tv.value);
0616     }
0617   }
0618 
0619   //
0620   // Produces multiple IntProduct products based on other products
0621   //
0622 
0623   class ManyIntWhenRegisteredProducer : public edm::global::EDProducer<> {
0624   public:
0625     explicit ManyIntWhenRegisteredProducer(edm::ParameterSet const& p)
0626         : sourceLabel_(p.getParameter<std::string>("src")) {
0627       callWhenNewProductsRegistered([=, this](edm::ProductDescription const& iBranch) {
0628         if (iBranch.moduleLabel() == sourceLabel_) {
0629           if (iBranch.branchType() != edm::InEvent) {
0630             throw edm::Exception(edm::errors::UnimplementedFeature)
0631                 << "ManyIntWhenRegisteredProducer supports only event branches";
0632           }
0633 
0634           this->tokens_.push_back(
0635               Tokens{this->consumes<IntProduct>(
0636                          edm::InputTag{iBranch.moduleLabel(), iBranch.productInstanceName(), iBranch.processName()}),
0637                      this->produces<IntProduct>(iBranch.productInstanceName())});
0638         }
0639       });
0640     }
0641 
0642     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0643       edm::ParameterSetDescription desc;
0644       desc.add<std::string>("src");
0645       descriptions.addDefault(desc);
0646     }
0647 
0648     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override;
0649 
0650   private:
0651     struct Tokens {
0652       edm::EDGetTokenT<IntProduct> get;
0653       edm::EDPutTokenT<IntProduct> put;
0654     };
0655 
0656     std::string sourceLabel_;
0657     std::vector<Tokens> tokens_;
0658   };
0659 
0660   void ManyIntWhenRegisteredProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const {
0661     for (auto const& toks : tokens_) {
0662       e.emplace(toks.put, e.get(toks.get));
0663     }
0664   };
0665 
0666   //--------------------------------------------------------------------
0667 
0668   class NonEventIntProducer : public edm::global::EDProducer<edm::Accumulator,
0669                                                              edm::BeginRunProducer,
0670                                                              edm::BeginLuminosityBlockProducer,
0671                                                              edm::EndLuminosityBlockProducer,
0672                                                              edm::EndRunProducer,
0673                                                              edm::BeginProcessBlockProducer,
0674                                                              edm::EndProcessBlockProducer,
0675                                                              edm::InputProcessBlockCache<>> {
0676   public:
0677     explicit NonEventIntProducer(edm::ParameterSet const& p)
0678         : bpbToken_{produces<IntProduct, edm::Transition::BeginProcessBlock>("beginProcessBlock")},
0679           brToken_{produces<IntProduct, edm::Transition::BeginRun>("beginRun")},
0680           blToken_{produces<IntProduct, edm::Transition::BeginLuminosityBlock>("beginLumi")},
0681           elToken_{produces<IntProduct, edm::Transition::EndLuminosityBlock>("endLumi")},
0682           erToken_{produces<IntProduct, edm::Transition::EndRun>("endRun")},
0683           epbToken_{produces<IntProduct, edm::Transition::EndProcessBlock>("endProcessBlock")},
0684           value_(p.getParameter<int>("ivalue")),
0685           sleepTime_(p.getParameter<unsigned int>("sleepTime")),
0686           bpbExpect_{p.getUntrackedParameter<int>("expectBeginProcessBlock")},
0687           brExpect_{p.getUntrackedParameter<int>("expectBeginRun")},
0688           blExpect_{p.getUntrackedParameter<int>("expectBeginLuminosityBlock")},
0689           elExpect_{p.getUntrackedParameter<int>("expectEndLuminosityBlock")},
0690           erExpect_{p.getUntrackedParameter<int>("expectEndRun")},
0691           epbExpect_{p.getUntrackedParameter<int>("expectEndProcessBlock")},
0692           aipbExpect_{p.getUntrackedParameter<int>("expectAccessInputProcessBlock")} {
0693       {
0694         auto tag = p.getParameter<edm::InputTag>("consumesBeginProcessBlock");
0695         if (not tag.label().empty()) {
0696           bpbGet_ = consumes<edm::InProcess>(tag);
0697         }
0698       }
0699       {
0700         auto tag = p.getParameter<edm::InputTag>("consumesBeginRun");
0701         if (not tag.label().empty()) {
0702           brGet_ = consumes<edm::InRun>(tag);
0703         }
0704       }
0705       {
0706         auto tag = p.getParameter<edm::InputTag>("consumesBeginLuminosityBlock");
0707         if (not tag.label().empty()) {
0708           blGet_ = consumes<edm::InLumi>(tag);
0709         }
0710       }
0711       {
0712         auto tag = p.getParameter<edm::InputTag>("consumesEndLuminosityBlock");
0713         if (not tag.label().empty()) {
0714           elGet_ = consumes<edm::InLumi>(tag);
0715         }
0716       }
0717       {
0718         auto tag = p.getParameter<edm::InputTag>("consumesEndRun");
0719         if (not tag.label().empty()) {
0720           erGet_ = consumes<edm::InRun>(tag);
0721         }
0722       }
0723       {
0724         auto tag = p.getParameter<edm::InputTag>("consumesEndProcessBlock");
0725         if (not tag.label().empty()) {
0726           epbGet_ = consumes<edm::InProcess>(tag);
0727         }
0728       }
0729       {
0730         auto tag = p.getParameter<edm::InputTag>("consumesAccessInputProcessBlock");
0731         if (not tag.label().empty()) {
0732           aipbGet_ = consumes<edm::InProcess>(tag);
0733         }
0734       }
0735     }
0736     void accumulate(edm::StreamID iID, edm::Event const& e, edm::EventSetup const& c) const override;
0737     void beginProcessBlockProduce(edm::ProcessBlock&) override;
0738     void endProcessBlockProduce(edm::ProcessBlock&) override;
0739     void globalBeginRunProduce(edm::Run& e, edm::EventSetup const&) const override;
0740     void globalEndRunProduce(edm::Run& e, edm::EventSetup const&) const override;
0741     void globalBeginLuminosityBlockProduce(edm::LuminosityBlock& e, edm::EventSetup const&) const override;
0742     void globalEndLuminosityBlockProduce(edm::LuminosityBlock& e, edm::EventSetup const&) const override;
0743     void accessInputProcessBlock(edm::ProcessBlock const&) override;
0744 
0745     static void fillDescriptions(edm::ConfigurationDescriptions& conf) {
0746       edm::ParameterSetDescription desc;
0747       desc.add<int>("ivalue", 0);
0748       desc.add<unsigned int>("sleepTime", 0);
0749       desc.add<edm::InputTag>("consumesBeginProcessBlock", {});
0750       desc.addUntracked<int>("expectBeginProcessBlock", 0);
0751       desc.add<edm::InputTag>("consumesEndProcessBlock", {});
0752       desc.addUntracked<int>("expectEndProcessBlock", 0);
0753       desc.add<edm::InputTag>("consumesAccessInputProcessBlock", {});
0754       desc.addUntracked<int>("expectAccessInputProcessBlock", 0);
0755       desc.add<edm::InputTag>("consumesBeginRun", {});
0756       desc.addUntracked<int>("expectBeginRun", 0);
0757       desc.add<edm::InputTag>("consumesEndRun", {});
0758       desc.addUntracked<int>("expectEndRun", 0);
0759       desc.add<edm::InputTag>("consumesBeginLuminosityBlock", {});
0760       desc.addUntracked<int>("expectBeginLuminosityBlock", 0);
0761       desc.add<edm::InputTag>("consumesEndLuminosityBlock", {});
0762       desc.addUntracked<int>("expectEndLuminosityBlock", 0);
0763 
0764       conf.addDefault(desc);
0765     }
0766 
0767   private:
0768     void check(IntProduct, int) const;
0769     const edm::EDPutTokenT<IntProduct> bpbToken_;
0770     const edm::EDPutTokenT<IntProduct> brToken_;
0771     const edm::EDPutTokenT<IntProduct> blToken_;
0772     const edm::EDPutTokenT<IntProduct> elToken_;
0773     const edm::EDPutTokenT<IntProduct> erToken_;
0774     const edm::EDPutTokenT<IntProduct> epbToken_;
0775     const int value_;
0776     const unsigned int sleepTime_;
0777     edm::EDGetTokenT<IntProduct> bpbGet_;
0778     edm::EDGetTokenT<IntProduct> brGet_;
0779     edm::EDGetTokenT<IntProduct> blGet_;
0780     edm::EDGetTokenT<IntProduct> elGet_;
0781     edm::EDGetTokenT<IntProduct> erGet_;
0782     edm::EDGetTokenT<IntProduct> epbGet_;
0783     edm::EDGetTokenT<IntProduct> aipbGet_;
0784     const int bpbExpect_;
0785     const int brExpect_;
0786     const int blExpect_;
0787     const int elExpect_;
0788     const int erExpect_;
0789     const int epbExpect_;
0790     const int aipbExpect_;
0791   };
0792 
0793   void NonEventIntProducer::accumulate(edm::StreamID iID, edm::Event const& e, edm::EventSetup const&) const {}
0794   void NonEventIntProducer::beginProcessBlockProduce(edm::ProcessBlock& processBlock) {
0795     if (not bpbGet_.isUninitialized()) {
0796       check(processBlock.get(bpbGet_), bpbExpect_);
0797     }
0798     if (sleepTime_ > 0) {
0799       // These sleeps are here to force modules to run concurrently
0800       // in multi-threaded processes. Otherwise, the modules are so
0801       // fast it is hard to tell whether a module finishes before the
0802       // the Framework starts the next module.
0803       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0804     }
0805     processBlock.emplace(bpbToken_, value_);
0806   }
0807   void NonEventIntProducer::endProcessBlockProduce(edm::ProcessBlock& processBlock) {
0808     if (not epbGet_.isUninitialized()) {
0809       check(processBlock.get(epbGet_), epbExpect_);
0810     }
0811     if (sleepTime_ > 0) {
0812       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0813     }
0814     processBlock.emplace(epbToken_, value_);
0815   }
0816   void NonEventIntProducer::accessInputProcessBlock(edm::ProcessBlock const& processBlock) {
0817     if (not aipbGet_.isUninitialized()) {
0818       check(processBlock.get(aipbGet_), aipbExpect_);
0819     }
0820     if (sleepTime_ > 0) {
0821       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0822     }
0823   }
0824   void NonEventIntProducer::globalBeginRunProduce(edm::Run& r, edm::EventSetup const&) const {
0825     if (not brGet_.isUninitialized()) {
0826       check(r.get(brGet_), brExpect_);
0827     }
0828     if (sleepTime_ > 0) {
0829       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0830     }
0831     r.emplace(brToken_, value_);
0832   }
0833   void NonEventIntProducer::globalEndRunProduce(edm::Run& r, edm::EventSetup const&) const {
0834     if (not erGet_.isUninitialized()) {
0835       check(r.get(erGet_), erExpect_);
0836     }
0837     if (sleepTime_ > 0) {
0838       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0839     }
0840     r.emplace(erToken_, value_);
0841   }
0842   void NonEventIntProducer::globalBeginLuminosityBlockProduce(edm::LuminosityBlock& l, edm::EventSetup const&) const {
0843     if (not blGet_.isUninitialized()) {
0844       check(l.get(blGet_), blExpect_);
0845     }
0846     if (sleepTime_ > 0) {
0847       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0848     }
0849     l.emplace(blToken_, value_);
0850   }
0851   void NonEventIntProducer::globalEndLuminosityBlockProduce(edm::LuminosityBlock& l, edm::EventSetup const&) const {
0852     if (not elGet_.isUninitialized()) {
0853       check(l.get(elGet_), elExpect_);
0854     }
0855     if (sleepTime_ > 0) {
0856       std::this_thread::sleep_for(std::chrono::microseconds(sleepTime_));
0857     }
0858     l.emplace(elToken_, value_);
0859   }
0860   void NonEventIntProducer::check(IntProduct iProd, int iExpect) const {
0861     if (iExpect != iProd.value) {
0862       throw cms::Exception("BadValue") << "expected " << iExpect << " but got " << iProd.value;
0863     }
0864   }
0865 
0866   //--------------------------------------------------------------------
0867   //
0868   // Produces an IntProduct in ProcessBlock at beginProcessBlock
0869   //
0870   class IntProducerBeginProcessBlock : public edm::global::EDProducer<edm::BeginProcessBlockProducer> {
0871   public:
0872     explicit IntProducerBeginProcessBlock(edm::ParameterSet const& p)
0873         : token_{produces<IntProduct, edm::Transition::BeginProcessBlock>()}, value_(p.getParameter<int>("ivalue")) {}
0874     void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {}
0875     void beginProcessBlockProduce(edm::ProcessBlock&) override;
0876 
0877   private:
0878     edm::EDPutTokenT<IntProduct> token_;
0879     int value_;
0880   };
0881 
0882   void IntProducerBeginProcessBlock::beginProcessBlockProduce(edm::ProcessBlock& processBlock) {
0883     processBlock.emplace(token_, value_);
0884   }
0885 
0886   //--------------------------------------------------------------------
0887   //
0888   // Produces an IntProduct in ProcessBlock at endProcessBlock
0889   //
0890   class IntProducerEndProcessBlock : public edm::global::EDProducer<edm::EndProcessBlockProducer> {
0891   public:
0892     explicit IntProducerEndProcessBlock(edm::ParameterSet const& p)
0893         : token_{produces<IntProduct, edm::Transition::EndProcessBlock>()},
0894           token2_{produces<IntProduct, edm::Transition::EndProcessBlock>("two")},
0895           token3_{produces<IntProduct, edm::Transition::EndProcessBlock>("three")},
0896           token4_{produces<IntProduct, edm::Transition::EndProcessBlock>("four")},
0897           value_(p.getParameter<int>("ivalue")) {}
0898     void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {}
0899     void endProcessBlockProduce(edm::ProcessBlock&) override;
0900 
0901   private:
0902     edm::EDPutTokenT<IntProduct> token_;
0903     edm::EDPutToken token2_;
0904     edm::EDPutTokenT<IntProduct> token3_;
0905     edm::EDPutToken token4_;
0906     int value_;
0907   };
0908 
0909   void IntProducerEndProcessBlock::endProcessBlockProduce(edm::ProcessBlock& processBlock) {
0910     processBlock.emplace(token_, value_);
0911     processBlock.emplace<IntProduct>(token2_, value_ + 2);
0912     processBlock.put(token3_, std::make_unique<IntProduct>(value_ + 3));
0913     processBlock.put(token4_, std::make_unique<IntProduct>(value_ + 4));
0914   }
0915 
0916   //--------------------------------------------------------------------
0917   //
0918   // Produces an TransientIntProduct in ProcessBlock at endProcessBlock
0919   //
0920   class TransientIntProducerEndProcessBlock : public edm::global::EDProducer<edm::EndProcessBlockProducer> {
0921   public:
0922     explicit TransientIntProducerEndProcessBlock(edm::ParameterSet const& p)
0923         : token_{produces<TransientIntProduct, edm::Transition::EndProcessBlock>()},
0924           value_(p.getParameter<int>("ivalue")) {}
0925     void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {}
0926     void endProcessBlockProduce(edm::ProcessBlock&) override;
0927 
0928   private:
0929     edm::EDPutTokenT<TransientIntProduct> token_;
0930     int value_;
0931   };
0932 
0933   void TransientIntProducerEndProcessBlock::endProcessBlockProduce(edm::ProcessBlock& processBlock) {
0934     processBlock.emplace(token_, value_);
0935   }
0936 
0937   //--------------------------------------------------------------------
0938   //
0939   // Produces an IntProduct instance, the module must get run, otherwise an exception is thrown
0940   class MustRunIntProducer : public edm::global::EDProducer<> {
0941   public:
0942     explicit MustRunIntProducer(edm::ParameterSet const& p)
0943         : moduleLabel_{p.getParameter<std::string>("@module_label")},
0944           token_{produces<IntProduct>()},
0945           value_(p.getParameter<int>("ivalue")),
0946           produce_{p.getParameter<bool>("produce")},
0947           mustRunEvent_{p.getParameter<bool>("mustRunEvent")} {}
0948     ~MustRunIntProducer() {
0949       if (not wasRunEndJob_) {
0950         throw cms::Exception("NotRun") << "This module (" << moduleLabel_
0951                                        << ") should have run for endJob transition, but it did not";
0952       }
0953     }
0954     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0955       edm::ParameterSetDescription desc;
0956       desc.add<int>("ivalue");
0957       desc.add<bool>("produce", true);
0958       desc.add<bool>("mustRunEvent", true)
0959           ->setComment(
0960               "If set to false, the endJob() is still required to be called to check that the module was not deleted "
0961               "early on");
0962       descriptions.addDefault(desc);
0963     }
0964     void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override {
0965       wasRunEvent_ = true;
0966       if (produce_) {
0967         e.emplace(token_, value_);
0968       }
0969     }
0970     void endJob() override {
0971       wasRunEndJob_ = true;
0972       if (mustRunEvent_ and not wasRunEvent_) {
0973         throw cms::Exception("NotRun") << "This module should have run for event transitions, but it did not";
0974       }
0975     }
0976 
0977   private:
0978     const std::string moduleLabel_;
0979     const edm::EDPutTokenT<IntProduct> token_;
0980     const int value_;
0981     const bool produce_;
0982     const bool mustRunEvent_;
0983     mutable std::atomic<bool> wasRunEndJob_ = false;
0984     mutable std::atomic<bool> wasRunEvent_ = false;
0985   };
0986 }  // namespace edmtest
0987 
0988 namespace edm::test {
0989   namespace other {
0990     class IntProducer : public edm::global::EDProducer<> {
0991     public:
0992       explicit IntProducer(edm::ParameterSet const& p)
0993           : token_{produces()}, value_(p.getParameter<int>("valueOther")) {}
0994       void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final { e.emplace(token_, value_); }
0995 
0996       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0997         edm::ParameterSetDescription desc;
0998         desc.add<int>("valueOther");
0999         desc.add<int>("valueCpu");
1000         desc.addUntracked<std::string>("variant", "");
1001 
1002         descriptions.addWithDefaultLabel(desc);
1003       }
1004 
1005     private:
1006       edm::EDPutTokenT<edmtest::IntProduct> token_;
1007       int value_;
1008     };
1009 
1010     class IntTransformer : public edm::global::EDProducer<edm::Transformer> {
1011     public:
1012       explicit IntTransformer(edm::ParameterSet const& p)
1013           : token_{produces()}, value_(p.getParameter<int>("valueOther")) {
1014         registerTransform(token_, [](edm::StreamID, edmtest::ATransientIntProduct const& iV) {
1015           return edmtest::IntProduct(iV.value);
1016         });
1017       }
1018       void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final { e.emplace(token_, value_); }
1019 
1020       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
1021         edm::ParameterSetDescription desc;
1022         desc.add<int>("valueOther");
1023         desc.add<int>("valueCpu");
1024         desc.addUntracked<std::string>("variant", "");
1025 
1026         descriptions.addWithDefaultLabel(desc);
1027       }
1028 
1029     private:
1030       edm::EDPutTokenT<edmtest::ATransientIntProduct> token_;
1031       int value_;
1032     };
1033   }  // namespace other
1034   namespace cpu {
1035     class IntProducer : public edm::global::EDProducer<> {
1036     public:
1037       explicit IntProducer(edm::ParameterSet const& p) : token_{produces()}, value_(p.getParameter<int>("valueCpu")) {}
1038       void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final { e.emplace(token_, value_); }
1039 
1040       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
1041         edm::ParameterSetDescription desc;
1042         desc.add<int>("valueOther");
1043         desc.add<int>("valueCpu");
1044         desc.addUntracked<std::string>("variant", "");
1045 
1046         descriptions.addWithDefaultLabel(desc);
1047       }
1048 
1049     private:
1050       edm::EDPutTokenT<edmtest::IntProduct> token_;
1051       int value_;
1052     };
1053     // The idea is that the other::IntTransformer produces an
1054     // additional *transient* data product compared to
1055     // cpu::IntTransformer. The cpu::IntTransformer would be
1056     // functionally equivalent to cpu::IntProducer, so can simply use
1057     // a type alias.
1058     using IntTransformer = IntProducer;
1059   }  // namespace cpu
1060 }  // namespace edm::test
1061 
1062 using edmtest::AddAllIntsProducer;
1063 using edmtest::AddIntsProducer;
1064 using edmtest::BusyWaitIntLimitedProducer;
1065 using edmtest::BusyWaitIntOneSharedProducer;
1066 using edmtest::BusyWaitIntProducer;
1067 using edmtest::ConsumingIntProducer;
1068 using edmtest::EventNumberIntProducer;
1069 using edmtest::FailingProducer;
1070 using edmtest::Int16_tProducer;
1071 using edmtest::IntOneSharedProducer;
1072 using edmtest::IntProducer;
1073 using edmtest::IntProducerBeginProcessBlock;
1074 using edmtest::IntProducerEndProcessBlock;
1075 using edmtest::IntProducerFromTransient;
1076 using edmtest::ManyIntProducer;
1077 using edmtest::ManyIntWhenRegisteredProducer;
1078 using edmtest::NonEventIntProducer;
1079 using edmtest::NonProducer;
1080 using edmtest::TransientIntProducer;
1081 using edmtest::TransientIntProducerEndProcessBlock;
1082 DEFINE_FWK_MODULE(FailingProducer);
1083 DEFINE_FWK_MODULE(edmtest::FailingInLumiProducer);
1084 DEFINE_FWK_MODULE(edmtest::FailingInRunProducer);
1085 DEFINE_FWK_MODULE(NonProducer);
1086 DEFINE_FWK_MODULE(IntProducer);
1087 DEFINE_FWK_MODULE(IntOneSharedProducer);
1088 DEFINE_FWK_MODULE(BusyWaitIntProducer);
1089 DEFINE_FWK_MODULE(BusyWaitIntLimitedProducer);
1090 DEFINE_FWK_MODULE(BusyWaitIntOneSharedProducer);
1091 DEFINE_FWK_MODULE(ConsumingIntProducer);
1092 DEFINE_FWK_MODULE(EventNumberIntProducer);
1093 DEFINE_FWK_MODULE(TransientIntProducer);
1094 DEFINE_FWK_MODULE(IntProducerFromTransient);
1095 DEFINE_FWK_MODULE(edmtest::TransientIntParentProducer);
1096 DEFINE_FWK_MODULE(edmtest::IntProducerFromTransientParent);
1097 DEFINE_FWK_MODULE(Int16_tProducer);
1098 DEFINE_FWK_MODULE(AddIntsProducer);
1099 DEFINE_FWK_MODULE(AddAllIntsProducer);
1100 DEFINE_FWK_MODULE(ManyIntProducer);
1101 DEFINE_FWK_MODULE(ManyIntWhenRegisteredProducer);
1102 DEFINE_FWK_MODULE(NonEventIntProducer);
1103 DEFINE_FWK_MODULE(IntProducerBeginProcessBlock);
1104 DEFINE_FWK_MODULE(IntProducerEndProcessBlock);
1105 DEFINE_FWK_MODULE(TransientIntProducerEndProcessBlock);
1106 DEFINE_FWK_MODULE(edmtest::MustRunIntProducer);
1107 DEFINE_FWK_MODULE(edm::test::other::IntProducer);
1108 DEFINE_FWK_MODULE(edm::test::cpu::IntProducer);
1109 DEFINE_FWK_MODULE(edm::test::other::IntTransformer);
1110 DEFINE_FWK_MODULE(edm::test::cpu::IntTransformer);