Belle II Software  release-08-01-10
OverlapResiduals_example.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
21 
22 import basf2
23 from simulation import add_simulation
24 from reconstruction import add_reconstruction
25 
26 
27 # Register the necessary modules
28 
29 # =====================================================================================================
30 # Generate specific cosmic events
31 cosmics = basf2.register_module('Cosmics')
32 cosmics.param('level', 1)
33 cosmics.param('ipRequirement', 1)
34 cosmics.param('cylindricalR', 16.0)
35 # Setting the random seed for particle generation
36 basf2.set_random_seed(0)
37 # Create Event information
38 eventinfosetter = basf2.register_module('EventInfoSetter')
39 # Show progress of processing
40 progress = basf2.register_module('ProgressBar')
41 # Load parameters
42 gearbox = basf2.register_module('Gearbox')
43 # Create geometry
44 geometry = basf2.register_module('Geometry', excludedComponents=['MagneticField'])
45 # Manages created histograms
46 histos = basf2.register_module('HistoManager')
47 # The main module: studies hits in overlapping sensors of a same VXD layer to monitor the VXD alignment
48 VXDResiduals = basf2.register_module('OverlapResiduals')
49 # ======================================================================================================
50 
51 eventinfosetter.param({'evtNumList': [100], 'runList': [1]})
52 
53 # Run the modules
54 main = basf2.create_path()
55 main.add_module(eventinfosetter)
56 main.add_module(gearbox)
57 main.add_module(geometry)
58 main.add_module(histos)
59 # Performs generation
60 main.add_module(cosmics)
61 # Performs simulation
62 add_simulation(main)
63 # Performs reconstruction
64 add_reconstruction(main, pruneTracks=False)
65 # Runs module OverlapResiduals
66 main.add_module(VXDResiduals)
67 main.add_module(progress)
68 
69 # Process events
70 basf2.process(main)
71 
72 # Print call statistics
73 print(basf2.statistics)