CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
HepMCCopy Class Reference

#include <HepMCCopy.h>

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

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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

11 {
12  // This producer produces a HepMCProduct, a copy of the original one
13  produces<edm::HepMCProduct>();
14 }
virtual HepMCCopy::~HepMCCopy ( )
inlinevirtual

Definition at line 16 of file HepMCCopy.h.

16 {}

Member Function Documentation

virtual void HepMCCopy::beginRun ( edm::Run ,
edm::EventSetup const &   
)
inlinevirtual

Reimplemented from edm::EDProducer.

Definition at line 17 of file HepMCCopy.h.

17 {}
virtual void HepMCCopy::endRun ( void  )
inlinevirtual

Definition at line 18 of file HepMCCopy.h.

18 {}
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.

17 {
18 
19  edm::Handle<edm::HepMCProduct> theHepMCProduct;
20  bool source = iEvent.getByLabel("generator",theHepMCProduct);
21  if ( !source ) {
22  std::auto_ptr<edm::HepMCProduct> pu_product(new edm::HepMCProduct());
23  iEvent.put(pu_product);
24  } else {
25  std::auto_ptr<edm::HepMCProduct> pu_product(new edm::HepMCProduct(*theHepMCProduct));
26  iEvent.put(pu_product);
27  }
28 
29 }
int iEvent
Definition: GenABIO.cc:243