RecoParticleFlow
Configuration
plugins
HepMCCopy.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Event.h
"
2
#include "
FWCore/Framework/interface/MakerMacros.h
"
3
#include "
FWCore/ServiceRegistry/interface/Service.h
"
4
5
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
6
7
#include "
RecoParticleFlow/Configuration/plugins/HepMCCopy.h
"
8
#include "HepMC/GenEvent.h"
9
10
HepMCCopy::HepMCCopy
(
edm::ParameterSet
const
&
p
) {
11
// This producer produces a HepMCProduct, a copy of the original one
12
produces<edm::HepMCProduct>();
13
}
14
15
void
HepMCCopy::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& es) {
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
27
DEFINE_FWK_MODULE
(
HepMCCopy
);
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:58
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
Generated for CMSSW Reference Manual by
1.8.16