12Generic script to run the tracking validation code on-top of a root file containing
13simulated events. This can speed up the development process allows for an easier reproducibility
16Example to run only the cellular automaton track finder in the CDC:
18python tracking/examples/TrackingValidation.py -i <input.root> -o <output.root> -m TrackFinderCDCAutomaton
20Example to run the full reconstruction:
22python tracking/examples/TrackingValidation.py -i <input.root> -o <output.root> -m FullReco
32CONTACT =
'software-tracking@belle2.org'
34basf2.set_random_seed(1337)
38 """Run-Class to run the validation on top of a simulated root file. Most parameters can be chosen from command line."""
43 components = [
'PXD',
'SVD',
'CDC',
'BeamPipe',
44 'MagneticFieldConstant4LimitedRCDC']
54 argument_parser = argparse.ArgumentParser()
57 argument_parser.add_argument(
61 help=
'Perform fitting of the generated tracks with Genfit. Default is not '
62 'to perform a fit but use the seed values generated in track finding.')
64 argument_parser.add_argument(
'-s',
'--show', action=
'store_true',
65 help=
'Show generated plots in a TBrowser immediately.')
67 argument_parser.add_argument(
'-i',
'--input', type=str,
68 nargs=
"?", default=
None, required=
True,
69 help=
'Path to the input root file containing the simulated events.')
71 argument_parser.add_argument(
'-o',
'--output', type=str,
72 nargs=
"?", default=
"TrackingValidation.root",
73 help=
'Name of the output file used to store the validation plots.')
75 argument_parser.add_argument(
80 'TFCDC_TrackFinderAutomaton',
83 default=
'Reconstruction',
84 help=
'Short name of track finding module or Reconstruction for the full reconstruction chain.')
86 arguments = argument_parser.parse_args()
92 standalone_validation_run.fit_tracks =
True
94 standalone_validation_run.fit_tracks =
False
98 standalone_validation_run.root_input_file = arguments.input
100 standalone_validation_run.run_simulation =
False
104 standalone_validation_run.output_file_name = arguments.output
108 standalone_validation_run.finder_module = arguments.module
112 standalone_validation_run.execute()
117 output_file_name = standalone_validation_run.output_file_name
118 tFile = ROOT.TFile(output_file_name)
119 tBrowser = ROOT.TBrowser()
120 tBrowser.BrowseObject(tFile)
122 input(
'Press enter to close.')
126if __name__ ==
'__main__':