CMS 3D CMS Logo

BranchIDListsModifierProducer.cc
Go to the documentation of this file.
4 
8 
10 
11 #include "DataFormats/TestObjects/interface/ToyProducts.h"
12 
14 public:
16 
17  void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const;
18 
20 
21 private:
24  bool const extraProduct_;
25 };
26 
28  : token_(produces()), extraProduct_(iPSet.getUntrackedParameter<bool>("makeExtraProduct")) {
29  if (extraProduct_) {
30  extraToken_ = produces("extra");
31  }
32 }
33 
35  iEvent.emplace(token_, 1);
36  if (extraProduct_) {
37  iEvent.emplace(extraToken_, 2);
38  }
39 }
40 
43  ps.setComment(
44  "Module which can cause the BranchIDLists to change even when the top level PSet remains the same.\n"
45  "Used for multi-file merge tests.");
46 
47  ps.addUntracked<bool>("makeExtraProduct", false)->setComment("If set to true will produce an extra product");
48 
49  iDesc.addDefault(ps);
50 }
51 
static void fillDescriptions(edm::ConfigurationDescriptions &iDesc)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
BranchIDListsModifierProducer(edm::ParameterSet const &iPSet)
void setComment(std::string const &value)
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const
edm::EDPutTokenT< int > const token_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::EDPutTokenT< edmtest::ATransientIntProduct > extraToken_