1 #ifndef MARLINSTEERCHECK_H
2 #define MARLINSTEERCHECK_H
4 #include "marlin/CCProcessor.h"
5 #include "marlin/CCCollection.h"
6 #include "marlin/CMProcessor.h"
7 #include "marlin/XMLParser.h"
15 #define clrscr() printf("\033[2J")
16 #define dblue() printf("\x1b[34m")
17 #define dred() printf("\x1b[31m")
18 #define dyellow() printf("\x1b[33m")
19 #define dgreen() printf("\x1b[32m")
20 #define dunderline() printf("\x1b[4m")
21 #define ditalic() printf("\x1b[3m")
22 #define ddunkel() printf("\x1b[2m")
23 #define dhell() printf("\x1b[1m")
24 #define dblink() printf("\x1b[5m")
25 #define endcolor() printf("\x1b[m")
50 typedef std::vector< CCProcessor* > ProcVec;
77 MarlinSteerCheck(
const char* steerFileName=NULL,
const CommandLineParametersMap * cmdlineparams=NULL );
98 int existsProcessor(
const std::string& type,
const std::string& name=
"" );
113 void dumpColErrors(
unsigned int i, std::ostream& stream,
bool separators=
false );
125 void addProcessor(
bool status,
const std::string& name,
const std::string& type, std::shared_ptr<StringParameters> p );
147 const std::string getXMLFileRelPath(){
return _XMLFileRelPath; }
150 const std::string getXMLFileAbsPath(){
return _XMLFileAbsPath; }
153 const std::string getXMLFileName(){
return _XMLFileName; }
156 const std::string getXMLFile(){
return _steeringFile; }
174 void repCondition(
const std::string& oldCond,
const std::string& newCond );
189 ColVec& getProcCols(
const ProcVec& v,
const std::string& iotype )
const;
192 ColVec& getAllCols()
const;
195 ProcVec& getAllProcs()
const;
198 bool parseXMLFile(
const std::string& file,
const CommandLineParametersMap * cmdlineparams=NULL );
204 ColVec& findMatchingCols( ColVec& v,
CCProcessor* srcProc,
205 const std::string& type,
const std::string& value=
"UNDEFINED",
const std::string& name=
"UNDEFINED" );
220 std::shared_ptr<StringParameters> _gparam;
222 std::string _steeringFile;
223 std::string _XMLFileName=
"";
224 std::string _XMLFileAbsPath=
"";
225 std::string _XMLFileRelPath=
"";
229 sColVecMap _lcioCols{};
230 StringVec _lcioFiles{};
236 CMProcessor* _marlinProcs =NULL;
void remProcessor(unsigned int index, bool status)
Remove processor with the given status at the given index.
Definition: MarlinSteerCheck.cc:338
This singleton class contains an instance of every available marlin processor type.
Definition: CMProcessor.h:21
void repCondition(const std::string &oldCond, const std::string &newCond)
Replace a Condition.
Definition: MarlinSteerCheck.cc:755
sSet & getPConditions()
Returns a set with all the processor's conditions.
Definition: MarlinSteerCheck.h:165
this class is a Marlin Steering File consistency check Tool.
Definition: MarlinSteerCheck.h:72
ColVec & getLCIOCols() const
Returns the collections read from LCIO files.
Definition: MarlinSteerCheck.cc:782
void remCondition(const std::string &condition)
Removes the given condition.
Definition: MarlinSteerCheck.cc:767
std::shared_ptr< StringParameters > getGlobalParameters()
Returns the Global Parameters.
Definition: MarlinSteerCheck.h:110
handles information about marlin processors and their collections needed by MarlinSteerCheck ...
Definition: CCProcessor.h:39
void dump_information()
Dumps all information read from the steering file to stdout.
Definition: MarlinSteerCheck.cc:1096
const std::string getCondition(unsigned int index)
Returns the condition for a given index.
Definition: MarlinSteerCheck.cc:742
void activateProcessor(unsigned int index)
Activate processor at the given index.
Definition: MarlinSteerCheck.cc:371
sSet & getColsSet(const std::string &type, const std::string &name, CCProcessor *proc)
Returns a list of all available Collections for a given type, name and processor (to use in a ComboBo...
Definition: MarlinSteerCheck.cc:122
bool saveAsDOTFile(const std::string &file)
Saves steering file in dot format.
Definition: MarlinSteerCheck.cc:999
void addProcessor(bool status, const std::string &name, const std::string &type, std::shared_ptr< StringParameters > p)
Add a new processor.
Definition: MarlinSteerCheck.cc:324
sSet & getErrors()
Returns a set with all the errors found after performing a consistency check.
Definition: MarlinSteerCheck.h:162
ProcVec & getIProcs()
Returns the Inactive Processors.
Definition: MarlinSteerCheck.h:92
bool saveAsXMLFile(const std::string &file)
Saves the data to an XML file with the given name Returns false if error occured. ...
Definition: MarlinSteerCheck.cc:820
void consistencyCheck()
Performs a check at all active processors to search for unavailable collections.
Definition: MarlinSteerCheck.cc:440
CMProcessor * getMProcs()
Returns the Marlin Processors.
Definition: MarlinSteerCheck.h:86
void changeProcessorPos(unsigned int pos, unsigned int newPos)
Change the active processor at the given index to the new given position.
Definition: MarlinSteerCheck.cc:412
void dumpColErrors(unsigned int i, std::ostream &stream, bool separators=false)
Writes the collection errors for the active processor with given index to the given stream...
Definition: MarlinSteerCheck.cc:1203
void deactivateProcessor(unsigned int index)
Deactivate processor at the given index.
Definition: MarlinSteerCheck.cc:389
ProcVec & getAProcs()
Returns the Active Processors.
Definition: MarlinSteerCheck.h:89
StringVec & getLCIOFiles()
Returns the names of the LCIO files found in the global section.
Definition: MarlinSteerCheck.h:104
void changeLCIOFilePos(unsigned int pos, unsigned int newPos)
Change the LCIO File at the given index to the new given position.
Definition: MarlinSteerCheck.cc:289
void addCondition(const std::string &condition)
Add a new Condition.
Definition: MarlinSteerCheck.cc:751
int addLCIOFile(const std::string &file)
Add LCIO file and read all collections inside it.
Definition: MarlinSteerCheck.cc:169
void remLCIOFile(const std::string &file)
Remove LCIO file and all collections associated to it.
Definition: MarlinSteerCheck.cc:266
int existsProcessor(const std::string &type, const std::string &name="")
Check if a processor of the given type with the given name already exists Returns 0 if the processor ...
Definition: MarlinSteerCheck.cc:356