Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
marlin::LCIOOutputProcessor Class Reference

Default output processor. More...

#include <LCIOOutputProcessor.h>

+ Inheritance diagram for marlin::LCIOOutputProcessor:

Public Member Functions

virtual ProcessornewProcessor ()
 Return a new instance of the processor. More...
 
 LCIOOutputProcessor ()
 
 LCIOOutputProcessor (const marlin::LCIOOutputProcessor &)=delete
 
LCIOOutputProcessoroperator= (const marlin::LCIOOutputProcessor &)=delete
 
 LCIOOutputProcessor (const std::string &typeName)
 C'tor for possible subclasses. More...
 
virtual ~LCIOOutputProcessor ()
 D'tor for subclasses. More...
 
virtual void init ()
 Open the LCIO outputfile. More...
 
virtual void processRunHeader (LCRunHeader *run)
 Write every run header. More...
 
virtual void processEvent (LCEvent *evt)
 Write every event. More...
 
virtual void end ()
 Close outputfile. More...
 
void dropCollections (LCEvent *evt)
 Drops the collections specified in the steering file parameters DropCollectionNames and DropCollectionTypes. More...
 
- Public Member Functions inherited from marlin::Processor
 Processor (const std::string &typeName)
 Possible verbosity levels. More...
 
virtual ~Processor ()
 Destructor. More...
 
virtual void check (LCEvent *)
 Called for every event - right after processEvent() has been called for this processor. More...
 
virtual const std::stringtype () const
 Return type name for the processor (as set in constructor). More...
 
virtual const std::stringname () const
 Return name of this processor. More...
 
virtual const std::stringlogLevelName () const
 Return name of the local verbosity level of this processor - "" if not set. More...
 
virtual std::shared_ptr
< StringParameters
parameters ()
 Return parameters defined for this Processor. More...
 
virtual void printDescription ()
 Print information about this processor in ASCII steering file format. More...
 
virtual void printDescriptionXML (std::ostream &stream=std::cout)
 Print information about this processor in XML steering file format. More...
 
template<class T >
void printParameters ()
 Print the parameters and their values depending on the given verbosity level. More...
 
void printParameters ()
 Print the parameters and their values with verbosity level MESSAGE. More...
 
const std::stringdescription ()
 Description of processor. More...
 
bool isFirstEvent ()
 True if first event in processEvent(evt) - use this e.g. More...
 
std::string getLCIOInType (const std::string &colName)
 Return the LCIO input type for the collection colName - empty string if colName is not a registered collection name. More...
 
std::string getLCIOOutType (const std::string &colName)
 Return the LCIO output type for the collection colName - empty string if colName is not a registered collection name. More...
 
bool isInputCollectionName (const std::string &parameterName)
 True if the given parameter defines an LCIO input collection, i.e. More...
 
bool isOutputCollectionName (const std::string &parameterName)
 True if the given parameter defines an LCIO output collection. More...
 
virtual void setParameters (std::shared_ptr< StringParameters > parameters)
 Helper function returns the ProcessorParameter for the given name. More...
 
virtual void setName (const std::string &processorName)
 Set processor name. More...
 

Protected Attributes

std::string _lcioOutputFile =""
 
std::string _lcioWriteMode =""
 
StringVec _dropCollectionNames {}
 
StringVec _dropCollectionTypes {}
 
StringVec _keepCollectionNames {}
 
StringVec _fullSubsetCollections {}
 
int _splitFileSizekB =1992294
 
SubSetVec _subSets {}
 
LCWriter * _lcWrt =NULL
 
int _nRun =-1
 
int _nEvt =-1
 
int _compressionLevel {6}
 
- Protected Attributes inherited from marlin::Processor
std::string _description =""
 Describes what the processor does. More...
 
std::string _typeName =""
 
std::string _processorName =""
 
std::shared_ptr< StringParameters_parameters {}
 
ProcParamMap _map {}
 
bool _isFirstEvent = false
 
LCIOTypeMap _inTypeMap {}
 
LCIOTypeMap _outTypeMap {}
 
std::string _logLevelName {}
 

Private Types

typedef std::vector
< LCCollectionVec * > 
SubSetVec
 

Private Member Functions

void myConstruct ()
 Inititalization for constructors. More...
 

Additional Inherited Members

- Protected Member Functions inherited from marlin::Processor
void setReturnValue (bool val)
 Set the return value for this processor - typically at end of processEvent(). More...
 
void setReturnValue (const std::string &name, bool val)
 Set a named return value for this processor - typically at end of processEvent() The value can be used in a condition in the steering file referred to by ProcessorName.name of the processor. More...
 
template<class T >
void registerProcessorParameter (const std::string &parameterName, const std::string &parameterDescription, T &parameter, const T &defaultVal, int setSize=0)
 Register a steering variable for this processor - call in constructor of processor. More...
 
void registerInputCollection (const std::string &collectionType, const std::string &parameterName, const std::string &parameterDescription, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Specialization of registerProcessorParameter() for a parameter that defines an input collection - can be used fo checking the consistency of the steering file. More...
 
void registerOutputCollection (const std::string &collectionType, const std::string &parameterName, const std::string &parameterDescription, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Specialization of registerProcessorParameter() for a parameter that defines an output collection - can be used fo checking the consistency of the steering file. More...
 
void registerInputCollections (const std::string &collectionType, const std::string &parameterName, const std::string &parameterDescription, StringVec &parameter, const StringVec &defaultVal, int setSize=0)
 Specialization of registerProcessorParameter() for a parameter that defines one or several input collections - can be used fo checking the consistency of the steering file. More...
 
template<class T >
void registerOptionalParameter (const std::string &parameterName, const std::string &parameterDescription, T &parameter, const T &defaultVal, int setSize=0)
 Same as registerProcessorParameter except that the parameter is optional. More...
 
bool parameterSet (const std::string &name)
 Tests whether the parameter has been set in the steering file. More...
 
void checkForExistingParameter (const std::string &parameterName)
 Tests whether the parameter has been registered before. More...
 
template<class T >
void message (const std::string &m) const
 Print message according to verbosity level of the templated parameter (one of DEBUG, MESSAGE, WARNING, ERROR ) and the global parameter "Verbosity". More...
 
template<class T >
void message (const std::basic_ostream< char, std::char_traits< char > > &m) const
 Same as message(const std::string& message) except that it allows the output of more complex messages in the argument using the log() method, e.g. More...
 
std::stringstreamlog () const
 Returns an empty stringstream that is used by the message method. 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 48 of file LCIOOutputProcessor.h.

Member Typedef Documentation

typedef std::vector< LCCollectionVec* > marlin::LCIOOutputProcessor::SubSetVec
private

Definition at line 50 of file LCIOOutputProcessor.h.

Constructor & Destructor Documentation

marlin::LCIOOutputProcessor::LCIOOutputProcessor ( )

Definition at line 32 of file LCIOOutputProcessor.cc.

References myConstruct().

marlin::LCIOOutputProcessor::LCIOOutputProcessor ( const marlin::LCIOOutputProcessor )
delete
marlin::LCIOOutputProcessor::LCIOOutputProcessor ( const std::string typeName)

C'tor for possible subclasses.

Definition at line 26 of file LCIOOutputProcessor.cc.

References myConstruct().

marlin::LCIOOutputProcessor::~LCIOOutputProcessor ( )
virtual

D'tor for subclasses.

Definition at line 23 of file LCIOOutputProcessor.cc.

Member Function Documentation

void marlin::LCIOOutputProcessor::dropCollections ( LCEvent *  evt)

Drops the collections specified in the steering file parameters DropCollectionNames and DropCollectionTypes.

Definition at line 155 of file LCIOOutputProcessor.cc.

References _dropCollectionNames, _dropCollectionTypes, _fullSubsetCollections, _keepCollectionNames, _subSets, std::vector< T >::begin(), std::vector< T >::end(), std::find(), marlin::Processor::parameterSet(), std::vector< T >::push_back(), and std::bitset< Bits >::to_ulong().

Referenced by processEvent().

void marlin::LCIOOutputProcessor::end ( )
virtual

Close outputfile.

Reimplemented from marlin::Processor.

Definition at line 281 of file LCIOOutputProcessor.cc.

References _lcioOutputFile, _lcWrt, _nEvt, _nRun, std::endl(), and marlin::Processor::name().

void marlin::LCIOOutputProcessor::init ( )
virtual
void marlin::LCIOOutputProcessor::myConstruct ( )
private
virtual Processor* marlin::LCIOOutputProcessor::newProcessor ( )
inlinevirtual

Return a new instance of the processor.

Has to be implemented by subclasses.

Implements marlin::Processor.

Definition at line 55 of file LCIOOutputProcessor.h.

LCIOOutputProcessor& marlin::LCIOOutputProcessor::operator= ( const marlin::LCIOOutputProcessor )
delete
void marlin::LCIOOutputProcessor::processEvent ( LCEvent *  evt)
virtual
void marlin::LCIOOutputProcessor::processRunHeader ( LCRunHeader *  run)
virtual

Write every run header.

Reimplemented from marlin::Processor.

Definition at line 144 of file LCIOOutputProcessor.cc.

References _lcWrt, and _nRun.

Member Data Documentation

int marlin::LCIOOutputProcessor::_compressionLevel {6}
protected

Definition at line 106 of file LCIOOutputProcessor.h.

Referenced by init(), and myConstruct().

StringVec marlin::LCIOOutputProcessor::_dropCollectionNames {}
protected

Definition at line 94 of file LCIOOutputProcessor.h.

Referenced by dropCollections(), and myConstruct().

StringVec marlin::LCIOOutputProcessor::_dropCollectionTypes {}
protected

Definition at line 95 of file LCIOOutputProcessor.h.

Referenced by dropCollections(), and myConstruct().

StringVec marlin::LCIOOutputProcessor::_fullSubsetCollections {}
protected

Definition at line 97 of file LCIOOutputProcessor.h.

Referenced by dropCollections(), and myConstruct().

StringVec marlin::LCIOOutputProcessor::_keepCollectionNames {}
protected

Definition at line 96 of file LCIOOutputProcessor.h.

Referenced by dropCollections(), and myConstruct().

std::string marlin::LCIOOutputProcessor::_lcioOutputFile =""
protected

Definition at line 91 of file LCIOOutputProcessor.h.

Referenced by end(), init(), and myConstruct().

std::string marlin::LCIOOutputProcessor::_lcioWriteMode =""
protected

Definition at line 92 of file LCIOOutputProcessor.h.

Referenced by init(), and myConstruct().

LCWriter* marlin::LCIOOutputProcessor::_lcWrt =NULL
protected

Definition at line 103 of file LCIOOutputProcessor.h.

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

int marlin::LCIOOutputProcessor::_nEvt =-1
protected

Definition at line 105 of file LCIOOutputProcessor.h.

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

int marlin::LCIOOutputProcessor::_nRun =-1
protected

Definition at line 104 of file LCIOOutputProcessor.h.

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

int marlin::LCIOOutputProcessor::_splitFileSizekB =1992294
protected

Definition at line 99 of file LCIOOutputProcessor.h.

Referenced by init(), and myConstruct().

SubSetVec marlin::LCIOOutputProcessor::_subSets {}
protected

Definition at line 101 of file LCIOOutputProcessor.h.

Referenced by dropCollections(), and processEvent().


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