Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
marlin::MarlinSteerCheck Class Reference

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 ()
 
CMProcessorgetMProcs ()
 Returns the Marlin Processors. More...
 
ProcVecgetAProcs ()
 Returns the Active Processors. More...
 
ProcVecgetIProcs ()
 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...
 
ColVecgetLCIOCols () const
 Returns the collections read from LCIO files. More...
 
StringVecgetLCIOFiles ()
 Returns the names of the LCIO files found in the global section. More...
 
sSetgetColsSet (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< StringParametersgetGlobalParameters ()
 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...
 
sSetgetErrors ()
 Returns a set with all the errors found after performing a consistency check. More...
 
sSetgetPConditions ()
 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

ColVecgetProcCols (const ProcVec &v, const std::string &iotype) const
 
ColVecgetAllCols () const
 
ProcVecgetAllProcs () const
 
bool parseXMLFile (const std::string &file, const CommandLineParametersMap *cmdlineparams=NULL)
 
CCProcessorpopProc (ProcVec &v, CCProcessor *p)
 
ColVecfindMatchingCols (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
 

Detailed Description

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.

Author
Jan Engels, Benjamin Eberhardt, DESY
Version
Id:
MarlinSteerCheck.h,v 1.32 2007-04-23 16:21:01 gaede Exp

Definition at line 72 of file MarlinSteerCheck.h.

Constructor & Destructor Documentation

marlin::MarlinSteerCheck::MarlinSteerCheck ( const char *  steerFileName = NULL,
const CommandLineParametersMap cmdlineparams = NULL 
)
marlin::MarlinSteerCheck::MarlinSteerCheck ( const marlin::MarlinSteerCheck )
delete
marlin::MarlinSteerCheck::~MarlinSteerCheck ( )

Definition at line 113 of file MarlinSteerCheck.cc.

References _parser.

Member Function Documentation

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)
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 
)
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 ( )
void marlin::MarlinSteerCheck::deactivateProcessor ( unsigned int  index)
void marlin::MarlinSteerCheck::dump_information ( )
void marlin::MarlinSteerCheck::dumpColErrors ( unsigned int  i,
std::ostream stream,
bool  separators = false 
)
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().

ColVec & marlin::MarlinSteerCheck::findMatchingCols ( ColVec v,
CCProcessor srcProc,
const std::string type,
const std::string value = "UNDEFINED",
const std::string name = "UNDEFINED" 
)
private
ColVec & marlin::MarlinSteerCheck::getAllCols ( ) const
private
ProcVec & marlin::MarlinSteerCheck::getAllProcs ( ) const
private
ProcVec& marlin::MarlinSteerCheck::getAProcs ( )
inline
sSet & marlin::MarlinSteerCheck::getColsSet ( const std::string type,
const std::string name,
CCProcessor proc 
)
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().

sSet& marlin::MarlinSteerCheck::getErrors ( )
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().

std::shared_ptr<StringParameters> marlin::MarlinSteerCheck::getGlobalParameters ( )
inline

Returns the Global Parameters.

Definition at line 110 of file MarlinSteerCheck.h.

References _gparam.

Referenced by MainWindow::changeGearFile(), MainWindow::setMarlinSteerCheck(), and MainWindow::updateGlobalSection().

ProcVec& marlin::MarlinSteerCheck::getIProcs ( )
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
StringVec& marlin::MarlinSteerCheck::getLCIOFiles ( )
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().

CMProcessor* marlin::MarlinSteerCheck::getMProcs ( )
inline
sSet& marlin::MarlinSteerCheck::getPConditions ( )
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().

ColVec & marlin::MarlinSteerCheck::getProcCols ( const ProcVec v,
const std::string iotype 
) const
private
const std::string marlin::MarlinSteerCheck::getXMLFile ( )
inline

Definition at line 156 of file MarlinSteerCheck.h.

References _steeringFile.

const std::string marlin::MarlinSteerCheck::getXMLFileAbsPath ( )
inline

Definition at line 150 of file MarlinSteerCheck.h.

References _XMLFileAbsPath.

const std::string marlin::MarlinSteerCheck::getXMLFileName ( )
inline

Definition at line 153 of file MarlinSteerCheck.h.

References _XMLFileName.

const std::string marlin::MarlinSteerCheck::getXMLFileRelPath ( )
inline

Definition at line 147 of file MarlinSteerCheck.h.

References _XMLFileRelPath.

MarlinSteerCheck marlin::MarlinSteerCheck::operator= ( const marlin::MarlinSteerCheck )
delete
bool marlin::MarlinSteerCheck::parseXMLFile ( const std::string file,
const CommandLineParametersMap cmdlineparams = NULL 
)
private
CCProcessor * marlin::MarlinSteerCheck::popProc ( ProcVec v,
CCProcessor p 
)
private
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)
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 
)
bool marlin::MarlinSteerCheck::saveAsDOTFile ( const std::string file)
bool marlin::MarlinSteerCheck::saveAsXMLFile ( const std::string file)

Member Data Documentation

ProcVec marlin::MarlinSteerCheck::_aProc {}
private
sSet marlin::MarlinSteerCheck::_colValues {}
private

Definition at line 232 of file MarlinSteerCheck.h.

Referenced by getColsSet().

sSet marlin::MarlinSteerCheck::_errors {}
private
std::shared_ptr<StringParameters> marlin::MarlinSteerCheck::_gparam
private
ProcVec marlin::MarlinSteerCheck::_iProc {}
private
sColVecMap marlin::MarlinSteerCheck::_lcioCols {}
private

Definition at line 229 of file MarlinSteerCheck.h.

Referenced by addLCIOFile(), getLCIOCols(), and remLCIOFile().

StringVec marlin::MarlinSteerCheck::_lcioFiles {}
private

Definition at line 230 of file MarlinSteerCheck.h.

Referenced by addLCIOFile(), changeLCIOFilePos(), getLCIOFiles(), and remLCIOFile().

CMProcessor* marlin::MarlinSteerCheck::_marlinProcs =NULL
private

Definition at line 236 of file MarlinSteerCheck.h.

Referenced by getMProcs(), and MarlinSteerCheck().

IParser* marlin::MarlinSteerCheck::_parser
private

Definition at line 219 of file MarlinSteerCheck.h.

Referenced by parseXMLFile(), and ~MarlinSteerCheck().

sSet marlin::MarlinSteerCheck::_pConditions {}
private
std::string marlin::MarlinSteerCheck::_steeringFile
private

Definition at line 222 of file MarlinSteerCheck.h.

Referenced by dump_information(), getXMLFile(), MarlinSteerCheck(), and parseXMLFile().

std::string marlin::MarlinSteerCheck::_XMLFileAbsPath =""
private

Definition at line 224 of file MarlinSteerCheck.h.

Referenced by getXMLFileAbsPath().

std::string marlin::MarlinSteerCheck::_XMLFileName =""
private

Definition at line 223 of file MarlinSteerCheck.h.

Referenced by getXMLFileName().

std::string marlin::MarlinSteerCheck::_XMLFileRelPath =""
private

Definition at line 225 of file MarlinSteerCheck.h.

Referenced by getXMLFileRelPath().


The documentation for this class was generated from the following files: