CMS 3D CMS Logo

Public Member Functions

HepMCCopy Class Reference

#include <HepMCCopy.h>

Inheritance diagram for HepMCCopy:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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 ()

Detailed Description

Definition at line 10 of file HepMCCopy.h.


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

virtual void HepMCCopy::beginRun ( edm::Run ,
edm::EventSetup const &   
) [inline, virtual]

Reimplemented from edm::EDProducer.

Definition at line 17 of file HepMCCopy.h.

{}
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);
  }

}