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 
HepMCCopy::HepMCCopy
HepMCCopy(edm::ParameterSet const &p)
Definition: HepMCCopy.cc:10
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::Handle< edm::HepMCProduct >
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
source
static const std::string source
Definition: EdmProvDump.cc:47
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
HepMCCopy::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: HepMCCopy.cc:15
HepMCProduct.h
edm::Event
Definition: Event.h:73
HepMCCopy
Definition: HepMCCopy.h:10
HepMCCopy.h