15#include "Framework/ConfigurePython.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 p = cfg.makeProcess();
82 std::cerr <<
"Configuration Error [" << e.
name() <<
"] : " << e.
message()
84 std::cerr <<
" at " << e.
module() <<
":" << e.
line() <<
" in "
89 std::cout <<
"---- LDMXSW: Configuration load complete --------"
94 memset(&act,
'\0',
sizeof(act));
95 if (sigaction(SIGINT, &act, NULL) < 0) {
109 std::cout <<
"---- LDMXSW: Starting event processing --------" << std::endl;
119 auto theLog_{framework::logging::makeLogger(
121 ldmx_log(fatal) <<
"[" << e.
name() <<
"] : " << e.
message() <<
"\n"
122 <<
" at " << e.
module() <<
":" << e.
line() <<
" in "
124 framework::logging::close();
128 std::cout <<
"---- LDMXSW: Event processing complete --------" << std::endl;
130}
catch (
const std::exception& e) {
131 std::cerr <<
"Unrecognized Exception: " << e.what() << std::endl;
136 std::cout <<
"Usage: fire {configuration_script.py} [arguments to "
137 "configuration script]"
139 std::cout <<
" configuration_script.py (required) python script to "
140 "configure the processing"
142 std::cout <<
" arguments (optional) passed to "
143 "configuration script when run in python"
Class which represents the process under execution.
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 & module() const
Get the source filename where the exception occurred.
std::unique_ptr< Process > ProcessHandle
A handle to the current process Used to pass a process from ConfigurePython to fire....