4 from .minimal
import EmptyRun
11 return logging.getLogger(__name__)
18 class PostProcessingRunMixin(EmptyRun):
19 """Post-process the basf2 job output"""
22 postprocess_only =
False
25 """Parse the command-line post-processing arguments"""
27 postprocess_argument_group = argument_parser.add_argument_group(
"Postprocessing arguments")
28 postprocess_argument_group.add_argument(
33 dest=
'postprocess_only',
34 help=
'Only run the post processing of this run.',)
36 return argument_parser
39 """Post-process the basf2 job output"""
46 """By default, do nothing. (may be overridden)"""
50 class BrowseTFileOnTerminateRunMixin(PostProcessingRunMixin):
51 """Browse interactively the basf2 job output"""
54 output_file_name =
None
59 """Parse the command-line TFile-browsing arguments"""
62 postprocess_argument_group = argument_parser
63 for group
in argument_parser._action_groups:
64 if group.title ==
"Postprocessing arguments":
65 postprocess_argument_group = group
68 postprocess_argument_group.add_argument(
74 help=
'Show generated plots in a TBrowser immediatly.',)
76 return argument_parser
79 """Browse the TFile interactively"""
82 root_utils.root_browse(tfile)
83 input(
"Close with return key.")
89 """Configure for basf2 job output ROOT TFile"""
92 root_output_file =
None
95 """Parse the command-line output-file-specification argument"""
97 argument_parser.add_argument(
99 help=
'Output file to which the simulated events shall be written.'
102 return argument_parser
105 """Create a new basf2 path and add the RootOutput module to it"""