Belle II Software development
segment_quad_tree.py
1
8
9import basf2
10
11from tracking.run.event_generation import StandardEventGenerationRun
12from trackfindingcdc.quadtree.quadTreePlotter import SegmentQuadTreePlotter
13from trackfindingcdc.cdcdisplay import CDCSVGDisplayModule
14from trackfinderoutputcombiner.validation import add_mc_track_finder
15
16import logging
17import sys
18
19
21
22 """ Create segments and plot them in a segment quad tree """
23
24
25 display_module_segments = CDCSVGDisplayModule(
26
27 interactive=True
28
29 )
30
31 display_module_segments.draw_gftrackcand_trajectories = False
32
33 display_module_segments.draw_gftrackcands = True
34
35 display_module_segments.draw_clusters = False
36
37 display_module_segments.track_cands_store_array_name = "MCTrackCands"
38
39
40 display_module_tracks = CDCSVGDisplayModule(
41
42 interactive=True
43
44 )
45
46 display_module_tracks.draw_gftrackcands = True
47
48 display_module_tracks.track_cands_store_array_name = "TrackCands"
49
50
51 display_module_mc = CDCSVGDisplayModule(
52
53 interactive=True
54
55 )
56
57 display_module_mc.draw_gftrackcand_trajectories = True
58
59 display_module_mc.draw_segments_mctrackid = True
60
61 display_module_mc.track_cands_store_array_name = "MCTrackCands"
62
63
64 plotter_module = SegmentQuadTreePlotter()
65
66 plotter_module.draw_quad_tree_content = True
67
68 plotter_module.draw_segment_intersection = True
69
70 plotter_module.draw_mc_information = True
71
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
103def main():
104 run = SegmentQuadTreeRun()
105 run.configure_and_execute_from_commandline()
106
107
108if __name__ == "__main__":
109 logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(levelname)s:%(message)s')
110 main()
CDCSVGDisplayModule display_module_tracks
Use CDCSVGDisplay to draw the TrackCand information.
Definition: main.py:1