Belle II Software development
SegmentQuadTreeRun Class Reference
Inheritance diagram for SegmentQuadTreeRun:
StandardEventGenerationRun ReadOrGenerateEventsRun MinimalRun EmptyRun

Public Member Functions

 create_path (self)
 
 create_argument_parser (self, **kwds)
 
 configure (self, arguments)
 
 execute (self)
 
 name (self)
 
 configure_and_execute_from_commandline (self)
 
 run (self, path)
 
 configure_from_commandline (self)
 
 adjust_path (self, path)
 

Static Public Attributes

 display_module_segments
 Use CDCSVGDisplay to draw the MCTrackCand segments.
 
 draw_gftrackcand_trajectories
 Do not draw the genfit MCTrackCand trajectories.
 
 draw_gftrackcands
 Draw the genfit MCTrackCands.
 
 draw_clusters
 Do not draw the associated clusters.
 
 track_cands_store_array_name
 Tell the plotter where to find the information.
 
 display_module_tracks
 Use CDCSVGDisplay to draw the TrackCand information.
 
 display_module_mc
 Use CDCSVGDisplay to draw the MC tracks.
 
 draw_segments_mctrackid
 Draw the track IDs.
 
 plotter_module = SegmentQuadTreePlotter()
 Convert the information to QuadTree segments then draw these.
 
 draw_quad_tree_content
 Draw the QuadTree segments.
 
 draw_segment_intersection
 Draw the segment intersections.
 
 draw_mc_information
 Draw the MC information.
 
 generator_module = None
 By default, do not generate events.
 
str detector_setup = "Default"
 By default, use the default detector setup.
 
list bkg_files = []
 By default, no background overlay.
 
 components = None
 By default, do specific components.
 
bool disable_deltas = False
 By default, do not disable delta-ray generation.
 
 simulation_output = None
 By default, do no store the simulation output.
 
bool allow_input = True
 By default, this basf2 job can read events from an input ROOT TFile.
 
int n_events = 10000
 By default, process 10000 events.
 
 root_input_file = None
 By default, there is no input ROOT TFile.
 
 random_seed = None
 By default, the random-number seed is unassigned.
 
int n_processes = 0
 By default, no parallel processing.
 
int n_events_to_skip = 0
 By default, do not skip any events at the start of the input ROOT TFile.
 
str description = "Empty execution of basf2"
 Description of the run setup to be displayed on command line.
 

Detailed Description

Create segments and plot them in a segment quad tree

Definition at line 20 of file segment_quad_tree.py.

Member Function Documentation

◆ adjust_path()

adjust_path ( self,
path )
inherited
Hook that gives the opportunity to check the path for consistency before processing it

Reimplemented in VXDTF2TrackingValidation, and VXDTF2TrackingValidationBkg.

Definition at line 94 of file minimal.py.

94 def adjust_path(self, path):
95 """Hook that gives the opportunity to check the path for consistency before processing it"""
96
97# Minimal run stub defining some general parameters
98
99

◆ configure()

configure ( self,
arguments )
inherited
Configure for basf2 job; disable ROOT input if simulating events

Reimplemented from EmptyRun.

Definition at line 122 of file event_generation.py.

122 def configure(self, arguments):
123 """Configure for basf2 job; disable ROOT input if simulating events"""
124 super().configure(arguments)
125 if self.simulation_output:
126 get_logger().info("Requested to simulation run. Deactivate input file")
127
128 self.root_input_file = None
129

◆ configure_and_execute_from_commandline()

configure_and_execute_from_commandline ( self)
inherited
Configure basf2 job script from command-line arguments then run it

Definition at line 45 of file minimal.py.

45 def configure_and_execute_from_commandline(self):
46 """Configure basf2 job script from command-line arguments then run it"""
47 self.configure_from_commandline()
48 self.execute()
49

◆ configure_from_commandline()

configure_from_commandline ( self)
inherited
Convert the command-line arguments to a basf2 job script

Definition at line 67 of file minimal.py.

67 def configure_from_commandline(self):
68 """Convert the command-line arguments to a basf2 job script"""
69 argument_parser = self.create_argument_parser()
70 arguments = argument_parser.parse_args()
71 self.configure(arguments)
72

◆ create_argument_parser()

create_argument_parser ( self,
** kwds )
inherited
Convert command-line arguments to basf2 argument list

Reimplemented from MinimalRun.

Reimplemented in ClusterFilterValidationRun, SegmentPairCreationValidationRun, ReadOrGenerateTrackedEventsRun, TrackingValidationRun, and FacetFilterTrainingRun.

Definition at line 55 of file event_generation.py.

55 def create_argument_parser(self, **kwds):
56 """Convert command-line arguments to basf2 argument list"""
57 argument_parser = super().create_argument_parser(**kwds)
58
59 setup_argument_group = argument_parser.add_argument_group("Detector setup arguments")
60 setup_argument_group.add_argument(
61 '-d',
62 '--detector',
63 dest='detector_setup',
64 default=argparse.SUPPRESS,
65 metavar='DETECTOR_SETUP_NAME',
66 choices=utilities.NonstrictChoices(detector_setups_by_short_name.keys()),
67 help=('Name of the detector setup to be used')
68 )
69
70 setup_argument_group.add_argument(
71 '-c',
72 '--component',
73 dest='components',
74 nargs='+',
75 default=argparse.SUPPRESS,
76 metavar='COMPONENTS',
77 action='store',
78 help=('Overrides the components of the detector setup')
79 )
80
81 generator_argument_group = argument_parser.add_argument_group("Generator arguments")
82 generator_argument_group.add_argument(
83 '-g',
84 '--generator',
85 dest='generator_module',
86 default=argparse.SUPPRESS,
87 metavar='GENERATOR_NAME',
88 choices=utilities.NonstrictChoices(valid_generator_short_names),
89 help='Name module or short name of the generator to be used.',
90 )
91
92 simulation_argument_group = argument_parser.add_argument_group("Simulation arguments")
93 simulation_argument_group.add_argument(
94 '-b',
95 '--bkg-file',
96 dest='bkg_files',
97 nargs='+',
98 default=self.bkg_files,
99 metavar='BACKGROUND_DIRECTORY',
100 help='Path to folder of files or to a file containing the background to be used. ' +
101 'Can be given multiple times.',
102 )
103
104 simulation_argument_group.add_argument(
105 '--disable-deltas',
106 action='store_true',
107 help='Disable the generation of delta rays in the simulation'
108 )
109
110 simulation_argument_group.add_argument(
111 '-so',
112 '--simulation-output',
113 nargs='?',
114 default=self.simulation_output,
115 const=self.root_input_file,
116 dest='simulation_output',
117 help='Only generate and simulate the events and write them to the given output file. Skip rest of the path.'
118 )
119
120 return argument_parser
121

◆ create_path()

create_path ( self)
Make SegmentFinding and QuadTreeFinding and plotting/display/validation

Reimplemented from ReadOrGenerateEventsRun.

Definition at line 72 of file segment_quad_tree.py.

72 def create_path(self):
73 """ Make SegmentFinding and QuadTreeFinding and plotting/display/validation"""
74 main_path = super().create_path()
75
76 add_mc_track_finder(main_path)
77 main_path.add_module("TFCDC_WireHitPreparer")
78 main_path.add_module("TFCDC_ClusterPreparer")
79
80 segment_finder = basf2.register_module("TFCDC_SegmentFinderFacetAutomaton")
81 segment_finder.param({
82 "WriteFacets": True,
83 "SegmentOrientation": "none",
84 })
85 main_path.add_module(segment_finder)
86
87 # main_path.add_module(Filler())
88
89 segment_quad_tree = basf2.register_module("SegmentQuadTree")
90 segment_quad_tree.param({
91 "Level": 4,
92 "MinimumItems": 1,
93 "DoPostprocessing": True,
94 })
95 segment_quad_tree.set_log_level(basf2.LogLevel.DEBUG)
96 segment_quad_tree.set_debug_level(100)
97 main_path.add_module(segment_quad_tree)
98 main_path.add_module(self.display_module_tracks)
99
100 return main_path
101
102

◆ execute()

execute ( self)
inherited
Run the basf2 job

Reimplemented from EmptyRun.

Definition at line 130 of file event_generation.py.

130 def execute(self):
131 """Run the basf2 job"""
132 if not self.simulation_output:
133 super().execute()
134 return
135
136 # Run only simulation
137 path = ReadOrGenerateEventsRun.create_path(self)
138 self.run(path)
139

◆ name()

name ( self)
inherited
provide name of this object

Definition at line 41 of file minimal.py.

41 def name(self):
42 """provide name of this object"""
43 return self.__class__.__name__
44

◆ run()

run ( self,
path )
inherited
Process the basf2 path

Reimplemented in PostProcessingRunMixin.

Definition at line 58 of file minimal.py.

58 def run(self, path):
59 """Process the basf2 path"""
60 # Run basf2 module path #
61
62 get_logger().info('Start processing')
63 basf2.print_path(path)
64 basf2.process(path)
65 get_logger().info("\n%s", str(basf2.statistics))
66

Member Data Documentation

◆ allow_input

bool allow_input = True
staticinherited

By default, this basf2 job can read events from an input ROOT TFile.

Definition at line 109 of file minimal.py.

◆ bkg_files

list bkg_files = []
staticinherited

By default, no background overlay.

Definition at line 47 of file event_generation.py.

◆ components

components = None
staticinherited

By default, do specific components.

Definition at line 49 of file event_generation.py.

◆ description

str description = "Empty execution of basf2"
staticinherited

Description of the run setup to be displayed on command line.

Definition at line 33 of file minimal.py.

◆ detector_setup

str detector_setup = "Default"
staticinherited

By default, use the default detector setup.

Definition at line 45 of file event_generation.py.

◆ disable_deltas

bool disable_deltas = False
staticinherited

By default, do not disable delta-ray generation.

Definition at line 51 of file event_generation.py.

◆ display_module_mc

display_module_mc
static
Initial value:
= CDCSVGDisplayModule(
)

Use CDCSVGDisplay to draw the MC tracks.

Definition at line 51 of file segment_quad_tree.py.

◆ display_module_segments

display_module_segments
static
Initial value:
= CDCSVGDisplayModule(
)

Use CDCSVGDisplay to draw the MCTrackCand segments.

Definition at line 25 of file segment_quad_tree.py.

◆ display_module_tracks

display_module_tracks
static
Initial value:
= CDCSVGDisplayModule(
)

Use CDCSVGDisplay to draw the TrackCand information.

Definition at line 40 of file segment_quad_tree.py.

◆ draw_clusters

draw_clusters
static

Do not draw the associated clusters.

Definition at line 35 of file segment_quad_tree.py.

◆ draw_gftrackcand_trajectories

draw_gftrackcand_trajectories
static

Do not draw the genfit MCTrackCand trajectories.

Draw the genfit MCTrackCand trajectories.

Definition at line 31 of file segment_quad_tree.py.

◆ draw_gftrackcands

draw_gftrackcands
static

Draw the genfit MCTrackCands.

Draw the genfit TrackCands.

Definition at line 33 of file segment_quad_tree.py.

◆ draw_mc_information

draw_mc_information
static

Draw the MC information.

Definition at line 70 of file segment_quad_tree.py.

◆ draw_quad_tree_content

draw_quad_tree_content
static

Draw the QuadTree segments.

Definition at line 66 of file segment_quad_tree.py.

◆ draw_segment_intersection

draw_segment_intersection
static

Draw the segment intersections.

Definition at line 68 of file segment_quad_tree.py.

◆ draw_segments_mctrackid

draw_segments_mctrackid
static

Draw the track IDs.

Definition at line 59 of file segment_quad_tree.py.

◆ generator_module

generator_module = None
staticinherited

By default, do not generate events.

Definition at line 43 of file event_generation.py.

◆ n_events

n_events = 10000
staticinherited

By default, process 10000 events.

Definition at line 111 of file minimal.py.

◆ n_events_to_skip

int n_events_to_skip = 0
staticinherited

By default, do not skip any events at the start of the input ROOT TFile.

Definition at line 119 of file minimal.py.

◆ n_processes

n_processes = 0
staticinherited

By default, no parallel processing.

Definition at line 117 of file minimal.py.

◆ plotter_module

plotter_module = SegmentQuadTreePlotter()
static

Convert the information to QuadTree segments then draw these.

Definition at line 64 of file segment_quad_tree.py.

◆ random_seed

random_seed = None
staticinherited

By default, the random-number seed is unassigned.

Definition at line 115 of file minimal.py.

◆ root_input_file

root_input_file = None
staticinherited

By default, there is no input ROOT TFile.

Definition at line 113 of file minimal.py.

◆ simulation_output

simulation_output = None
staticinherited

By default, do no store the simulation output.

Definition at line 53 of file event_generation.py.

◆ track_cands_store_array_name

track_cands_store_array_name
static

Tell the plotter where to find the information.

Definition at line 37 of file segment_quad_tree.py.


The documentation for this class was generated from the following file: