MarlinMT
0.1.0
|
LCIOFileSource class. More...
Inherits marlinmt::DataSourcePlugin.
Public Member Functions | |
LCIOFileSource () | |
~LCIOFileSource ()=default | |
void | initialize () override |
Init data source. More... | |
bool | readOne () override |
Read one record from the input stream. More... | |
![]() | |
virtual | ~DataSourcePlugin ()=default |
DataSourcePlugin (const std::string &dstype) | |
Constructor. More... | |
const std::string & | type () const |
Get the data source type. More... | |
const std::string & | description () const |
Get the data source description. More... | |
virtual void | readAll () |
Read the full stream until the end See readOne() for details. More... | |
void | onEventRead (EventFunction func) |
Set the callback function to process on event read. More... | |
void | onRunHeaderRead (RunHeaderFunction func) |
Set the callback function to process on run header read. More... | |
![]() | |
Component ()=delete | |
No default constructor. More... | |
Component (const Component &)=delete | |
No copy or assignement. More... | |
Component & | operator= (const Component &)=delete |
virtual | ~Component ()=default |
Default destructor. More... | |
Component (const std::string &type) | |
Constructor with component type. More... | |
const std::string & | type () const |
Get the component name. More... | |
const std::string & | name () const |
Get the component name. More... | |
void | setName (const std::string &n) |
Set the component name. More... | |
const std::string & | description () const |
Get the component description. More... | |
void | setDescription (const std::string &desc) |
Set the component description. More... | |
const Application & | application () const |
Get the application in which the component is registered. More... | |
Application & | application () |
Get the application in which the component is registered. More... | |
template<class T > | |
Logging::StreamType | log () const |
Log a message with specific log level. More... | |
Logging::StreamType | debug () const |
Shortcut for log<DEBUG>() More... | |
Logging::StreamType | message () const |
Shortcut for log<MESSAGE>() More... | |
Logging::StreamType | warning () const |
Shortcut for log<WARNING>() More... | |
Logging::StreamType | error () const |
Shortcut for log<ERROR>() More... | |
void | setVerbosity (const std::string &level) |
Set the verbosity level. More... | |
const std::string & | verbosity () const |
Get the verbosity level. More... | |
bool | isInitialized () const |
Whether the component has been initialized. More... | |
void | setup (Application *app) |
Setup the component. More... | |
void | printParameters () const |
Print the component parameters. More... | |
template<class T > | |
void | printParameters () const |
Print the component parameters at specific verbosity. More... | |
void | setParameters (const ConfigSection §ion, bool throwIfNotFound=false) |
Set the parameters from the configuration section. More... | |
void | getParameters (ConfigSection §ion, const std::set< std::string > &exclude={}) const |
Get the parameters from configurable object and populate the config section with. More... | |
![]() | |
Configurable ()=default | |
virtual | ~Configurable ()=default |
template<typename T > | |
std::shared_ptr< ParameterImpl > | addParameter (EParameterType paramType, const std::string &name, const std::string &desc, std::shared_ptr< T > value) |
Add a parameter. More... | |
template<typename T > | |
std::shared_ptr< ParameterImpl > | addParameter (EParameterType paramType, const std::string &name, const std::string &desc, std::shared_ptr< T > value, T defVal) |
Add a parameter. More... | |
template<typename T > | |
T | parameter (const std::string &name) const |
Get a parameter value. More... | |
template<typename T > | |
T | parameter (const std::string &name, const T &fallback) const |
Get a parameter value. More... | |
void | checkParameter (const std::string &name) const |
Check if the parameter has been registered. More... | |
bool | exists (const std::string &name) const |
Return true if the parameter has been registered. More... | |
bool | isSet (const std::string &name) const |
Returns true if the parameter exists and is set, false otherwise. More... | |
void | clear () |
Remove all parameters. More... | |
void | unset () |
Unset all registered parameters. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Private Types | |
using | FileReader = MT::LCReader |
using | FileReaderPtr = std::shared_ptr< FileReader > |
Private Member Functions | |
void | onLCEventRead (std::shared_ptr< EVENT::LCEvent > event) |
void | onLCRunHeaderRead (std::shared_ptr< EVENT::LCRunHeader > rhdr) |
Private Attributes | |
StringVectorParameter | _inputFileNames |
IntParameter | _maxRecordNumber |
IntParameter | _skipNEvents |
StringVectorParameter | _readCollectionNames |
BoolParameter | _lazyUnpack |
The LCIO file listener. More... | |
ReaderListener | _listener {} |
The LCIO file reader. More... | |
FileReaderPtr | _fileReader {nullptr} |
The current number of read records. More... | |
int | _currentReadRecords {0} |
Additional Inherited Members | |
![]() | |
using | EventFunction = std::function< void(std::shared_ptr< EventStore >)> |
using | RunHeaderFunction = std::function< void(std::shared_ptr< RunHeader >)> |
![]() | |
using | LoggerPtr = Logging::Logger |
![]() | |
using | ParameterMap = std::map< std::string, std::shared_ptr< ParameterImpl > > |
using | iterator = ParameterMap::iterator |
using | const_iterator = ParameterMap::const_iterator |
![]() | |
void | processRunHeader (std::shared_ptr< RunHeader > rhdr) |
Must be called by daughter classes in readStream() to process an event in the framework. More... | |
void | processEvent (std::shared_ptr< EventStore > event) |
Must be called by daughter classes in readStream() to process an event in the framework. More... | |
![]() | |
std::string | _description {"No description"} |
< The data source description More... | |
![]() | |
std::string | _type {} |
The component type. More... | |
std::string | _name {} |
The component name. More... | |
std::string | _description {"No description"} |
The component description. More... | |
Application * | _application {nullptr} |
The application in which the component has been registered. More... | |
LoggerPtr | _logger {nullptr} |
The logger instance. More... | |
StringParameter | _verbosity { *this, "Verbosity", "The component verbosity level", "MESSAGE" } |
The verbosity level of the logger (parameter) More... | |
![]() | |
ParameterMap | _parameters {} |
The parameter map. More... | |
LCIOFileSource class.
Definition at line 30 of file LCIOFileSource.cc.
|
private |
Definition at line 31 of file LCIOFileSource.cc.
|
private |
Definition at line 32 of file LCIOFileSource.cc.
marlinmt::LCIOFileSource::LCIOFileSource | ( | ) |
Definition at line 73 of file LCIOFileSource.cc.
References marlinmt::Component::setDescription().
|
default |
|
overridevirtual |
Init data source.
Reimplemented from marlinmt::DataSourcePlugin.
Definition at line 80 of file LCIOFileSource.cc.
References _fileReader, _inputFileNames, _lazyUnpack, _listener, _readCollectionNames, _skipNEvents, marlinmt::VectorParameter< T >::empty(), marlinmt::DataSourcePlugin::initialize(), marlinmt::ReaderListener::onEventRead(), marlinmt::ReaderListener::onRunHeaderRead(), marlinmt::DataSourcePlugin::processEvent(), and marlinmt::DataSourcePlugin::processRunHeader().
|
private |
|
private |
|
overridevirtual |
Read one record from the input stream.
Users must call processRunHeader() or processEvent() to forward it to the framework. Returns true on success. If the end of the stream is reached, return false.
Implements marlinmt::DataSourcePlugin.
Definition at line 113 of file LCIOFileSource.cc.
References _currentReadRecords, _fileReader, _listener, _maxRecordNumber, and MARLINMT_DECLARE_DATASOURCE_NAME.
|
private |
Definition at line 67 of file LCIOFileSource.cc.
Referenced by readOne().
|
private |
The current number of read records.
Definition at line 65 of file LCIOFileSource.cc.
Referenced by initialize(), and readOne().
|
private |
Definition at line 47 of file LCIOFileSource.cc.
Referenced by initialize().
|
private |
The LCIO file listener.
Definition at line 59 of file LCIOFileSource.cc.
Referenced by initialize().
|
private |
The LCIO file reader.
Definition at line 63 of file LCIOFileSource.cc.
Referenced by initialize(), and readOne().
|
private |
Definition at line 50 of file LCIOFileSource.cc.
Referenced by readOne().
|
private |
Definition at line 56 of file LCIOFileSource.cc.
Referenced by initialize().
|
private |
Definition at line 53 of file LCIOFileSource.cc.
Referenced by initialize().