17 """Harvester to select crops, postprocess, and inspect"""
20 output_file_name =
None
23 """This virtual method must be overridden by the inheriting class"""
24 raise RuntimeError(
"Override the harvesting_module method")
27 """Parse the arguments and append them to the harvester's list"""
29 harvesting_argument_group = argument_parser.add_argument_group(
"Harvest arguments")
31 harvesting_argument_group.add_argument(
34 dest=
"output_file_name",
35 default=argparse.SUPPRESS,
36 help=
"File name for the harvest products"
39 return argument_parser
42 """Save the raw crops as a pickle file"""
44 pickle.dump(crops, pickle_file)
47 """Load the raw crops from a pickle file"""
49 return pickle.load(pickle_file)
52 """Post-process the crops"""
59 except FileNotFoundError:
60 print(
"Crops pickle file not found. Create it now.")
62 harvesting_module.refine(crops)
67 """Add the harvester to the basf2 path"""
73 path.add_module(harvesting_module)
78 """Harvester to generate MC events followed by crop selection, postprocessing, inspection"""
def create_argument_parser(self, **kwds)
def harvesting_module(self, path=None)
def adjust_path(self, path)
None output_file_name
Disable the writing of an output ROOT file.
def pickle_crops(self, harvesting_module, crops, **kwds)
None output_file_name
There is no default for the name of the output TFile.
bool postprocess_only
By default, browse the output TFile too.