MarlinMT  0.1.0
marlinmt::LCIOOutputProcessor Class Reference

Default output processor. More...

Inherits marlinmt::Processor.

Public Member Functions

 LCIOOutputProcessor ()
 
 LCIOOutputProcessor (const LCIOOutputProcessor &)=delete
 
LCIOOutputProcessoroperator= (const LCIOOutputProcessor &)=delete
 
 ~LCIOOutputProcessor ()=default
 
void init ()
 Open the LCIO outputfile. More...
 
void processRunHeader (RunHeader *run)
 Write every run header. More...
 
void processEvent (EventStore *evt)
 Write every event. More...
 
void end ()
 Close outputfile. More...
 
- Public Member Functions inherited from marlinmt::Processor
virtual ~Processor ()=default
 
 Processor (const std::string &t)
 Constructor. More...
 
std::optional< bool > runtimeOption (ERuntimeOption option) const
 Get the forced runtime option settings. More...
 
- Public Member Functions inherited from marlinmt::Component
 Component ()=delete
 No default constructor. More...
 
 Component (const Component &)=delete
 No copy or assignement. More...
 
Componentoperator= (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 Applicationapplication () const
 Get the application in which the component is registered. More...
 
Applicationapplication ()
 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 &section, bool throwIfNotFound=false)
 Set the parameters from the configuration section. More...
 
void getParameters (ConfigSection &section, const std::set< std::string > &exclude={}) const
 Get the parameters from configurable object and populate the config section with. More...
 
- Public Member Functions inherited from marlinmt::Configurable
 Configurable ()=default
 
virtual ~Configurable ()=default
 
template<typename T >
std::shared_ptr< ParameterImpladdParameter (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< ParameterImpladdParameter (EParameterType paramType, const std::string &name, const std::string &desc, std::shared_ptr< T > value, T defVal)
 Add a parameter. More...
 
template<typename T >
parameter (const std::string &name) const
 Get a parameter value. More...
 
template<typename 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

typedef std::vector< IMPL::LCCollectionVec *> SubSetVec
 
typedef std::shared_ptr< MT::LCWriter > Writer
 

Private Member Functions

std::set< std::string > getWriteCollections (EVENT::LCEvent *evt) const
 

Private Attributes

StringParameter _lcioOutputFile
 
StringParameter _lcioWriteMode
 
StringVectorParameter _dropCollectionNames
 
StringVectorParameter _dropCollectionTypes
 
StringVectorParameter _keepCollectionNames
 
Writer _writer {nullptr}
 
std::atomic< int > _nRuns {0}
 
std::atomic< int > _nEvents {0}
 

Additional Inherited Members

- Public Types inherited from marlinmt::Processor
enum  ERuntimeOption { ERuntimeOption::eCritical, ERuntimeOption::eClone }
 ERuntimeOption enumerator. More...
 
using RuntimeOptions = std::map< ERuntimeOption, bool >
 
- Public Types inherited from marlinmt::Component
using LoggerPtr = Logging::Logger
 
- Public Types inherited from marlinmt::Configurable
using ParameterMap = std::map< std::string, std::shared_ptr< ParameterImpl > >
 
using iterator = ParameterMap::iterator
 
using const_iterator = ParameterMap::const_iterator
 
- Protected Member Functions inherited from marlinmt::Processor
void setRuntimeOption (ERuntimeOption option, bool value)
 Force the runtime option to a given boolean value. More...
 
- Protected Attributes inherited from marlinmt::Component
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...
 
- Protected Attributes inherited from marlinmt::Configurable
ParameterMap _parameters {}
 The parameter map. More...
 

Detailed Description

Default output processor.

If active every event is writen to the specified LCIO file. Make sure that the processor is the last one in your list of active processors. You can optionally drop some collections from the event before it gets written to the file, e.g. you can drop all collections of types SimCalorimeterHit and SimTrackerHit. It is the users responsibility to check whether the droped objects are still referenced by other objects (e.g. LCRelations) and drop those collections as well - if needed. If CalorimeterHit and TrackerHit objects are droped then Tracks and clusters will be store w/o pointers to hits.

Output

file containing the LCIO events

Parameters
LCIOOutputFilename of outputfile incl. path
LCIOWriteModeWRITE_NEW, WRITE_APPEND [optional]
DropCollectionNamesname of collections to be droped [optional]
DropCollectionTypestype of collections to be droped [optional]
DropCollectionNamesdrops the named collections from the event
DropCollectionTypesdrops all collections of the given type from the event
LCIOOutputFilename of output file
LCIOWriteModewrite mode for output file: WRITE_APPEND or WRITE_NEW
KeepCollectionNamesnames of collections that are to be kept unconditionally
fullSubsetCollectionsoptionally write all objects in subset collections to the file
Author
F. Gaede, DESY
Version
Id
LCIOOutputProcessor.h,v 1.8 2008-04-15 10:14:24 gaede Exp

Definition at line 53 of file LCIOOutputProcessor.cc.

Member Typedef Documentation

◆ SubSetVec

typedef std::vector< IMPL::LCCollectionVec* > marlinmt::LCIOOutputProcessor::SubSetVec
private

Definition at line 55 of file LCIOOutputProcessor.cc.

◆ Writer

typedef std::shared_ptr<MT::LCWriter> marlinmt::LCIOOutputProcessor::Writer
private

Definition at line 56 of file LCIOOutputProcessor.cc.

Constructor & Destructor Documentation

◆ LCIOOutputProcessor() [1/2]

marlinmt::LCIOOutputProcessor::LCIOOutputProcessor ( )

◆ LCIOOutputProcessor() [2/2]

marlinmt::LCIOOutputProcessor::LCIOOutputProcessor ( const LCIOOutputProcessor )
delete

◆ ~LCIOOutputProcessor()

marlinmt::LCIOOutputProcessor::~LCIOOutputProcessor ( )
default

Member Function Documentation

◆ end()

void marlinmt::LCIOOutputProcessor::end ( )
virtual

Close outputfile.

Reimplemented from marlinmt::Processor.

Definition at line 216 of file LCIOOutputProcessor.cc.

References _lcioOutputFile, _nEvents, _nRuns, _writer, MARLINMT_DECLARE_PROCESSOR, and marlinmt::Component::name().

◆ getWriteCollections()

std::set< std::string > marlinmt::LCIOOutputProcessor::getWriteCollections ( EVENT::LCEvent *  evt) const
private

◆ init()

void marlinmt::LCIOOutputProcessor::init ( )
virtual

Open the LCIO outputfile.

Reimplemented from marlinmt::Processor.

Definition at line 122 of file LCIOOutputProcessor.cc.

References _lcioOutputFile, _lcioWriteMode, _writer, and marlinmt::Component::printParameters().

◆ operator=()

LCIOOutputProcessor& marlinmt::LCIOOutputProcessor::operator= ( const LCIOOutputProcessor )
delete

◆ processEvent()

void marlinmt::LCIOOutputProcessor::processEvent ( EventStore evt)
virtual

Write every event.

Reimplemented from marlinmt::Processor.

Definition at line 204 of file LCIOOutputProcessor.cc.

References _nEvents, _writer, marlinmt::ProcessorApi::abort(), marlinmt::EventStore::event(), and getWriteCollections().

◆ processRunHeader()

Member Data Documentation

◆ _dropCollectionNames

StringVectorParameter marlinmt::LCIOOutputProcessor::_dropCollectionNames
private
Initial value:
{*this, "DropCollectionNames" ,
"drops the named collections from the event", {"TPCHits", "HCalHits"} }

Definition at line 90 of file LCIOOutputProcessor.cc.

Referenced by getWriteCollections().

◆ _dropCollectionTypes

StringVectorParameter marlinmt::LCIOOutputProcessor::_dropCollectionTypes
private
Initial value:
{*this, "DropCollectionTypes" ,
"drops all collections of the given type from the event", {"SimTrackerHit", "SimCalorimeterHit"} }

Definition at line 93 of file LCIOOutputProcessor.cc.

Referenced by getWriteCollections().

◆ _keepCollectionNames

StringVectorParameter marlinmt::LCIOOutputProcessor::_keepCollectionNames
private
Initial value:
{*this, "KeepCollectionNames" ,
"force keep of the named collections - overrules DropCollectionTypes (and DropCollectionNames)", {"MyPreciousSimTrackerHits"} }

Definition at line 96 of file LCIOOutputProcessor.cc.

Referenced by getWriteCollections().

◆ _lcioOutputFile

StringParameter marlinmt::LCIOOutputProcessor::_lcioOutputFile
private
Initial value:
{*this, "LCIOOutputFile",
"Name of the LCIO output file", "outputfile.slcio" }

Definition at line 84 of file LCIOOutputProcessor.cc.

Referenced by end(), and init().

◆ _lcioWriteMode

StringParameter marlinmt::LCIOOutputProcessor::_lcioWriteMode
private
Initial value:
{*this, "LCIOWriteMode",
"Write mode for output file: WRITE_APPEND, WRITE_NEW or None", "None" }

Definition at line 87 of file LCIOOutputProcessor.cc.

Referenced by init().

◆ _nEvents

std::atomic<int> marlinmt::LCIOOutputProcessor::_nEvents {0}
private

Definition at line 105 of file LCIOOutputProcessor.cc.

Referenced by end(), and processEvent().

◆ _nRuns

std::atomic<int> marlinmt::LCIOOutputProcessor::_nRuns {0}
private

Definition at line 104 of file LCIOOutputProcessor.cc.

Referenced by end(), and processRunHeader().

◆ _writer

Writer marlinmt::LCIOOutputProcessor::_writer {nullptr}
private

Definition at line 103 of file LCIOOutputProcessor.cc.

Referenced by end(), init(), processEvent(), and processRunHeader().


The documentation for this class was generated from the following file: