#include <MCFileSource.h>
Public Member Functions | |
MCFileSource (const ParameterSet &pset, const InputSourceDescription &desc) | |
virtual | ~MCFileSource () |
Private Member Functions | |
void | clear () |
virtual void | produce (Event &e) |
virtual bool | setRunAndEventInfo (EventID &, TimeValue_t &time) |
Private Attributes | |
HepMC::GenEvent * | evt_ |
HepMCFileReader * | reader_ |
bool | useExtendedAscii_ |
Definition at line 25 of file MCFileSource.h.
MCFileSource::MCFileSource | ( | const ParameterSet & | pset, |
const InputSourceDescription & | desc | ||
) |
Definition at line 25 of file MCFileSource.cc.
References convertXMLtoSQLite_cfg::fileName, edm::ProducerSourceFromFiles::fileNames(), HepMCFileReader::initialize(), reader_, and AlCaHLTBitMon_QueryRunRegistry::string.
: ProducerSourceFromFiles(pset, desc, false), reader_(HepMCFileReader::instance()), evt_(0) { LogInfo("MCFileSource") << "Reading HepMC file:" << fileNames()[0]; std::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 42 of file MCFileSource.cc.
{ }
void edm::MCFileSource::clear | ( | ) | [private] |
void MCFileSource::produce | ( | Event & | e | ) | [private, virtual] |
Implements edm::ProducerSourceBase.
Definition at line 54 of file MCFileSource.cc.
References evt_, and edm::Event::put().
{ // Store one HepMC event in the Event. std::auto_ptr<HepMCProduct> bare_product(new HepMCProduct()); bare_product->addHepMCData(evt_); e.put(bare_product); }
bool MCFileSource::setRunAndEventInfo | ( | EventID & | , |
TimeValue_t & | time | ||
) | [private, virtual] |
Implements edm::ProducerSourceBase.
Definition at line 46 of file MCFileSource.cc.
References evt_, HepMCFileReader::fillCurrentEventData(), and reader_.
{ // Read one HepMC event LogInfo("MCFileSource") << "Start Reading"; evt_ = reader_->fillCurrentEventData(); return(evt_ != nullptr); }
HepMC::GenEvent* edm::MCFileSource::evt_ [private] |
Definition at line 36 of file MCFileSource.h.
Referenced by produce(), and setRunAndEventInfo().
HepMCFileReader* edm::MCFileSource::reader_ [private] |
Definition at line 35 of file MCFileSource.h.
Referenced by MCFileSource(), and setRunAndEventInfo().
bool edm::MCFileSource::useExtendedAscii_ [private] |
Definition at line 37 of file MCFileSource.h.