diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index 6ea509ad..c14efcce 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -148,6 +148,12 @@ def main(): help="Print all the configurable components available in the framework and exit", ) parser.add_argument("--gdb", action="store_true", help="Attach gdb debugger") + parser.add_argument( + "--interactive-root", + action="store_true", + help="Run with ROOT in interactive mode (e.g. to see plots)", + default=False, + ) # Once to parse the files and another time below to have the new parameters # in the namespace since parsing of the file happens when the namespace @@ -229,6 +235,11 @@ def main(): c = gaudimain() if not opts.dry_run: + if not opts.interactive_root: + from ROOT import gROOT + + gROOT.SetBatch(True) + # Do the real processing retcode = c.run(opts.gdb) # User requested stop returns non-zero exit code see: https://github.com/key4hep/k4FWCore/issues/125