Belle II Software development
cosmicsHoughTrackingValidation.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <contact>software-tracking@belle2.org</contact>
14 <input>CosmicsSimNoBkg.root</input>
15 <description>Validates the hough finder working on segments in cosmics events.</description>
16</header>
17"""
18
19from tracking.validation.run import TrackingValidationRun
20import logging
21import trackfindingcdc.cdcdisplay as cdcdisplay
22import os
23import basf2
24VALIDATION_OUTPUT_FILE = 'CosmicsHoughTrackingValidation.root'
25N_EVENTS = 1000
26ACTIVE = False
27
28
29class CosmicsHough(TrackingValidationRun):
30 """Validate the CDC Hough track-segment finder with cosmic rays"""
31
32 n_events = N_EVENTS
33
34 generator_module = 'Cosmics'
35
36 root_input_file = '../CosmicsSimNoBkg.root'
37
38 components = None
39
40 def finder_module(self, path):
41 """Add the CDC Hough track finder and related modules to the basf2 path"""
42 path.add_module('TFCDC_WireHitPreparer')
43 path.add_module('TFCDC_ClusterPreparer')
44 path.add_module('TFCDC_SegmentFinderFacetAutomaton',
45 SegmentOrientation="downwards")
46 path.add_module('TFCDC_AxialTrackCreatorSegmentHough',
47 tracks="CDCAxialTrackVector")
48 path.add_module('TFCDC_StereoHitFinder',
49 inputTracks="CDCAxialTrackVector")
50 path.add_module('TFCDC_TrackExporter',
51 inputTracks="CDCAxialTrackVector")
52
53 interactive_display = False
54 if interactive_display:
55 cdc_display_module = cdcdisplay.CDCSVGDisplayModule(os.getcwd(), interactive=True)
56 cdc_display_module.draw_recotracks = True
57 cdc_display_module.draw_recotrack_seed_trajectories = True
58 path.add_module(cdc_display_module)
59
60
61 tracking_coverage = {
62 'WhichParticles': ['CDC'], # Include all particles seen in CDC, also secondaries
63 'UsePXDHits': False,
64 'UseSVDHits': False,
65 'UseCDCHits': True,
66 'UseOnlyAxialCDCHits': False,
67 "UseReassignedHits": True,
68 }
69
70 pulls = True
71
72 output_file_name = VALIDATION_OUTPUT_FILE
73
74
75def main():
76 basf2.set_random_seed(1337)
77 validation_run = CosmicsHough()
78 validation_run.configure_and_execute_from_commandline()
79
80
81if __name__ == '__main__':
82 logging.basicConfig(level=logging.INFO)
83 if ACTIVE:
84 main()
85 else:
86 print("This validation deactivated and thus basf2 is not executed.\n"
87 "If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"
88 "Exiting.")
None finder_module
Name of the finder module to be used - can be everything that is accepted by tracking....
Definition: main.py:1