18 """Prepare and execute a basf2 job to read generated events or generate new events then display the CDC tracks"""
21 output_folder = tempfile.gettempdir()
27 show_all_drawoptions =
False
40 """Get the display module"""
42 return cdc_display_module
45 """Translate the command-lne arguments to basf2-job parameter"""
48 argument_parser.add_argument(
53 help=
'Folder where the output files are written to. If the folder does not exist create it. '
56 argument_parser.add_argument(
60 help=
'Run in batch mode and do not show each event.'
63 argument_parser.add_argument(
67 help=
'Swtich to activate the legacy implementation written in python'
70 argument_parser.add_argument(
71 "--use_time_in_filename",
73 help=
'Use the current time in the names of the generated files'
76 argument_parser.add_argument(
80 help=
'Prefix to the names of the generated files'
83 argument_parser.add_argument(
88 const=
'TrackFinderMCTruthRecoTracks',
90 help=
'Generate the mc tracks using the TrackFinderMCTruthRecoTracks. Short hand for -f TrackFinderMCTruthRecoTracks'
93 subparser_description = \
95 Various options to configure what shall be drawn in the display.
96 Note that some options are only relevant, if the cellular automaton finder in the CDC has been run before.
98 draw_argument_group = argument_parser.add_argument_group(
100 description=subparser_description
106 drawoptions = cdc_display_module.all_drawoptions
108 drawoptions = cdc_display_module.drawoptions
110 for option
in sorted(drawoptions):
111 options_flag =
'--%s ' % option.replace(
'_',
'-')
113 draw_argument_group.add_argument(
117 default=getattr(cdc_display_module, option)
120 return argument_parser
123 """Configure the basf2 job script using the translated command-line arguments"""
128 cdc_display_module.output_folder = arguments.output_folder
129 cdc_display_module.interactive = arguments.interactive
131 cdc_display_module.use_python = arguments.use_python
132 cdc_display_module.use_cpp =
not arguments.use_python
133 cdc_display_module.use_time_in_filename = arguments.use_time_in_filename
134 cdc_display_module.filename_prefix = arguments.filename_prefix
137 drawoptions = cdc_display_module.all_drawoptions
139 drawoptions = cdc_display_module.drawoptions
141 for option
in drawoptions:
143 is_active_option = getattr(arguments, option)
144 except AttributeError:
147 print(
'Setting', option,
'to', is_active_option)
148 setattr(cdc_display_module, option, is_active_option)
151 """Create the basf2 path"""
def cdc_display_module(self)
def create_argument_parser(self, **kwds)
_cdc_display_module
Use the CDCSVGDisplay module to draw the CDC and tracks/hits.
def configure(self, arguments)
bool show_all_drawoptions
Switch to also show draw command line options only related to the cellular automaton track finder.
string filename_prefix
Prefix of the output files.
output_folder
Destination folder for displays.
finder_module
Name of the finder module to be used - can be everything that is accepted by tracking....