#include <MCFileSource.h>
Public Member Functions | |
MCFileSource (const ParameterSet &pset, const InputSourceDescription &desc) | |
virtual | ~MCFileSource () |
Private Member Functions | |
void | clear () |
virtual bool | produce (Event &e) |
Private Attributes | |
HepMC::GenEvent * | evt_ |
HepMCFileReader * | reader_ |
bool | useExtendedAscii_ |
Definition at line 23 of file MCFileSource.h.
MCFileSource::MCFileSource | ( | const ParameterSet & | pset, |
const InputSourceDescription & | desc | ||
) |
Definition at line 30 of file MCFileSource.cc.
References convertXMLtoSQLite_cfg::fileName, edm::ExternalInputSource::fileNames(), HepMCFileReader::initialize(), and reader_.
: ExternalInputSource(pset, desc), reader_(HepMCFileReader::instance()), evt_(0) { edm::LogInfo("MCFileSource") << "Reading HepMC file:" << fileNames()[0]; string fileName = fileNames()[0]; // strip the file: if (fileName.find("file:") == 0){ fileName.erase(0,5); } reader_->initialize(fileName); produces<HepMCProduct>(); }
MCFileSource::~MCFileSource | ( | ) | [virtual] |
Definition at line 47 of file MCFileSource.cc.
{ }
void edm::MCFileSource::clear | ( | ) | [private] |
bool MCFileSource::produce | ( | Event & | e | ) | [private, virtual] |
Implements edm::ConfigurableInputSource.
Definition at line 52 of file MCFileSource.cc.
References evt_, HepMCFileReader::fillCurrentEventData(), edm::Event::put(), and reader_.
{ // Read one HepMC event and store it in the Event. auto_ptr<HepMCProduct> bare_product(new HepMCProduct()); edm::LogInfo("MCFileSource") << "Start Reading"; evt_ = reader_->fillCurrentEventData(); if (evt_ == 0) return false; bare_product->addHepMCData(evt_); e.put(bare_product); return true; }
HepMC::GenEvent* edm::MCFileSource::evt_ [private] |
Definition at line 33 of file MCFileSource.h.
Referenced by produce().
HepMCFileReader* edm::MCFileSource::reader_ [private] |
Definition at line 32 of file MCFileSource.h.
Referenced by MCFileSource(), and produce().
bool edm::MCFileSource::useExtendedAscii_ [private] |
Definition at line 34 of file MCFileSource.h.