15#include "Framework/Configure/Python.h"
51int main(
int argc,
char* argv[])
try {
58 for (ptrpy = 1; ptrpy < argc; ptrpy++) {
59 if (strstr(argv[ptrpy],
".py"))
break;
64 std::cout <<
" ** No python configuration script provided (must end in "
70 std::cout <<
"---- LDMXSW: Loading configuration --------" << std::endl;
76 argv + ptrpy + 1, argc - ptrpy - 1)};
77 p = std::make_unique<framework::Process>(config);
83 std::cerr <<
"Configuration Error [" << e.
name() <<
"] : " << e.
message()
85 std::cerr <<
" at " << e.
module() <<
":" << e.
line() <<
" in "
90 std::cout <<
"---- LDMXSW: Configuration load complete --------"
95 memset(&act,
'\0',
sizeof(act));
96 if (sigaction(SIGINT, &act, NULL) < 0) {
110 std::cout <<
"---- LDMXSW: Starting event processing --------" << std::endl;
121 auto theLog_{framework::logging::makeLogger(
"fire")};
122 ldmx_log(fatal) <<
"[" << e.
name() <<
"] : " << e.
message() <<
"\n"
123 <<
" at " << e.
module() <<
":" << e.
line() <<
" in "
126 framework::logging::close();
130 std::cout <<
"---- LDMXSW: Event processing complete --------" << std::endl;
132}
catch (
const std::exception& e) {
133 std::cerr <<
"Unrecognized Exception: " << e.what() << std::endl;
138 std::cout <<
"Usage: fire {configuration_script.py} [arguments to "
139 "configuration script]"
141 std::cout <<
" configuration_script.py (required) python script to "
142 "configure the processing"
144 std::cout <<
" arguments (optional) passed to "
145 "configuration script when run in python"
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
Standard base exception class with some useful output information.
const std::string & function() const
Get the function name where the exception occurred.
int line() const
Get the source line number where the exception occurred.
const std::string & message() const
Get the message of the exception.
const std::string & name() const
Get the name of the exception.
const std::string & stackTrace() const
Get the full stack trace.
const std::string & module() const
Get the source filename where the exception occurred.
Parameters run(const std::string &root_object, const std::string &pythonScript, char *args[], int nargs)
run the python script and extract the parameters
std::unique_ptr< Process > ProcessHandle
A handle to the current process Used to pass a process from ConfigurePython to fire....