CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

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.

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

Definition at line 38 of file LHEWriter.cc.

{
}

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 filterCSVwithJSON::copy, and mergeVDriftHistosByStation::file.

{
        edm::Handle<LHEEventProduct> product;
        event.getByLabel("source", product);

        std::copy(product->begin(), product->end(),
                  std::ostream_iterator<std::string>(file));
}
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 filterCSVwithJSON::copy, mergeVDriftHistosByStation::file, edm::Run::getByLabel(), dbtoconf::out, and estimatePileup_makeJSON::trunc.

{
        edm::Handle<LHERunInfoProduct> product;
        run.getByLabel("source", product);

        file.open("writer.lhe", std::fstream::out | std::fstream::trunc);
        std::copy(product->begin(), product->end(),
                  std::ostream_iterator<std::string>(file));
}
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 mergeVDriftHistosByStation::file.


Member Data Documentation

std::ofstream LHEWriter::file [private]

Definition at line 31 of file LHEWriter.cc.