SFrame 3.6
|
Class controlling SFrame analyses. More...
#include <core/include/SCycleController.h>
Public Member Functions | |
SCycleController (const TString &xmlConfigFile) | |
Constructor specifying the configuration file. | |
virtual | ~SCycleController () |
Default destructor. | |
virtual void | Initialize () throw ( SError ) |
Initialise the analysis from the configuration file. | |
virtual void | ExecuteAllCycles () throw ( SError ) |
Execute the analysis loop for all configured cycles. | |
virtual void | ExecuteNextCycle () throw ( SError ) |
Execute the analysis loop for the cycle next in line. | |
virtual void | SetConfig (const TString &xmlConfigFile) |
Set the name of the configuration file. | |
void | AddAnalysisCycle (ISCycleBase *cycleAlg) |
Add one analysis cycle to the end of all existing cycles. | |
UInt_t | GetCurCycle () |
Get the index of the current cycle. |
Class controlling SFrame analyses.
This is the main class that should be instantiated by the user in an analysis. It takes care of reading the analysis's configuration from an XML file, creating, configuring and running all the analysis "cycles".
It is instantiated and configured correctly in the sframe_main executable, so the user should probably not care about it too much.
Definition at line 45 of file SCycleController.h.
SCycleController::SCycleController | ( | const TString & | xmlConfigFile | ) |
Constructor specifying the configuration file.
The user has to specify a configuration file already at the construction of the object. This configuration file will be used later in SCycleController::Initialize to perform the configuration of the analysis job.
xmlConfigFile | The name of the configuration file |
Definition at line 62 of file SCycleController.cxx.
SCycleController::~SCycleController | ( | ) | [virtual] |
Default destructor.
This destructor actually does something. (Yay!) It deletes all the analysis cycles that have been created from the configuration in the XML file, and closes the connection to the PROOF server.
Definition at line 74 of file SCycleController.cxx.
void SCycleController::AddAnalysisCycle | ( | ISCycleBase * | cycleAlg | ) |
Add one analysis cycle to the end of all existing cycles.
This function could be used to add a cycle created in the main executable by hand, but it's not being used. Instead all the cycles are created by this class internally according to the configuration in the XML file.
cycleAlg | The cycle that should be added |
Definition at line 816 of file SCycleController.cxx.
Referenced by Initialize().
void SCycleController::ExecuteAllCycles | ( | ) | throw ( SError ) [virtual] |
Execute the analysis loop for all configured cycles.
This function runs all the analysis cycles that were configured one after another. The main program should call this after SCycleController::Initialize.
It actually uses SCycleController::ExecuteNextCycle to execute each of the cycles.
Definition at line 319 of file SCycleController.cxx.
References SLogger::endmsg(), ExecuteNextCycle(), INFO, and SError::StopExecution.
void SCycleController::ExecuteNextCycle | ( | ) | throw ( SError ) [virtual] |
Execute the analysis loop for the cycle next in line.
This function is responsible for calling the functions of the current cycle in line to execute its analysis. It also measures the time needed to execute the cycles, and prints it as an info message after the analysis has finished.
Definition at line 344 of file SCycleController.cxx.
References SCycleConfig::ArrangeInputData(), SCycleBaseExec::BeginCycle(), SFrame::CurrentInputDataName, SFrame::CycleConfigName, SCycleBaseExec::EndCycle(), SLogger::endmsg(), STree::EVENT_TREE, SCycleConfig::GetCacheSize(), ISCycleBaseConfig::GetConfig(), ISCycleBaseConfig::GetConfigurationObjects(), SInputData::GetEventsTotal(), SCycleConfig::GetInputData(), SCycleConfig::GetOutputDirectory(), SCycleConfig::GetPostFix(), SCycleStatistics::GetProcessedEvents(), SCycleConfig::GetProcessOnlyLocal(), SCycleConfig::GetProofNodes(), SCycleConfig::GetProofServer(), SCycleConfig::GetProofWorkDir(), SCycleConfig::GetRunMode(), SCycleStatistics::GetSkippedEvents(), SCycleConfig::GetStringConfig(), SInputData::GetType(), SCycleConfig::GetUseTreeCache(), SInputData::GetVersion(), INFO, STree::INPUT_TREE, SProofManager::Instance(), SLogWriter::Instance(), SProofManager::IsConfigured(), SCycleConfig::LOCAL, SParLocator::Locate(), SCycleBaseExec::Process(), SCycleConfig::PROOF, SFrame::ProofOutputName, REPORT_ERROR, REPORT_VERBOSE, SFrame::RunStatisticsName, ISCycleBaseConfig::SetConfig(), SProofManager::SetConfigured(), SCycleConfig::SetCycleName(), SCycleConfig::SetMsgLevel(), SError::SkipCycle, SError::StopExecution, SCycleConfig::ValidateInput(), and WARNING.
Referenced by ExecuteAllCycles().
UInt_t SCycleController::GetCurCycle | ( | ) | [inline] |
Get the index of the current cycle.
Definition at line 71 of file SCycleController.h.
void SCycleController::Initialize | ( | ) | throw ( SError ) [virtual] |
Initialise the analysis from the configuration file.
This is the first function that should be called for the object after it is created. It reads in the configuration of the analysis from the configuration file specified earlier, creates and configures all the analysis cycles defined in the configuration.
Definition at line 92 of file SCycleController.cxx.
References AddAnalysisCycle(), ALWAYS, DEBUG, SLogger::endmsg(), ERROR, FATAL, INFO, ISCycleBaseConfig::Initialize(), SLogWriter::Instance(), REPORT_ERROR, REPORT_VERBOSE, SError::request(), SLogWriter::SetMinType(), SError::SkipCycle, SError::StopExecution, VERBOSE, WARNING, and SError::what().
virtual void SCycleController::SetConfig | ( | const TString & | xmlConfigFile | ) | [inline, virtual] |
Set the name of the configuration file.
All configuration of the analysis is done in a single XML file. The file name from which this configuration should be read is specified with this function.
Definition at line 65 of file SCycleController.h.