SFrame 3.6
|
Base class for reading the XML configuration. More...
#include <core/include/SCycleBaseConfig.h>
Public Member Functions | |
SCycleBaseConfig () | |
Default constructor. | |
void | Initialize (TXMLNode *) throw ( SError ) |
Function initialising the cycle. | |
const SCycleConfig & | GetConfig () const |
Get the overall cycle configuration object. | |
SCycleConfig & | GetConfig () |
Get the overall cycle configuration object. | |
virtual void | SetConfig (const SCycleConfig &config) |
Set the overall cycle configuration. | |
virtual const TList & | GetConfigurationObjects () const |
Get the list of all declared configuration objects. | |
virtual void | SetConfInput (TList *input) |
Set which list should be used for the configuration input. | |
virtual TList * | GetConfInput () const |
Check which list should be used for the configuration input. | |
void | DeclareProperty (const std::string &name, std::string &value) |
Declare a std::string property. | |
void | DeclareProperty (const std::string &name, int &value) |
Declare an int property. | |
void | DeclareProperty (const std::string &name, double &value) |
Declare a double property. | |
void | DeclareProperty (const std::string &name, bool &value) |
Declare a bool property. | |
void | DeclareProperty (const std::string &name, std::vector< std::string > &value) |
Declare a std::vector<std::string> property. | |
void | DeclareProperty (const std::string &name, std::vector< int > &value) |
Declare a std::vector<int> property. | |
void | DeclareProperty (const std::string &name, std::vector< double > &value) |
Declare a std::vector<double> property. | |
void | DeclareProperty (const std::string &name, std::vector< bool > &value) |
Declare a std::vector<bool> property. | |
void | AddConfigObject (TObject *object) |
Add a configuration object that should be available on the PROOF nodes. | |
TObject * | GetConfigObject (const char *name) const |
Get a configuration object on the PROOF nodes. | |
Protected Member Functions | |
virtual SInputData | InitializeInputData (TXMLNode *) throw ( SError ) |
Function that reads an InputData definition. | |
virtual void | InitializeUserConfig (TXMLNode *) throw ( SError ) |
Function that reads the user properties from the XML. | |
void | SetProperty (const std::string &name, const std::string &value) throw ( SError ) |
Internal function for setting a property value. | |
std::string | DecodeEnvVar (const std::string &value) const |
Function for decoding a shell environment variable. | |
Protected Attributes | |
SCycleConfig | m_config |
The cycle configuration: |
Base class for reading the XML configuration.
This part of the SCycleBase class is responsible for handling the configuration of the cycle. It can read the cycle's part of the configuration XML, it handles the properties of the cycle and it provides all these information for the "higher level" parts of the SCycleBase code.
Definition at line 47 of file SCycleBaseConfig.h.
SCycleBaseConfig::SCycleBaseConfig | ( | ) |
Default constructor.
The constructor only initialises the base class.
Definition at line 87 of file SCycleBaseConfig.cxx.
References REPORT_VERBOSE.
void SCycleBaseConfig::AddConfigObject | ( | TObject * | object | ) |
Add a configuration object that should be available on the PROOF nodes.
Definition at line 404 of file SCycleBaseConfig.cxx.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
std::string & | value | ||
) |
Declare a std::string property.
Use this function in the constructor of your analysis cycle to declare an std::string object as a property to be set up by the framework according to the configuration set in the XML file.
name | The name under which the property appears in XML |
value | The std::string object that you use as the property |
Definition at line 250 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
int & | value | ||
) |
Declare an int property.
Use this function in the constructor of your analysis cycle to declare an int variable as a property to be set up by the framework according to the configuration set in the XML file.
name | The name under which the property appears in XML |
value | The int variable that you use as the property |
Definition at line 269 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
double & | value | ||
) |
Declare a double property.
Use this function in the constructor of your analysis cycle to declare a double variable as a property to be set up by the framework according to the configuration set in the XML file.
name | The name under which the property appears in XML |
value | The double variable that you use as the property |
Definition at line 287 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
bool & | value | ||
) |
Declare a bool property.
Use this function in the constructor of your analysis cycle to declare a bool variable as a property to be set up by the framework according to the configuration set in the XML file. The boolean property can be specified in a number of ways. Either with the (case insensitive) "true" and "false" words, or with the 0 (false) and 1 (true) numbers. (Actually all non-zero numbers are translated as "true".)
name | The name under which the property appears in XML |
value | The bool variable that you use as the property |
Definition at line 310 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
std::vector< std::string > & | value | ||
) |
Declare a std::vector<std::string> property.
Use this function in the constructor of your analysis cycle to declare a vector of std::string objects as a property to be set up by the framework according to the configuration set in the XML file. The strings have to be put as a space separated list in the XML.
name | The name under which the property appears in XML |
value | The object that you use as the property |
Definition at line 329 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
std::vector< int > & | value | ||
) |
Declare a std::vector<int> property.
Use this function in the constructor of your analysis cycle to declare a vector of int variables as a property to be set up by the framework according to the configuration set in the XML file. Ints have to be put as a space separated list in the XML.
name | The name under which the property appears in XML |
value | The object that you use as the property |
Definition at line 349 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
std::vector< double > & | value | ||
) |
Declare a std::vector<double> property.
Use this function in the constructor of your analysis cycle to declare a vector of double variables as a property to be set up by the framework according to the configuration set in the XML file. Doubles have to be put as a space separated list in the XML.
name | The name under which the property appears in XML |
value | The object that you use as the property |
Definition at line 369 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
void SCycleBaseConfig::DeclareProperty | ( | const std::string & | name, |
std::vector< bool > & | value | ||
) |
Declare a std::vector<bool> property.
Use this function in the constructor of your analysis cycle to declare a vector of bool variables as a property to be set up by the framework according to the configuration set in the XML file. Bools have to be put as a space separated list in the XML. A boolean property can be specified in a number of ways. Either with the (case insensitive) "true" and "false" words, or with the 0 (false) and 1 (true) numbers. (Actually all non-zero numbers are translated as "true".) They can be freely mixed.
name | The name under which the property appears in XML |
value | The object that you use as the property |
Definition at line 393 of file SCycleBaseConfig.cxx.
References CHECK_FOR_DUPLICATES.
std::string SCycleBaseConfig::DecodeEnvVar | ( | const std::string & | value | ) | const [protected] |
Function for decoding a shell environment variable.
This function simply uses TSystem to do the environment variable expansion in path names. One can use either "$SOMETHING" or "$(SOMETHING)" in the path names. (The latter is also Win32 compatible, not that it matters for SFrame...)
Note that now the expansion is only done if the property begins with ":exp:". If it does, then these 5 characters are removed from the beginning of the string, and the rest of the string is given to TSystem for expansion.
value | The property that you want expanded based on the environment settings |
Definition at line 749 of file SCycleBaseConfig.cxx.
References REPORT_ERROR.
const SCycleConfig & SCycleBaseConfig::GetConfig | ( | ) | const [virtual] |
Get the overall cycle configuration object.
Implements ISCycleBaseConfig.
Definition at line 187 of file SCycleBaseConfig.cxx.
References m_config.
SCycleConfig & SCycleBaseConfig::GetConfig | ( | ) | [virtual] |
Get the overall cycle configuration object.
Implements ISCycleBaseConfig.
Definition at line 192 of file SCycleBaseConfig.cxx.
References m_config.
TObject * SCycleBaseConfig::GetConfigObject | ( | const char * | name | ) | const |
Get a configuration object on the PROOF nodes.
Definition at line 410 of file SCycleBaseConfig.cxx.
const TList & SCycleBaseConfig::GetConfigurationObjects | ( | ) | const [virtual] |
Get the list of all declared configuration objects.
Implements ISCycleBaseConfig.
Definition at line 219 of file SCycleBaseConfig.cxx.
TList * SCycleBaseConfig::GetConfInput | ( | ) | const [virtual] |
Check which list should be used for the configuration input.
Implements ISCycleBaseConfig.
Definition at line 230 of file SCycleBaseConfig.cxx.
void SCycleBaseConfig::Initialize | ( | TXMLNode * | node | ) | throw ( SError ) [virtual] |
Function initialising the cycle.
Basically everything about an analysis in SFrame is set up through a main XML configuration file that describes the given analysis. This function is called by the framework to initialise the cycle based on the part of the XML that describes it.
It should generally not be called by the user.
node | The top XML node describing the cycle |
Implements ISCycleBaseConfig.
Definition at line 103 of file SCycleBaseConfig.cxx.
References SLogger::endmsg(), INFO, SCycleConfig::LOCAL, SCycleConfig::PROOF, REPORT_VERBOSE, and WARNING.
SInputData SCycleBaseConfig::InitializeInputData | ( | TXMLNode * | node | ) | throw ( SError ) [protected, virtual] |
Function that reads an InputData definition.
Definition at line 425 of file SCycleBaseConfig.cxx.
References SInputData::AddDataSet(), SInputData::AddGenCut(), SInputData::AddSFileIn(), SInputData::AddTree(), DEBUG, SLogger::endmsg(), STree::EVENT_TREE, SInputData::GetType(), SInputData::GetVersion(), STreeTypeDecoder::GetXMLCode(), INFO, STree::INPUT_TREE, STreeTypeDecoder::Instance(), STree::OUTPUT_TREE, REPORT_VERBOSE, SInputData::SetCacheable(), SInputData::SetNEventsMax(), SInputData::SetNEventsSkip(), SInputData::SetSkipValid(), SInputData::SetTotalLumi(), SInputData::SetType(), and SInputData::SetVersion().
void SCycleBaseConfig::InitializeUserConfig | ( | TXMLNode * | node | ) | throw ( SError ) [protected, virtual] |
Function that reads the user properties from the XML.
Definition at line 605 of file SCycleBaseConfig.cxx.
References DEBUG, SLogger::endmsg(), and REPORT_VERBOSE.
void SCycleBaseConfig::SetConfig | ( | const SCycleConfig & | config | ) | [virtual] |
Set the overall cycle configuration.
Implements ISCycleBaseConfig.
Definition at line 197 of file SCycleBaseConfig.cxx.
References SCycleConfig::GetProperties(), m_config, and SetProperty().
void SCycleBaseConfig::SetConfInput | ( | TList * | input | ) | [virtual] |
Set which list should be used for the configuration input.
Implements ISCycleBaseConfig.
Definition at line 224 of file SCycleBaseConfig.cxx.
void SCycleBaseConfig::SetProperty | ( | const std::string & | name, |
const std::string & | value | ||
) | throw ( SError ) [protected] |
Internal function for setting a property value.
Definition at line 656 of file SCycleBaseConfig.cxx.
References SLogger::endmsg(), and WARNING.
Referenced by SetConfig().
SCycleConfig SCycleBaseConfig::m_config [protected] |
The cycle configuration:
Definition at line 108 of file SCycleBaseConfig.h.
Referenced by GetConfig(), and SetConfig().