Marlin
01.17.01
|
this class is a Marlin Steering File consistency check Tool. More...
#include <MarlinSteerCheck.h>
Public Member Functions | |
MarlinSteerCheck (const char *steerFileName=NULL, const CommandLineParametersMap *cmdlineparams=NULL) | |
MarlinSteerCheck (const marlin::MarlinSteerCheck &)=delete | |
MarlinSteerCheck | operator= (const marlin::MarlinSteerCheck &)=delete |
~MarlinSteerCheck () | |
CMProcessor * | getMProcs () |
Returns the Marlin Processors. More... | |
ProcVec & | getAProcs () |
Returns the Active Processors. More... | |
ProcVec & | getIProcs () |
Returns the Inactive Processors. More... | |
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 does not exist Returns 1 if the processor exists and is active Returns 2 if the processor exists and is inactive. More... | |
ColVec & | getLCIOCols () const |
Returns the collections read from LCIO files. More... | |
StringVec & | getLCIOFiles () |
Returns the names of the LCIO files found in the global section. More... | |
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 ComboBox) More... | |
std::shared_ptr< StringParameters > | getGlobalParameters () |
Returns the Global Parameters. More... | |
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. More... | |
int | addLCIOFile (const std::string &file) |
Add LCIO file and read all collections inside it. More... | |
void | remLCIOFile (const std::string &file) |
Remove LCIO file and all collections associated to it. More... | |
void | changeLCIOFilePos (unsigned int pos, unsigned int newPos) |
Change the LCIO File at the given index to the new given position. More... | |
void | addProcessor (bool status, const std::string &name, const std::string &type, std::shared_ptr< StringParameters > p) |
Add a new processor. More... | |
void | remProcessor (unsigned int index, bool status) |
Remove processor with the given status at the given index. More... | |
void | activateProcessor (unsigned int index) |
Activate processor at the given index. More... | |
void | deactivateProcessor (unsigned int index) |
Deactivate processor at the given index. More... | |
void | changeProcessorPos (unsigned int pos, unsigned int newPos) |
Change the active processor at the given index to the new given position. More... | |
void | consistencyCheck () |
Performs a check at all active processors to search for unavailable collections. More... | |
bool | saveAsXMLFile (const std::string &file) |
Saves the data to an XML file with the given name Returns false if error occured. More... | |
const std::string | getXMLFileRelPath () |
const std::string | getXMLFileAbsPath () |
const std::string | getXMLFileName () |
const std::string | getXMLFile () |
void | dump_information () |
Dumps all information read from the steering file to stdout. More... | |
sSet & | getErrors () |
Returns a set with all the errors found after performing a consistency check. More... | |
sSet & | getPConditions () |
Returns a set with all the processor's conditions. More... | |
const std::string | getCondition (unsigned int index) |
Returns the condition for a given index. More... | |
void | addCondition (const std::string &condition) |
Add a new Condition. More... | |
void | repCondition (const std::string &oldCond, const std::string &newCond) |
Replace a Condition. More... | |
void | remCondition (const std::string &condition) |
Removes the given condition. More... | |
bool | saveAsDOTFile (const std::string &file) |
Saves steering file in dot format. More... | |
Private Member Functions | |
ColVec & | getProcCols (const ProcVec &v, const std::string &iotype) const |
ColVec & | getAllCols () const |
ProcVec & | getAllProcs () const |
bool | parseXMLFile (const std::string &file, const CommandLineParametersMap *cmdlineparams=NULL) |
CCProcessor * | popProc (ProcVec &v, CCProcessor *p) |
ColVec & | findMatchingCols (ColVec &v, CCProcessor *srcProc, const std::string &type, const std::string &value="UNDEFINED", const std::string &name="UNDEFINED") |
Private Attributes | |
sSet | _errors {} |
IParser * | _parser |
std::shared_ptr< StringParameters > | _gparam |
std::string | _steeringFile |
std::string | _XMLFileName ="" |
std::string | _XMLFileAbsPath ="" |
std::string | _XMLFileRelPath ="" |
ProcVec | _aProc {} |
ProcVec | _iProc {} |
sColVecMap | _lcioCols {} |
StringVec | _lcioFiles {} |
sSet | _colValues {} |
sSet | _pConditions {} |
CMProcessor * | _marlinProcs =NULL |
this class is a Marlin Steering File consistency check Tool.
It can parse XML steering files using the marlin parser and search the lcio file(s) specified at the global section for available collections. Together with the active and inactive processors specified in the steering file and their respective collections it can perform a full consistency check and check for unavailable collections. The Program checks if an adequate available collection exists for every input collection of a processor.
(where input collection means a collection the processor requires as input, and output collections mean a collection that is created in the processor and marked as available for the upcoming processors)
Information about the consistency check can be dumped.
Definition at line 72 of file MarlinSteerCheck.h.
marlin::MarlinSteerCheck::MarlinSteerCheck | ( | const char * | steerFileName = NULL , |
const CommandLineParametersMap * | cmdlineparams = NULL |
||
) |
Definition at line 32 of file MarlinSteerCheck.cc.
References _errors, _gparam, _marlinProcs, _steeringFile, std::set< K >::insert(), marlin::CMProcessor::instance(), parseXMLFile(), and std::vector< T >::push_back().
|
delete |
marlin::MarlinSteerCheck::~MarlinSteerCheck | ( | ) |
Definition at line 113 of file MarlinSteerCheck.cc.
References _parser.
void marlin::MarlinSteerCheck::activateProcessor | ( | unsigned int | index | ) |
Activate processor at the given index.
Definition at line 371 of file MarlinSteerCheck.cc.
References _aProc, _iProc, consistencyCheck(), std::endl(), popProc(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by MainWindow::activateProcessor(), and parseXMLFile().
void marlin::MarlinSteerCheck::addCondition | ( | const std::string & | condition | ) |
Add a new Condition.
Definition at line 751 of file MarlinSteerCheck.cc.
References _pConditions, and std::set< K >::insert().
Referenced by ACDialog::addCondition().
int marlin::MarlinSteerCheck::addLCIOFile | ( | const std::string & | file | ) |
Add LCIO file and read all collections inside it.
Definition at line 169 of file MarlinSteerCheck.cc.
References _errors, _gparam, _lcioCols, _lcioFiles, ACTIVE, std::vector< T >::begin(), consistencyCheck(), std::vector< T >::empty(), std::vector< T >::end(), std::endl(), findMatchingCols(), std::set< K >::insert(), lcReader, MAXEVENTS, std::vector< T >::push_back(), std::size(), and std::stringstream::str().
Referenced by MainWindow::addLCIOFile(), and parseXMLFile().
void marlin::MarlinSteerCheck::addProcessor | ( | bool | status, |
const std::string & | name, | ||
const std::string & | type, | ||
std::shared_ptr< StringParameters > | p | ||
) |
Add a new processor.
Definition at line 324 of file MarlinSteerCheck.cc.
References _aProc, _iProc, ACTIVE, consistencyCheck(), and std::vector< T >::push_back().
Referenced by APDialog::addProcessor(), and parseXMLFile().
void marlin::MarlinSteerCheck::changeLCIOFilePos | ( | unsigned int | pos, |
unsigned int | newPos | ||
) |
Change the LCIO File at the given index to the new given position.
Definition at line 289 of file MarlinSteerCheck.cc.
References _lcioFiles, std::vector< T >::begin(), std::vector< T >::end(), std::endl(), std::vector< T >::erase(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by MainWindow::moveLCIOFileDown(), and MainWindow::moveLCIOFileUp().
void marlin::MarlinSteerCheck::changeProcessorPos | ( | unsigned int | pos, |
unsigned int | newPos | ||
) |
Change the active processor at the given index to the new given position.
Definition at line 412 of file MarlinSteerCheck.cc.
References _aProc, consistencyCheck(), std::endl(), popProc(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by MainWindow::moveProcessorDown(), and MainWindow::moveProcessorUp().
void marlin::MarlinSteerCheck::consistencyCheck | ( | ) |
Performs a check at all active processors to search for unavailable collections.
Definition at line 440 of file MarlinSteerCheck.cc.
References _aProc, std::vector< T >::begin(), std::vector< T >::clear(), COL_ERRORS, std::vector< T >::end(), findMatchingCols(), getLCIOCols(), compareMarlinSteeringFiles::getValue(), INPUT, std::vector< T >::insert(), OUTPUT, and std::vector< T >::size().
Referenced by activateProcessor(), IColDelegate::addCollection(), addLCIOFile(), addProcessor(), changeProcessorPos(), deactivateProcessor(), MainWindow::editAProcessor(), parseXMLFile(), remLCIOFile(), remProcessor(), OColDelegate::setModelData(), IColTDelegate::setModelData(), and IColDelegate::setModelData().
void marlin::MarlinSteerCheck::deactivateProcessor | ( | unsigned int | index | ) |
Deactivate processor at the given index.
Definition at line 389 of file MarlinSteerCheck.cc.
References _aProc, _iProc, std::vector< T >::clear(), consistencyCheck(), std::endl(), popProc(), std::vector< T >::push_back(), std::size(), and std::vector< T >::size().
Referenced by MainWindow::deactivateProcessor().
void marlin::MarlinSteerCheck::dump_information | ( | ) |
Dumps all information read from the steering file to stdout.
Definition at line 1096 of file MarlinSteerCheck.cc.
References _aProc, _errors, _iProc, _steeringFile, std::set< K >::begin(), dblue, ddunkel, dgreen, dhell, dred, dumpColErrors(), dunderline, dyellow, std::set< K >::end(), endcolor, std::endl(), std::set< K >::find(), getLCIOCols(), getLCIOFiles(), std::left(), std::setw(), std::set< K >::size(), and std::vector< T >::size().
Referenced by main().
void marlin::MarlinSteerCheck::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 at line 1203 of file MarlinSteerCheck.cc.
References _aProc, std::set< K >::begin(), dblue, dgreen, dhell, dred, dunderline, DUPLICATE, dyellow, std::set< K >::end(), endcolor, std::endl(), findMatchingCols(), getAllCols(), getLCIOCols(), getProcCols(), compareMarlinSteeringFiles::getValue(), OUTPUT, std::vector< T >::size(), and UNAVAILABLE.
Referenced by dump_information(), and MainWindow::selectionChanged().
int marlin::MarlinSteerCheck::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 does not exist Returns 1 if the processor exists and is active Returns 2 if the processor exists and is inactive.
Definition at line 356 of file MarlinSteerCheck.cc.
References _aProc, _iProc, and std::vector< T >::size().
Referenced by APDialog::addProcessor(), and APDialog::APDialog().
|
private |
Definition at line 684 of file MarlinSteerCheck.cc.
References std::vector< T >::clear(), compareMarlinSteeringFiles::getValue(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by addLCIOFile(), consistencyCheck(), dumpColErrors(), and getColsSet().
|
private |
Definition at line 805 of file MarlinSteerCheck.cc.
References _aProc, _iProc, std::vector< T >::assign(), std::vector< T >::begin(), std::vector< T >::end(), getLCIOCols(), getProcCols(), std::vector< T >::insert(), and OUTPUT.
Referenced by dumpColErrors(), and getColsSet().
|
private |
Definition at line 731 of file MarlinSteerCheck.cc.
References _aProc, _iProc, std::vector< T >::assign(), std::vector< T >::begin(), std::vector< T >::clear(), std::vector< T >::end(), and std::vector< T >::insert().
|
inline |
Returns the Active Processors.
Definition at line 89 of file MarlinSteerCheck.h.
References _aProc.
Referenced by APDialog::addProcessor(), MainWindow::aProcNameChanged(), MainWindow::conditionChanged(), MainWindow::editAProcessor(), MainWindow::selectColumn(), MainWindow::selectionChanged(), and MainWindow::updateAProcessors().
sSet & marlin::MarlinSteerCheck::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 ComboBox)
Definition at line 122 of file MarlinSteerCheck.cc.
References _aProc, _colValues, ACTIVE, std::vector< T >::begin(), std::set< K >::clear(), std::vector< T >::end(), findMatchingCols(), getAllCols(), marlin::CCProcessor::getCols(), getLCIOCols(), compareMarlinSteeringFiles::getValue(), INPUT, std::vector< T >::insert(), std::set< K >::insert(), marlin::CCProcessor::isActive(), OUTPUT, std::vector< T >::size(), and std::size().
Referenced by IColDelegate::addCollection(), IColTDelegate::createEditor(), and IColDelegate::createEditor().
const string marlin::MarlinSteerCheck::getCondition | ( | unsigned int | index | ) |
Returns the condition for a given index.
Definition at line 742 of file MarlinSteerCheck.cc.
References _pConditions, std::advance(), std::set< K >::begin(), and std::set< K >::size().
Referenced by MainWindow::conditionChanged(), MainWindow::selectColumn(), and MainWindow::updateAProcessors().
|
inline |
Returns a set with all the errors found after performing a consistency check.
Definition at line 162 of file MarlinSteerCheck.h.
References _errors.
Referenced by MainWindow::setMarlinSteerCheck().
|
inline |
Returns the Global Parameters.
Definition at line 110 of file MarlinSteerCheck.h.
References _gparam.
Referenced by MainWindow::changeGearFile(), MainWindow::setMarlinSteerCheck(), and MainWindow::updateGlobalSection().
|
inline |
Returns the Inactive Processors.
Definition at line 92 of file MarlinSteerCheck.h.
References _iProc.
Referenced by MainWindow::activateProcessor(), MainWindow::editIProcessor(), MainWindow::iProcNameChanged(), and MainWindow::updateIProcessors().
ColVec & marlin::MarlinSteerCheck::getLCIOCols | ( | ) | const |
Returns the collections read from LCIO files.
Definition at line 782 of file MarlinSteerCheck.cc.
References _lcioCols, std::map< K, T >::begin(), std::vector< T >::clear(), std::map< K, T >::end(), std::vector< T >::end(), and std::vector< T >::insert().
Referenced by consistencyCheck(), dump_information(), dumpColErrors(), getAllCols(), getColsSet(), saveAsDOTFile(), and MainWindow::updateFiles().
|
inline |
Returns the names of the LCIO files found in the global section.
Definition at line 104 of file MarlinSteerCheck.h.
References _lcioFiles.
Referenced by MainWindow::addLCIOFile(), dump_information(), saveAsDOTFile(), saveAsXMLFile(), and MainWindow::updateFiles().
|
inline |
Returns the Marlin Processors.
Definition at line 86 of file MarlinSteerCheck.h.
References _marlinProcs.
Referenced by MainWindow::addLCIOFile(), NParamVecSet::addValSet(), APDialog::APDialog(), MainWindow::changeGearFile(), NParamVecSet::remValSet(), NParamVecSetD::setModelData(), Dialog::setupViews(), Dialog::updateParam(), and NParamVecSet::updateTable().
|
inline |
Returns a set with all the processor's conditions.
Definition at line 165 of file MarlinSteerCheck.h.
References _pConditions.
Referenced by MainWindow::remCondition(), MainWindow::showConditions(), MainWindow::updateAProcessors(), and MainWindow::updateConds().
|
private |
Definition at line 794 of file MarlinSteerCheck.cc.
References std::vector< T >::begin(), std::vector< T >::clear(), std::vector< T >::end(), std::vector< T >::insert(), and std::vector< T >::size().
Referenced by dumpColErrors(), and getAllCols().
|
inline |
Definition at line 156 of file MarlinSteerCheck.h.
References _steeringFile.
|
inline |
Definition at line 150 of file MarlinSteerCheck.h.
References _XMLFileAbsPath.
|
inline |
Definition at line 153 of file MarlinSteerCheck.h.
References _XMLFileName.
|
inline |
Definition at line 147 of file MarlinSteerCheck.h.
References _XMLFileRelPath.
|
delete |
|
private |
Definition at line 493 of file MarlinSteerCheck.cc.
References _aProc, _errors, _gparam, _iProc, _parser, _pConditions, _steeringFile, activateProcessor(), ACTIVE, addLCIOFile(), addProcessor(), std::begin(), std::vector< T >::clear(), consistencyCheck(), std::vector< T >::end(), std::endl(), marlin::IParser::getParameters(), INACTIVE, std::set< K >::insert(), std::string::length(), TiXmlDocument::LoadFile(), marlin::IParser::parse(), std::vector< T >::push_back(), std::string::rfind(), marlin::IParser::setCmdLineParameters(), std::vector< T >::size(), std::stringstream::str(), std::strlen(), and std::system().
Referenced by MarlinSteerCheck().
|
private |
Definition at line 712 of file MarlinSteerCheck.cc.
References std::vector< T >::assign(), std::vector< T >::begin(), std::vector< T >::end(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by activateProcessor(), changeProcessorPos(), deactivateProcessor(), and remProcessor().
void marlin::MarlinSteerCheck::remCondition | ( | const std::string & | condition | ) |
Removes the given condition.
Definition at line 767 of file MarlinSteerCheck.cc.
References _aProc, _pConditions, std::set< K >::erase(), std::vector< T >::erase(), and std::vector< T >::size().
Referenced by MainWindow::remCondition().
void marlin::MarlinSteerCheck::remLCIOFile | ( | const std::string & | file | ) |
Remove LCIO file and all collections associated to it.
Definition at line 266 of file MarlinSteerCheck.cc.
References _lcioCols, _lcioFiles, std::vector< T >::begin(), consistencyCheck(), std::vector< T >::end(), std::vector< T >::erase(), std::map< K, T >::erase(), and std::map< K, T >::find().
Referenced by MainWindow::remLCIOFile().
void marlin::MarlinSteerCheck::remProcessor | ( | unsigned int | index, |
bool | status | ||
) |
Remove processor with the given status at the given index.
Definition at line 338 of file MarlinSteerCheck.cc.
References _aProc, _iProc, ACTIVE, consistencyCheck(), popProc(), and std::vector< T >::size().
Referenced by MainWindow::remAProcessor(), and MainWindow::remIProcessor().
void marlin::MarlinSteerCheck::repCondition | ( | const std::string & | oldCond, |
const std::string & | newCond | ||
) |
Replace a Condition.
Definition at line 755 of file MarlinSteerCheck.cc.
References _aProc, _pConditions, std::set< K >::erase(), std::vector< T >::erase(), std::vector< T >::insert(), std::set< K >::insert(), and std::vector< T >::size().
Referenced by ECDialog::editCondition().
bool marlin::MarlinSteerCheck::saveAsDOTFile | ( | const std::string & | file | ) |
Saves steering file in dot format.
Definition at line 999 of file MarlinSteerCheck.cc.
References _aProc, _errors, std::vector< T >::begin(), std::string::c_str(), std::ofstream::close(), std::vector< T >::empty(), std::vector< T >::end(), std::set< K >::end(), std::set< K >::find(), getLCIOCols(), getLCIOFiles(), compareMarlinSteeringFiles::getValue(), INPUT, std::ofstream::open(), OUTPUT, std::vector< T >::push_back(), std::vector< T >::size(), std::string::size(), std::sort(), and std::unique().
Referenced by main().
bool marlin::MarlinSteerCheck::saveAsXMLFile | ( | const std::string & | file | ) |
Saves the data to an XML file with the given name Returns false if error occured.
Definition at line 820 of file MarlinSteerCheck.cc.
References _aProc, _gparam, _iProc, std::vector< T >::begin(), std::string::c_str(), std::ctime(), std::vector< T >::end(), std::endl(), getLCIOFiles(), std::map< K, T >::insert(), std::make_pair(), std::ofstream::open(), std::vector< T >::pop_back(), std::vector< T >::push_back(), std::map< K, T >::rbegin(), std::map< K, T >::rend(), std::string::size(), std::size(), std::vector< T >::size(), and std::time().
Referenced by main(), and MainWindow::saveXMLFile().
|
private |
Definition at line 227 of file MarlinSteerCheck.h.
Referenced by activateProcessor(), addProcessor(), changeProcessorPos(), consistencyCheck(), deactivateProcessor(), dump_information(), dumpColErrors(), existsProcessor(), getAllCols(), getAllProcs(), getAProcs(), getColsSet(), parseXMLFile(), remCondition(), remProcessor(), repCondition(), saveAsDOTFile(), and saveAsXMLFile().
|
private |
Definition at line 232 of file MarlinSteerCheck.h.
Referenced by getColsSet().
|
private |
Definition at line 211 of file MarlinSteerCheck.h.
Referenced by addLCIOFile(), dump_information(), getErrors(), MarlinSteerCheck(), parseXMLFile(), and saveAsDOTFile().
|
private |
Definition at line 220 of file MarlinSteerCheck.h.
Referenced by addLCIOFile(), getGlobalParameters(), MarlinSteerCheck(), parseXMLFile(), and saveAsXMLFile().
|
private |
Definition at line 228 of file MarlinSteerCheck.h.
Referenced by activateProcessor(), addProcessor(), deactivateProcessor(), dump_information(), existsProcessor(), getAllCols(), getAllProcs(), getIProcs(), parseXMLFile(), remProcessor(), and saveAsXMLFile().
|
private |
Definition at line 229 of file MarlinSteerCheck.h.
Referenced by addLCIOFile(), getLCIOCols(), and remLCIOFile().
|
private |
Definition at line 230 of file MarlinSteerCheck.h.
Referenced by addLCIOFile(), changeLCIOFilePos(), getLCIOFiles(), and remLCIOFile().
|
private |
Definition at line 236 of file MarlinSteerCheck.h.
Referenced by getMProcs(), and MarlinSteerCheck().
|
private |
Definition at line 219 of file MarlinSteerCheck.h.
Referenced by parseXMLFile(), and ~MarlinSteerCheck().
|
private |
Definition at line 234 of file MarlinSteerCheck.h.
Referenced by addCondition(), getCondition(), getPConditions(), parseXMLFile(), remCondition(), and repCondition().
|
private |
Definition at line 222 of file MarlinSteerCheck.h.
Referenced by dump_information(), getXMLFile(), MarlinSteerCheck(), and parseXMLFile().
|
private |
Definition at line 224 of file MarlinSteerCheck.h.
Referenced by getXMLFileAbsPath().
|
private |
Definition at line 223 of file MarlinSteerCheck.h.
Referenced by getXMLFileName().
|
private |
Definition at line 225 of file MarlinSteerCheck.h.
Referenced by getXMLFileRelPath().