Belle II Software development
|
This class combines all subsystems of the framework, and exports the main interface to Python. More...
#include <Framework.h>
Public Member Functions | |
Framework () | |
Constructor. | |
virtual | ~Framework () |
Destructor. | |
Static Public Member Functions | |
static void | addModuleSearchPath (const std::string &path) |
Adds a new filepath to the list of filepaths which are searched for modules. | |
static void | setExternalsPath (const std::string &path) |
Sets the path in which the externals of the framework are located. | |
static ModulePtr | registerModule (const std::string &moduleName) |
Registers a new module to the framework and returns a shared pointer. | |
static ModulePtr | registerModule (const std::string &moduleName, const std::string &sharedLibPath) |
Registers a new module to the framework and returns a shared pointer. | |
static void | process (PathPtr startPath, long maxEvent=0) |
Processes up to maxEvent events by starting with the first module in the specified path. | |
static void | setNumberProcesses (int numProcesses) |
Function to set number of worker processes for parallel processing. | |
static int | getNumberProcesses () |
Function to get number of worker processes for parallel processing. | |
static void | setPicklePath (const std::string &path) |
Function to set the path to the file where the pickled path is stored. | |
static std::string | getPicklePath () |
Function to get the path to the file where the pickled path is stored. | |
static void | setStreamingObjects (const boost::python::list &streamingObjects) |
Function to set streaming objects for Tx module. | |
static void | setRealm (const std::string &realm) |
Function to set the execution realm. | |
static void | setRunType (const Const::ERunType runType) |
Function to set the run type (beam or cosmic) | |
static void | setCosmicRun () |
Function to set that the script is running on cosmics data (by default it runs on beam data) | |
static void | setBeamRun () |
Function to set that the script is running on beam data (by default it runs on beam data, no need to use it if the run type has not been changed before). | |
static void | writeSimulationSteps () |
Function for writing the simulation steps of each event into csv files. | |
static std::string | findFile (const std::string &filename, const std::string &type, bool ignore_errors=false) |
Find a file. | |
static boost::python::list | getModuleSearchPathsPython () |
Returns a list of all module search paths known to the framework. | |
static boost::python::dict | getAvailableModulesPython () |
Returns a dictionary containing the found modules and the filenames of the shared libraries in which they can be found. | |
static boost::python::list | getRegisteredModulesPython () |
Returns a list of all registered modules. | |
static void | exposePythonAPI () |
Exposes methods of the Framework class to Python. | |
This class combines all subsystems of the framework, and exports the main interface to Python.
Definition at line 28 of file Framework.h.
Framework | ( | ) |
Constructor.
Definition at line 39 of file Framework.cc.
|
virtual |
Destructor.
Definition at line 51 of file Framework.cc.
|
static |
Adds a new filepath to the list of filepaths which are searched for modules.
If a module is requested by the method registerModule(), all module search paths are scanned for shared libraries or map files which contain the requested module.
path | The module search path which should be added to the list of paths. |
Definition at line 64 of file Framework.cc.
|
static |
Exposes methods of the Framework class to Python.
Definition at line 313 of file Framework.cc.
|
static |
Find a file.
This is a wrapper around FileSystem::findFile() to be able to call it nicely from python and create a FileNotFoundError
if the file cannot be found.
Known types:
FileSystem::findFile
, look in $BELLE2_LOCAL_DIR and then $BELLE2_RELEASE_DIR and then relative to local dirfilename | relative filename to look for, either in a central place or in the current working directory |
type | if set, specifies where to look if the file cannot be found locally |
ignore_errors | if true don't print any errors and silently return None. Otherwise this function will raise a FileNotFoundError exception if the file cannot be found. |
Definition at line 239 of file Framework.cc.
|
static |
Returns a dictionary containing the found modules and the filenames of the shared libraries in which they can be found.
Definition at line 273 of file Framework.cc.
|
static |
Returns a list of all module search paths known to the framework.
Definition at line 263 of file Framework.cc.
|
static |
Function to get number of worker processes for parallel processing.
Definition at line 174 of file Framework.cc.
|
static |
Function to get the path to the file where the pickled path is stored.
Definition at line 186 of file Framework.cc.
|
static |
Returns a list of all registered modules.
Definition at line 282 of file Framework.cc.
|
static |
Processes up to maxEvent events by starting with the first module in the specified path.
This method starts processing events only if there is a module in the path which is capable of specifying the end of the data flow.
startPath | The processing starts with the first module of this path. |
maxEvent | The maximum number of events that will be processed. If the number is smaller than 1, all events will be processed (default). |
Definition at line 88 of file Framework.cc.
|
static |
Registers a new module to the framework and returns a shared pointer.
This method creates a new Module based on the given module name. If the shared library file containing the module was already loaded, the module is directly created. Otherwise the shared library file is dynamically loaded first.
If the module could not be registered, an exception of type ModuleNotCreatedError is thrown.
moduleName | The unique name of the module which should be created. |
Definition at line 76 of file Framework.cc.
|
static |
Registers a new module to the framework and returns a shared pointer.
This method creates a new Module based on the given module name. If the shared library file containing the module was already loaded, the module is directly created. Otherwise the shared library file is dynamically loaded first.
If the module could not be registered, an exception of type ModuleNotCreatedError is thrown.
moduleName | The unique name of the module which should be created. |
sharedLibPath | Optional: The shared library from which the module should be registered (not a map file !). |
Definition at line 82 of file Framework.cc.
|
static |
Function to set that the script is running on beam data (by default it runs on beam data, no need to use it if the run type has not been changed before).
Definition at line 226 of file Framework.cc.
|
static |
Function to set that the script is running on cosmics data (by default it runs on beam data)
Definition at line 221 of file Framework.cc.
|
static |
Sets the path in which the externals of the framework are located.
path | The path in which the externals of the framework are located. |
Definition at line 70 of file Framework.cc.
|
static |
Function to set number of worker processes for parallel processing.
Definition at line 168 of file Framework.cc.
|
static |
Function to set the path to the file where the pickled path is stored.
path | path to file where the pickled path is stored |
Definition at line 180 of file Framework.cc.
|
static |
Function to set the execution realm.
realm | basf2 execution realm |
Definition at line 197 of file Framework.cc.
|
static |
Function to set the run type (beam or cosmic)
Definition at line 216 of file Framework.cc.
|
static |
Function to set streaming objects for Tx module.
streamingObjects | objects to be streamed |
Definition at line 191 of file Framework.cc.
|
static |
Function for writing the simulation steps of each event into csv files.
This should not be used during production jobs, but only for producing events for the Belle II Virtual Reality application.
Definition at line 231 of file Framework.cc.