18 return logging.getLogger(__name__)
25class PostProcessingRunMixin(EmptyRun):
26 """Post-process the basf2 job output"""
29 postprocess_only =
False
32 """Parse the command-line post-processing arguments"""
34 postprocess_argument_group = argument_parser.add_argument_group(
"Postprocessing arguments")
35 postprocess_argument_group.add_argument(
40 dest=
'postprocess_only',
41 help=
'Only run the post processing of this run.',)
43 return argument_parser
46 """Post-process the basf2 job output"""
53 """By default, do nothing. (may be overridden)"""
56class BrowseTFileOnTerminateRunMixin(PostProcessingRunMixin):
57 """Browse interactively the basf2 job output"""
60 output_file_name =
None
65 """Parse the command-line TFile-browsing arguments"""
68 postprocess_argument_group = argument_parser
69 for group
in argument_parser._action_groups:
70 if group.title ==
"Postprocessing arguments":
71 postprocess_argument_group = group
74 postprocess_argument_group.add_argument(
80 help=
'Show generated plots in a TBrowser immediately.',)
82 return argument_parser
85 """Browse the TFile interactively"""
88 root_utils.root_browse(tfile)
89 input(
"Close with return key.")
95 """Configure for basf2 job output ROOT TFile"""
98 root_output_file =
None
101 """Parse the command-line output-file-specification argument"""
103 argument_parser.add_argument(
105 help=
'Output file to which the simulated events shall be written.'
108 return argument_parser
110 def create_path(self):
111 """Create a new basf2 path and add the RootOutput module to it"""
112 path = super().create_path()
def create_argument_parser(self, **kwds)
None output_file_name
There is no default for the name of the output TFile.
bool show_results
By default, do not show the browsing results.
def create_argument_parser(self, **kwds)
bool postprocess_only
By default, browse the output TFile too.
def create_argument_parser(self, **kwds)
None root_output_file
There is no default for the name of the output TFile.