6 #include "gloria/GloriaDataContainer.h"
8 #include "StringParameters.h"
9 #include "ProcessorParameter.h"
11 #include "streamlog/streamlog.h"
22 class XMLFixCollTypes ;
24 typedef std::map<std::string, ProcessorParameter* > ProcParamMap ;
25 typedef std::map<std::string, GloriaCollectionType > GloriaTypeMap ;
59 friend class XMLFixCollTypes ;
129 virtual const std::string &
type()
const {
return _typeName ; }
132 virtual const std::string &
name()
const {
return _processorName ; }
135 virtual const std::string &
logLevelName()
const {
return _logLevelName ; }
139 virtual StringParameters*
parameters() {
return _parameters ; }
143 virtual void printDescription() ;
146 virtual void printDescriptionXML(std::ostream& stream=std::cout) ;
157 typedef ProcParamMap::iterator PMI ;
160 <<
"---- " << name() <<
" - parameters: " << std::endl ;
163 for( PMI i = _map.begin() ; i != _map.end() ; i ++ ) {
165 if( ! i->second->isOptional() || i->second->valueSet() ){
168 <<
": " << i->second->value()
174 streamlog::out() <<
"-------------------------------------------------"
182 void printParameters() ;
206 bool isInputCollectionName(
const std::string& parameterName ) ;
210 bool isOutputCollectionName(
const std::string& parameterName ) ;
223 void setReturnValue(
bool val) ;
229 void setReturnValue(
const std::string& name,
bool val ) ;
243 const std::string& description,
249 parameter, defaultVal,
258 const std::string& name,
259 const std::string& description,
260 std::string& parameter,
261 const std::string& defaultVal,
264 setGloriaInType( name , type ) ;
265 registerProcessorParameter( name, description, parameter, defaultVal, setSize ) ;
273 const std::string& name,
274 const std::string& description,
275 std::string& parameter,
276 const std::string& defaultVal,
279 setGloriaOutType( name , type ) ;
280 registerProcessorParameter( name, description, parameter, defaultVal, setSize ) ;
288 const std::string& name,
289 const std::string& description,
290 StringVec& parameter,
291 const StringVec& defaultVal,
294 setGloriaInType( name , type ) ;
295 registerProcessorParameter( name, description, parameter, defaultVal, setSize ) ;
306 const std::string& description,
312 parameter, defaultVal,
317 bool parameterSet(
const std::string& name ) ;
339 void message(
const std::string& message )
const {
365 inline void message(
const std::basic_ostream<
char, std::char_traits<char> >& m)
const {
370 const std::stringstream& mess =
dynamic_cast<const std::stringstream&
>( m ) ;
372 this->
template message<T>( mess.str() ) ;
375 catch( std::bad_cast ) {}
382 std::stringstream& log()
const ;
389 setParameters( parameters ) ;
393 virtual void updateParameters();
402 virtual void updateTelescopeParameters(std::string name );
418 virtual void setName(
const std::string & name) { _processorName = name ; }
421 virtual void setParameters( StringParameters* parameters) ;
424 virtual void baseInit() ;
427 void setFirstEvent(
bool isFirstEvent ) { _isFirstEvent = isFirstEvent ; }
439 void setGloriaOutType(
const std::string& collectionName,
const GloriaCollectionType& gloriaOutType) ;
443 const ProcParamMap& procMap() {
return _map ; }
451 std::string _typeName ;
452 std::string _processorName ;
453 StringParameters* _parameters ;
457 GloriaTypeMap _inTypeMap ;
458 GloriaTypeMap _outTypeMap ;
460 std::string _logLevelName ;
463 mutable std::stringstream* _str ;
void message(const std::string &message) const
Print message according to verbosity level.
Definition: Processor.h:339
virtual const std::string & name() const
Return name of this processor.
Definition: Processor.h:132
Definition: CMProcessor.h:21
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
void registerProcessorParameter(const std::string &name, const std::string &description, T ¶meter, const T &defaultVal, int setSize=0)
Register a steering variable for this processor - call in constructor of processor.
Definition: Processor.h:242
virtual const std::string & logLevelName() const
Return name of the local verbosity level of this processor - "" if not set.
Definition: Processor.h:135
void message(const std::basic_ostream< char, std::char_traits< char > > &m) const
Similar to message(const std::string& message)
Definition: Processor.h:365
const std::string & description()
Description of processor.
Definition: Processor.h:187
logstream out
Definition: logstream.cc:94
Class for storing all data processed in Luiza.
Definition: GloriaDataContainer.h:82
virtual void end()
Called after data processing is finished.
Definition: Processor.h:125
Base class for Luiza processors.
Definition: Processor.h:55
virtual StringParameters * parameters()
Return parameters defined for this Processor.
Definition: Processor.h:139
void registerInputCollections(const GloriaCollectionType &type, const std::string &name, const std::string &description, StringVec ¶meter, const StringVec &defaultVal, int setSize=0)
Register parameter describing input collections.
Definition: Processor.h:287
std::string _description
Describes what the processor does. Set in constructor.
Definition: Processor.h:450
void registerInputCollection(const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string ¶meter, const std::string &defaultVal, int setSize=0)
Register parameter describing input collection.
Definition: Processor.h:257
Definition: ProcessorMgr.h:40
virtual const std::string & type() const
Return type name for the processor (as set in constructor).
Definition: Processor.h:129
virtual void setProcessorParameters(StringParameters *parameters)
Allow friend class CCProcessor to change/reset processor parameters.
Definition: Processor.h:388
virtual void startAnalysis(GloriaDataContainer *)
Called before first data processing loop.
Definition: Processor.h:96
Definition: ProcessorParameter.h:104
void registerOptionalParameter(const std::string &name, const std::string &description, T ¶meter, const T &defaultVal, int setSize=0)
Same as registerProcessorParameter except that the parameter is optional.
Definition: Processor.h:305
Namespace for Luiza framework.
Definition: CCCollection.h:6
virtual void concludeAnalysis(GloriaDataContainer *)
Called after all data processing loops.
Definition: Processor.h:117
void printParameters()
Print the parameters and their values depending on the given verbosity level.
Definition: Processor.h:151
virtual void init()
Called at the begin of the job before anything is read.
Definition: Processor.h:88
GloriaCollectionType
Enumerator for allowed collection types.
Definition: GloriaDataContainer.h:45
virtual void check(GloriaDataContainer *)
Called for every loop - right after processData() call.
Definition: Processor.h:108
void registerOutputCollection(const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string ¶meter, const std::string &defaultVal, int setSize=0)
Register parameter describing output collection.
Definition: Processor.h:272
bool isFirstEvent()
True if first event in processEvent(evt) - use this e.g. to initialize histograms etc...
Definition: Processor.h:191
virtual void processData(GloriaDataContainer *)
Called for every data processing loop.
Definition: Processor.h:102