CMS 3D CMS Logo

HepMCCopy.cc
Go to the documentation of this file.
4 
6 
8 #include "HepMC/GenEvent.h"
9 
11  // This producer produces a HepMCProduct, a copy of the original one
12  produces<edm::HepMCProduct>();
13 }
14 
16  edm::Handle<edm::HepMCProduct> theHepMCProduct;
17  bool source = iEvent.getByLabel("generatorSmeared", theHepMCProduct);
18  if (!source) {
19  auto pu_product = std::make_unique<edm::HepMCProduct>();
20  iEvent.put(std::move(pu_product));
21  } else {
22  auto pu_product = std::make_unique<edm::HepMCProduct>(*theHepMCProduct);
23  iEvent.put(std::move(pu_product));
24  }
25 }
26 
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: HepMCCopy.cc:15
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
HepMCCopy(edm::ParameterSet const &p)
Definition: HepMCCopy.cc:10
static std::string const source
Definition: EdmProvDump.cc:47
def move(src, dest)
Definition: eostools.py:511