#include <HepMCCopy.h>
Public Member Functions | |
virtual void | beginRun (edm::Run &, edm::EventSetup const &) |
virtual void | endRun () |
HepMCCopy (edm::ParameterSet const &p) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HepMCCopy () |
Definition at line 10 of file HepMCCopy.h.
HepMCCopy::HepMCCopy | ( | edm::ParameterSet const & | p | ) | [explicit] |
Definition at line 10 of file HepMCCopy.cc.
{
// This producer produces a HepMCProduct, a copy of the original one
produces<edm::HepMCProduct>();
}
virtual HepMCCopy::~HepMCCopy | ( | ) | [inline, virtual] |
Definition at line 16 of file HepMCCopy.h.
{}
virtual void HepMCCopy::beginRun | ( | edm::Run & | , |
edm::EventSetup const & | |||
) | [inline, virtual] |
virtual void HepMCCopy::endRun | ( | void | ) | [inline, virtual] |
Definition at line 18 of file HepMCCopy.h.
{}
void HepMCCopy::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 16 of file HepMCCopy.cc.
References edm::Event::getByLabel(), edm::Event::put(), and LaserTracksInput_cfi::source.
{ edm::Handle<edm::HepMCProduct> theHepMCProduct; bool source = iEvent.getByLabel("generator",theHepMCProduct); if ( !source ) { std::auto_ptr<edm::HepMCProduct> pu_product(new edm::HepMCProduct()); iEvent.put(pu_product); } else { std::auto_ptr<edm::HepMCProduct> pu_product(new edm::HepMCProduct(*theHepMCProduct)); iEvent.put(pu_product); } }