Belle II Software development
03_trackingEfficiency_createData.py
1#!/usr/bin/env python3
2
3
10
11
17
18"""
19<header>
20 <output>trackingEfficiency_pt_0.05GeV.root</output>
21 <contact>software-tracking@belle2.org</contact>
22 <description>Create events with 10 muon tracks with fixed pt value.</description>
23</header>
24"""
25
26import basf2 as b2
27from tracking.validation.tracking_efficiency_helpers import run_simulation, run_reconstruction, get_generated_pt_value
28
29ACTIVE = True
30
31
32def run():
33 b2.set_random_seed(123)
34
35 pt_value = get_generated_pt_value(0)
36
37 output_filename = f'../trackingEfficiency_pt_{pt_value:.2f}GeV.root'
38
39 print(output_filename)
40
41 path = b2.create_path()
42
43 run_simulation(path, pt_value)
44 run_reconstruction(path, output_filename)
45
46 path.add_module('Progress')
47
48 b2.process(path)
49
50 print(b2.statistics)
51
52
53if __name__ == '__main__':
54 if ACTIVE:
55 run()
56 else:
57 print("This validation deactivated and thus basf2 is not executed.\n"
58 "If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"
59 "Exiting.")