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