|
SLIC
6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
|
An EventSource with an associated input file, such as StdHep or LCIO event files. More...
#include <EventSourceWithInputFile.hh>
Public Member Functions | |
| virtual | ~EventSourceWithInputFile () |
| void | beginEvent (const G4Event *event) |
| void | beginRun (const G4Run *run) |
| virtual void | close ()=0 |
| const std::string & | getFilename () |
| bool | isEOF () |
| virtual void | open ()=0 |
| virtual void | printCurrentEvent ()=0 |
| virtual void | readNextEvent ()=0 |
| void | reset () |
| void | setFilename (const std::string &filename) |
| unsigned int | skipEvents (unsigned int nevents) |
Public Member Functions inherited from EventSource | |
| virtual | ~EventSource () |
| virtual void | endEvent (const G4Event *event) |
| virtual void | endRun (const G4Run *run) |
| virtual void | generate (G4Event *event)=0 |
Public Member Functions inherited from Module | |
| virtual | ~Module () |
| virtual void | cleanup () |
| bool | deleteOnExit () |
| const std::string & | getName () const |
| ModuleStatus | getStatus () const |
| virtual void | initialize () |
| LogStream & | log () |
| virtual void | postTracking (const G4Track *) |
| virtual void | preTracking (const G4Track *) |
| virtual void | stepping (const G4Step *) |
Protected Member Functions | |
| EventSourceWithInputFile (const std::string &name, const std::string &filename="") | |
Protected Member Functions inherited from EventSource | |
| EventSource (const std::string &name) | |
Protected Member Functions inherited from Module | |
| Module (const std::string &name, bool deleteOnExit=true, bool autoRegister=true) | |
Protected Attributes | |
| bool | m_eof |
| bool | m_fileIsNew |
| bool | m_fileIsOpen |
| bool | m_fileIsSet |
| std::string | m_filename |
Additional Inherited Members | |
Public Types inherited from Module | |
| enum | ModuleStatus { eOkay = 0 , eNotInitialized = 1 , eBadState = 2 , eFatalError = 3 } |
Public Attributes inherited from Module | |
| bool | m_deleteOnExit |
| LogStream * | m_log |
| std::string | m_name |
| ModuleStatus | m_status |
An EventSource with an associated input file, such as StdHep or LCIO event files.
Definition at line 15 of file EventSourceWithInputFile.hh.
|
inlineprotected |
Class constructor.
| [in] | name | The name of the source. |
| [in] | filename | The file name of the source. |
Definition at line 24 of file EventSourceWithInputFile.hh.
|
inlinevirtual |
Class destructor.
Definition at line 33 of file EventSourceWithInputFile.hh.
|
virtual |
Begin of event hook.
| [in] | event | The Geant4 event. |
Reimplemented from EventSource.
Reimplemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
Definition at line 64 of file EventSourceWithInputFile.cc.
References EventSourceWithInputFile::readNextEvent().
Referenced by LcioEventSource::beginEvent(), LHEEventSource::beginEvent(), and StdHepEventSource::beginEvent().
|
virtual |
Begin run hook.
| [in] | run | The Geant4 run. |
Reimplemented from EventSource.
Reimplemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
Definition at line 68 of file EventSourceWithInputFile.cc.
References LOG::done, EventSourceWithInputFile::getFilename(), Singleton< EventSourceManager >::instance(), Module::log(), EventSourceWithInputFile::m_fileIsNew, EventSourceWithInputFile::m_fileIsOpen, EventSourceWithInputFile::m_fileIsSet, LOG::okay, EventSourceWithInputFile::reset(), EventSourceWithInputFile::setFilename(), EventSourceWithInputFile::skipEvents(), and LOG::warning.
Referenced by LcioEventSource::beginRun(), LHEEventSource::beginRun(), and StdHepEventSource::beginRun().
|
pure virtual |
Close the file associated with the source.
Implemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
Referenced by EventSourceWithInputFile::reset().
| const std::string & getFilename | ( | ) |
Get the file name of the source.
Definition at line 30 of file EventSourceWithInputFile.cc.
References EventSourceWithInputFile::m_filename.
Referenced by EventSourceWithInputFile::beginRun(), LHEEventSource::open(), and StdHepEventSource::open().
| bool isEOF | ( | ) |
Check if the end of file has been reached.
Definition at line 60 of file EventSourceWithInputFile.cc.
References EventSourceWithInputFile::m_eof.
Referenced by EventSourceManager::isEOF(), and EventSourceWithInputFile::skipEvents().
|
pure virtual |
Open the file associated with the source.
Implemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
Referenced by EventSourceWithInputFile::reset().
|
pure virtual |
Dump the current event to std::cout.
Implements EventSource.
Implemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
|
pure virtual |
Read the next event.
Implemented in StdHepEventSource, LHEEventSource, and LcioEventSource.
Referenced by EventSourceWithInputFile::beginEvent(), and EventSourceWithInputFile::skipEvents().
|
virtual |
Reset the source back to the beginning of the file.
Reimplemented from EventSource.
Definition at line 34 of file EventSourceWithInputFile.cc.
References EventSourceWithInputFile::close(), EventSourceWithInputFile::m_eof, EventSourceWithInputFile::m_fileIsOpen, and EventSourceWithInputFile::open().
Referenced by EventSourceWithInputFile::beginRun().
| void setFilename | ( | const std::string & | filename | ) |
Set the file name of the source.
| [in] | filename | The file name. |
Definition at line 8 of file EventSourceWithInputFile.cc.
References LOG::done, LOG::error, FileUtil::fileExists(), Module::log(), EventSourceWithInputFile::m_fileIsNew, EventSourceWithInputFile::m_fileIsSet, and EventSourceWithInputFile::m_filename.
Referenced by EventSourceWithInputFile::beginRun().
|
virtual |
Skip a number of events in the source's file.
| [in] | nevents | The number of events to skip. |
Reimplemented from EventSource.
Definition at line 47 of file EventSourceWithInputFile.cc.
References EventSourceWithInputFile::isEOF(), and EventSourceWithInputFile::readNextEvent().
Referenced by EventSourceWithInputFile::beginRun().
|
protected |
Definition at line 104 of file EventSourceWithInputFile.hh.
Referenced by EventSourceWithInputFile::isEOF(), LcioEventSource::readNextEvent(), StdHepEventSource::readNextEvent(), and EventSourceWithInputFile::reset().
|
protected |
Definition at line 106 of file EventSourceWithInputFile.hh.
Referenced by EventSourceWithInputFile::beginRun(), and EventSourceWithInputFile::setFilename().
|
protected |
Definition at line 105 of file EventSourceWithInputFile.hh.
Referenced by EventSourceWithInputFile::beginRun(), LcioEventSource::close(), LHEEventSource::close(), StdHepEventSource::close(), LcioEventSource::open(), LHEEventSource::open(), StdHepEventSource::open(), and EventSourceWithInputFile::reset().
|
protected |
Definition at line 107 of file EventSourceWithInputFile.hh.
Referenced by EventSourceWithInputFile::beginRun(), and EventSourceWithInputFile::setFilename().
|
protected |
name of input file
Definition at line 101 of file EventSourceWithInputFile.hh.
Referenced by EventSourceWithInputFile::getFilename(), LcioEventSource::open(), and EventSourceWithInputFile::setFilename().