Belle II Software development
VXDTF2TrackingValidation.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <contact>software-tracking@belle2.org</contact>
14 <input>EvtGenSimNoBkg.root</input>
15 <output>VXDTF2TrackingValidation.root</output>
16 <description>
17 This module validates that the VXDTF2 SVD-only track finding is capable of reconstructing tracks in Y(4S) runs.
18 </description>
19</header>
20"""
21
22import tracking
23from tracking.validation.run import TrackingValidationRun
24import logging
25import basf2
26import os
27
28VALIDATION_OUTPUT_FILE = 'VXDTF2TrackingValidation.root'
29N_EVENTS = 1000
30ACTIVE = False
31
32
33def setupFinderModule(path):
34 tracking.add_hit_preparation_modules(path, components=["SVD"])
35 tracking.add_vxd_track_finding_vxdtf2(path, components=["SVD"])
36
37
39 """
40 Validation class for the four 4-SVD Layer tracking
41 """
42
43 n_events = N_EVENTS
44
45 generator_module = 'generic'
46
47 root_input_file = '../EvtGenSimNoBkg.root'
48
49 components = None
50
51
52 finder_module = staticmethod(setupFinderModule)
53
54
55 tracking_coverage = {
56 'WhichParticles': ['SVD'], # Include all particles seen in the SVD detector, also secondaries
57 'UsePXDHits': False,
58 'UseSVDHits': True,
59 'UseCDCHits': False,
60 }
61
62
63 fit_tracks = True
64
65 pulls = True
66
67 use_expert_folder = False
68
69 output_file_name = VALIDATION_OUTPUT_FILE
70
71 # ugly way to set a local SectorMap if corresponding environment var is set
72 # TODO: Find more elegant way!
73 def adjust_path(self, path):
74 # if environment variable is set, use the SectorMap this variable is pointing to!
75 testing_secmap_name = os.getenv("BELLE2_TESTING_VXDTF2_SECMAP")
76 if testing_secmap_name is not None:
77 basf2.B2WARNING("Using non-default (the one in the db) SectorMap: " + testing_secmap_name)
78 basf2.set_module_parameters(path, "SectorMapBootstrap", ReadSecMapFromDB=False)
79 basf2.set_module_parameters(path, "SectorMapBootstrap", ReadSectorMap=True)
80 basf2.set_module_parameters(path, "SectorMapBootstrap", SectorMapsInputFile=testing_secmap_name)
81
82
83def main():
84 """
85 create SVD validation class and execute
86 """
87 basf2.set_random_seed(1337)
88 validation_run = VXDTF2TrackingValidation()
89 validation_run.configure_and_execute_from_commandline()
90
91
92if __name__ == '__main__':
93 logging.basicConfig(level=logging.INFO)
94 if ACTIVE:
95 main()
96 else:
97 print("This validation deactivated and thus basf2 is not executed.\n"
98 "If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"
99 "Exiting.")
Definition: main.py:1