CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

HepMCEventWriter Class Reference

Inheritance diagram for HepMCEventWriter:
edm::EDAnalyzer

List of all members.

Public Member Functions

 HepMCEventWriter (const edm::ParameterSet &params)
virtual ~HepMCEventWriter ()

Protected Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &es)
virtual void beginRun (const edm::Run &run, const edm::EventSetup &es)
virtual void endRun (const edm::Run &run, const edm::EventSetup &es)

Private Attributes

HepMC::IO_GenEvent * _output

Detailed Description

Definition at line 20 of file HepMCEventWriter.cc.


Constructor & Destructor Documentation

HepMCEventWriter::HepMCEventWriter ( const edm::ParameterSet params) [explicit]

Definition at line 35 of file HepMCEventWriter.cc.

{
}
HepMCEventWriter::~HepMCEventWriter ( ) [virtual]

Definition at line 39 of file HepMCEventWriter.cc.

{
}

Member Function Documentation

void HepMCEventWriter::analyze ( const edm::Event event,
const edm::EventSetup es 
) [protected, virtual]

Implements edm::EDAnalyzer.

Definition at line 56 of file HepMCEventWriter.cc.

References _output.

{

  edm::Handle<edm::HepMCProduct> product;
  event.getByType( product );
  
  const HepMC::GenEvent* evt = product->GetEvent();

  _output->write_event(evt);

}
void HepMCEventWriter::beginRun ( const edm::Run run,
const edm::EventSetup es 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file HepMCEventWriter.cc.

References _output, and dbtoconf::out.

{

  _output = new HepMC::IO_GenEvent("GenEvent_ASCII.dat",std::ios::out);

}
void HepMCEventWriter::endRun ( const edm::Run run,
const edm::EventSetup es 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 51 of file HepMCEventWriter.cc.

References _output.

{
  if (_output) delete _output;
}

Member Data Documentation

HepMC::IO_GenEvent* HepMCEventWriter::_output [private]

Definition at line 31 of file HepMCEventWriter.cc.

Referenced by analyze(), beginRun(), and endRun().