11 """Prepare and execute a basf2 job to read generated events or generate new events then display the CDC tracks"""
14 output_folder =
'/tmp'
20 show_all_drawoptions =
False
33 """Get the display module"""
35 return cdc_display_module
38 """Translate the command-lne arguments to basf2-job parameter"""
41 argument_parser.add_argument(
46 help=
'Folder where the output files are written to. If the folder does not exist create it. '
49 argument_parser.add_argument(
53 help=
'Run in batch mode and do not show each event.'
56 argument_parser.add_argument(
60 help=
'Swtich to activate the legacy implementation written in python'
63 argument_parser.add_argument(
64 "--use_time_in_filename",
66 help=
'Use the current time in the names of the generated files'
69 argument_parser.add_argument(
73 help=
'Prefix to the names of the generated files'
76 argument_parser.add_argument(
81 const=
'TrackFinderMCTruthRecoTracks',
83 help=
'Generate the mc tracks using the TrackFinderMCTruthRecoTracks. Short hand for -f TrackFinderMCTruthRecoTracks'
86 subparser_description = \
88 Various options to configure what shall be drawn in the display.
89 Note that some options are only relevant, if the cellular automaton finder in the CDC has been run before.
91 draw_argument_group = argument_parser.add_argument_group(
93 description=subparser_description
99 drawoptions = cdc_display_module.all_drawoptions
101 drawoptions = cdc_display_module.drawoptions
103 for option
in sorted(drawoptions):
104 options_flag =
'--%s ' % option.replace(
'_',
'-')
106 draw_argument_group.add_argument(
110 default=getattr(cdc_display_module, option)
113 return argument_parser
116 """Configure the basf2 job script using the translated command-line arguments"""
121 cdc_display_module.output_folder = arguments.output_folder
122 cdc_display_module.interactive = arguments.interactive
124 cdc_display_module.use_python = arguments.use_python
125 cdc_display_module.use_cpp =
not arguments.use_python
126 cdc_display_module.use_time_in_filename = arguments.use_time_in_filename
127 cdc_display_module.filename_prefix = arguments.filename_prefix
130 drawoptions = cdc_display_module.all_drawoptions
132 drawoptions = cdc_display_module.drawoptions
134 for option
in drawoptions:
136 is_active_option = getattr(arguments, option)
137 except AttributeError:
140 print(
'Setting', option,
'to', is_active_option)
141 setattr(cdc_display_module, option, is_active_option)
144 """Create the basf2 path"""