LDMX Software
|
Utility class which reads/executes a python script and creates a Process object based on the input. More...
#include <ConfigurePython.h>
Public Member Functions | |
ConfigurePython (const std::string &pythonScript, char *args[], int nargs) | |
Class constructor. | |
~ConfigurePython ()=default | |
Class destructor. | |
ProcessHandle | makeProcess () |
Create a process object based on the python file information. | |
const framework::config::Parameters | get () const |
Get a handle to the configuration. | |
Static Public Attributes | |
static std::string | root_module = "ldmxcfg" |
the root configuration module name | |
static std::string | root_class = "Process" |
the root configuration class name | |
static std::string | root_object = "lastProcess" |
the root configuration object name | |
Private Attributes | |
framework::config::Parameters | configuration_ |
The entire configuration for this process. | |
Utility class which reads/executes a python script and creates a Process object based on the input.
Definition at line 19 of file ConfigurePython.h.
framework::ConfigurePython::ConfigurePython | ( | const std::string & | pythonScript, |
char * | args[], | ||
int | nargs | ||
) |
Class constructor.
This method contains all the parsing and execution of the python script.
Exception | if any necessary components of the python configuration are missing. e.g. The Process class or the different members of the lastProcess object. |
The basic premise of this constructor is to execute the python configuration script by loading it into python as a module. Then, after the script has been executed, all of the parameters for the Process and EventProcessors are gathered from python. The fact that the script has been executed means that the user can get up to a whole lot of shenanigans that can help them make their work more efficient.
pythonScript | Filename location of the python script. |
args | Commandline arguments to be passed to the python script. |
nargs | Number of commandline arguments. |
Definition at line 273 of file ConfigurePython.cxx.
References configuration_, framework::getMembers(), root_class, root_module, root_object, and framework::config::Parameters::setParameters().
|
default |
Class destructor.
Does nothing at the moment.
|
inline |
Get a handle to the configuration.
Definition at line 71 of file ConfigurePython.h.
References configuration_.
ProcessHandle framework::ConfigurePython::makeProcess | ( | ) |
Create a process object based on the python file information.
No python parsing actually happens in this function. All of the parsing is done in the constructor, this just copies that information from configuration_ into the Process object.
Definition at line 387 of file ConfigurePython.cxx.
References configuration_.
|
private |
The entire configuration for this process.
Contains all parameters that were passed in the python in a recursive manner. For example, this would contain a key called 'sequence' that has a value of a vector of Parmaeters, each one corresponding to a processor.
Definition at line 82 of file ConfigurePython.h.
Referenced by ConfigurePython(), get(), and makeProcess().
|
static |
the root configuration class name
Definition at line 24 of file ConfigurePython.h.
Referenced by ConfigurePython().
|
static |
the root configuration module name
Definition at line 22 of file ConfigurePython.h.
Referenced by ConfigurePython().
|
static |
the root configuration object name
Definition at line 26 of file ConfigurePython.h.
Referenced by ConfigurePython().