4 #include "marlin/Processor.h"
11 #define INACTIVE false
12 #define NO_PARAMETERS 0
13 #define NOT_INSTALLED 1
15 #define INPUT "lcioInType"
16 #define OUTPUT "lcioOutType"
17 #define UNAVAILABLE "lcioUnavailableType"
18 #define DUPLICATE "lcioDuplicate"
24 typedef std::set< std::string > sSet;
25 typedef std::vector< CCCollection* > ColVec;
26 typedef std::map< std::string, std::string > ssMap;
27 typedef std::map< std::string, ssMap > sssMap;
28 typedef std::map< std::string, ColVec > sColVecMap;
29 typedef std::map< std::string, sColVecMap > ssColVecMap;
44 CCProcessor(
bool status,
const std::string& name,
const std::string& type, std::shared_ptr<StringParameters> p);
74 const std::string&
getName(){
return _name; }
77 const std::string&
getType(){
return _type; }
84 "This processor is NOT installed in your Marlin binary: parameter descriptions and types lost!!");
91 const std::string
getError(){
return ( _errors.size() != 0 ? _errors[0] :
"" ); }
97 bool isErrorCol(
const std::string& type,
const std::string& value );
106 const ssMap&
getColHeaders(
const std::string& iotype ){
return _types[iotype]; }
111 ColVec&
getCols(
const std::string& iotype,
const std::string& type_name=
"ALL_COLLECTIONS" );
119 void addCol(
const std::string& iotype,
const std::string& name,
const std::string& type,
const std::string& value );
122 void remCol(
const std::string& iotype,
const std::string& name,
unsigned int index );
134 void setName(
const std::string& name ){ _name = name; };
156 void addColsFromParam( std::shared_ptr<StringParameters> p );
157 void writeColsToParam();
158 void clearParameters();
159 void setMarlinProc();
166 std::vector<bool> _error;
169 std::shared_ptr<StringParameters> _param;
172 const StringVec _error_desc{
"Processor has no Parameters",
"Processor not available!",
"Some Collections have Errors"};
void addDCol(CCCollection *c)
Adds a duplicate collection to this processor.
Definition: CCProcessor.cc:319
const std::string getError()
Returns a string with the error of the processor.
Definition: CCProcessor.h:91
sSet & getConditions()
Returns the Conditions of the processor.
Definition: CCProcessor.h:80
bool isErrorCol(const std::string &type, const std::string &value)
Returns true if the given collection is in the unavailable or duplicate list of this processor...
Definition: CCProcessor.cc:381
handles information about LCIO collections needed by MarlinSteerCheck
Definition: CCCollection.h:17
void remCol(const std::string &iotype, const std::string &name, unsigned int index)
Removes collection of the given iotype ( INPUT / OUTPUT ) with the given name at the given index...
Definition: CCProcessor.cc:327
void setError(int error)
Activates an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 ) ...
Definition: CCProcessor.cc:399
handles information about marlin processors and their collections needed by MarlinSteerCheck ...
Definition: CCProcessor.h:39
sSet & getColTypeNames(const std::string &iotype)
Returns collection's types/names of a given iotype found in the processor If iotype == INPUT/OUTPUT t...
Definition: CCProcessor.cc:370
void clearError(int error)
Clears an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 ) ...
Definition: CCProcessor.cc:406
void setConditions(const std::string &conditions)
Sets the processor's conditions.
Definition: CCProcessor.cc:153
bool isParamOptional(const std::string &key)
Returns true if a parameter is optional (optional means the parameter will be written out as a commen...
Definition: CCProcessor.cc:437
bool isInstalled()
Returns true if the processor is installed.
Definition: CCProcessor.h:65
void setOptionalParam(const std::string &key, bool optional=true)
Sets a parameter as optional (if optional=true parameter is written out as a comment) ...
Definition: CCProcessor.cc:446
void writeToXML(std::ofstream &stream)
Writes this processor to a stream using the XML format.
Definition: CCProcessor.cc:455
bool hasErrors()
Returns true if the processor has errors.
Definition: CCProcessor.cc:428
const std::string & description()
Description of processor.
Definition: Processor.h:193
const std::string & getType()
Returns the Type of the processor.
Definition: CCProcessor.h:77
bool hasCondition(const std::string &condition)
Returns true if the processor is constrained by the given condition.
Definition: CCProcessor.cc:201
void changeStatus()
Changes the processor status ( ACTIVE->INACTIVE or INACTIVE->ACTIVE )
Definition: CCProcessor.cc:281
const std::string & getName()
Returns the Name of the processor.
Definition: CCProcessor.h:74
ColVec & getCols(const std::string &iotype, const std::string &type_name="ALL_COLLECTIONS")
Returns collections of a given iotype ( INPUT, OUTPUT, UNAVAILABLE, DUPLICATE ) for a given name or t...
Definition: CCProcessor.cc:352
void addCol(const std::string &iotype, const std::string &name, const std::string &type, const std::string &value)
Adds a collection of the given iotype ( INPUT / OUTPUT ) with the given name, type and value...
Definition: CCProcessor.cc:290
const ssMap & getColHeaders(const std::string &iotype)
Returns a map with collection names and their respective types for INPUT/OUTPUT collections of this p...
Definition: CCProcessor.h:106
bool hasParameters()
Returns true if the processor has parameters.
Definition: CCProcessor.h:59
Base class for Marlin processors.
Definition: Processor.h:64
void setName(const std::string &name)
Sets the processor's name.
Definition: CCProcessor.h:134
const std::string getStatusDesc()
Returns a string with the processor status ( "Active", "Inactive" )
Definition: CCProcessor.h:94
bool isActive()
Returns true if the processor is active.
Definition: CCProcessor.h:68
const std::string getDescription()
Returns the Description of the processor.
Definition: CCProcessor.h:83
bool hasErrorCols()
Returns true if the processor has collection errors.
Definition: CCProcessor.h:62
std::shared_ptr< StringParameters > getParameters()
Returns the string parameters for this processor.
Definition: CCProcessor.h:103
void addUCol(CCCollection *c)
Adds an unavailable collection to this processor.
Definition: CCProcessor.cc:311