19 #include "marlin/MarlinConfig.h"
21 #include "streamlog/streamlog.h"
33 using namespace lcio ;
146 virtual void printDescription() ;
159 if( streamlog::out.
template write<T>() ) {
162 typedef ProcParamMap::iterator PMI ;
165 <<
"---- " << name() <<
" - parameters: " <<
std::endl ;
168 for( PMI i = _map.begin() ; i != _map.end() ; i ++ ) {
170 if( ! i->second->isOptional() || i->second->valueSet() ){
171 streamlog::out.template write<T>() ;
172 streamlog::out() <<
"\t" << i->second->name()
173 <<
": " << i->second->value()
178 streamlog::out.template write<T>() ;
179 streamlog::out() <<
"-------------------------------------------------"
187 void printParameters() ;
212 bool isInputCollectionName(
const std::string& parameterName ) ;
216 bool isOutputCollectionName(
const std::string& parameterName ) ;
235 void setReturnValue(
bool val) ;
241 void setReturnValue(
const std::string& name,
bool val ) ;
259 checkForExistingParameter( parameterName );
261 parameter, defaultVal,
275 setLCIOInType( parameterName , collectionType ) ;
276 registerProcessorParameter( parameterName, parameterDescription, parameter, defaultVal, setSize ) ;
289 setLCIOOutType( parameterName , collectionType ) ;
290 registerProcessorParameter( parameterName, parameterDescription, parameter, defaultVal, setSize ) ;
303 setLCIOInType( parameterName , collectionType ) ;
304 registerProcessorParameter( parameterName, parameterDescription, parameter, defaultVal, setSize ) ;
320 checkForExistingParameter( parameterName );
322 parameter, defaultVal,
336 auto paraIt = _map.find( parameterName );
337 if (paraIt != _map.end() ) {
339 errorMessage <<
"Parameter " << parameterName
340 <<
" already defined for processor "
367 if( streamlog::out.
template write<T>() )
396 this->
template message<T>( mess.
str() ) ;
413 setParameters( processorParameters ) ;
417 virtual void updateParameters();
421 virtual void baseInit() ;
458 bool _isFirstEvent =
false;
virtual void check(LCEvent *)
Called for every event - right after processEvent() has been called for this processor.
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...
void registerProcessorParameter(const std::string ¶meterName, const std::string ¶meterDescription, T ¶meter, const T &defaultVal, int setSize=0)
Register a steering variable for this processor - call in constructor of processor.
virtual void processRunHeader(LCRunHeader *)
Called for every run, e.g.
This singleton class contains an instance of every available marlin processor type.
void registerOutputCollection(const std::string &collectionType, const std::string ¶meterName, const std::string ¶meterDescription, std::string ¶meter, const std::string &defaultVal, int setSize=0)
Specialization of registerProcessorParameter() for a parameter that defines an output collection - ca...
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".
virtual const std::string & name() const
Return name of this processor.
void registerInputCollection(const std::string &collectionType, const std::string ¶meterName, const std::string ¶meterDescription, std::string ¶meter, const std::string &defaultVal, int setSize=0)
Specialization of registerProcessorParameter() for a parameter that defines an input collection - can...
virtual const std::string & type() const
Return type name for the processor (as set in constructor).
virtual void setProcessorParameters(std::shared_ptr< StringParameters > processorParameters)
Allow friend class CCProcessor to change/reset processor parameters.
Templated implementation of ProcessorParameter - automatically created by Processor::registerProcesso...
virtual void init()
Called at the begin of the job before anything is read.
std::map< std::string, ProcessorParameter * > ProcParamMap
void printParameters()
Print the parameters and their values depending on the given verbosity level.
virtual std::shared_ptr< StringParameters > parameters()
Return parameters defined for this Processor.
void registerOptionalParameter(const std::string ¶meterName, const std::string ¶meterDescription, T ¶meter, const T &defaultVal, int setSize=0)
Same as registerProcessorParameter except that the parameter is optional.
const std::string & description()
Description of processor.
std::map< std::string, std::string > LCIOTypeMap
void registerInputCollections(const std::string &collectionType, const std::string ¶meterName, const std::string ¶meterDescription, StringVec ¶meter, const StringVec &defaultVal, int setSize=0)
Specialization of registerProcessorParameter() for a parameter that defines one or several input coll...
virtual void setName(const std::string &processorName)
Set processor name.
virtual const std::string & logLevelName() const
Return name of the local verbosity level of this processor - "" if not set.
bool isFirstEvent()
True if first event in processEvent(evt) - use this e.g.
Processor manager singleton class.
const ProcParamMap & procMap()
Helper function for fixing old steering files.
void checkForExistingParameter(const std::string ¶meterName)
Tests whether the parameter has been registered before.
void setFirstEvent(bool firstEvent)
Called by ProcessorMgr.
virtual void processEvent(LCEvent *)
Called for every event - the working horse.
Base class for Marlin processors.
Internal helper class that creates a new xml steering file with the parameter attributes lcioInType a...
virtual void end()
Called after data processing for clean up in the inverse order of the init() method so that resources...