CMS 3D CMS Logo

LHEWriter Class Reference

Inheritance diagram for LHEWriter:

edm::EDAnalyzer

List of all members.

Public Member Functions

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

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

std::ofstream file


Detailed Description

Definition at line 20 of file LHEWriter.cc.


Constructor & Destructor Documentation

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

Definition at line 34 of file LHEWriter.cc.

00035 {
00036 }

LHEWriter::~LHEWriter (  )  [virtual]

Definition at line 38 of file LHEWriter.cc.

00039 {
00040 }


Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 58 of file LHEWriter.cc.

References edmNew::copy(), and file.

00059 {
00060         edm::Handle<LHEEventProduct> product;
00061         event.getByLabel("source", product);
00062 
00063         std::copy(product->begin(), product->end(),
00064                   std::ostream_iterator<std::string>(file));
00065 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 42 of file LHEWriter.cc.

References edmNew::copy(), file, edm::DataViewImpl::getByLabel(), and out.

00043 {
00044         edm::Handle<LHERunInfoProduct> product;
00045         run.getByLabel("source", product);
00046 
00047         file.open("writer.lhe", std::fstream::out | std::fstream::trunc);
00048         std::copy(product->begin(), product->end(),
00049                   std::ostream_iterator<std::string>(file));
00050 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file LHEWriter.cc.

References LHERunInfoProduct::endOfFile(), and file.

00053 {
00054         file << LHERunInfoProduct::endOfFile();
00055         file.close();
00056 }


Member Data Documentation

std::ofstream LHEWriter::file [private]

Definition at line 31 of file LHEWriter.cc.

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


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:44 2009 for CMSSW by  doxygen 1.5.4