Belle II Software  release-08-01-10
simGCRData.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------------------
13 # Simulation of cosmic data
14 # ---------------------------------------------------------------------------------
15 
16 import basf2 as b2
17 from simulation import add_simulation
18 from reconstruction import add_cosmics_reconstruction
19 
20 # Suppress messages and warnings during processing:
21 # b2.set_log_level(b2.LogLevel.ERROR)
22 
23 # Create path
24 main = b2.create_path()
25 
26 # Event info setter
27 main.add_module('EventInfoSetter')
28 
29 # Cosmic generator
30 main.add_module('Cosmics')
31 
32 # Detector simulation
33 add_simulation(main)
34 
35 # reconstruction
36 add_cosmics_reconstruction(main, components=['CDC'], merge_tracks=False)
37 
38 # output
39 output = b2.register_module('RootOutput')
40 output.param('branchNames', ['TOPDigits', 'ExtHits', 'Tracks', 'TrackFitResults',
41  'MCParticles', 'TOPBarHits', 'EventT0'])
42 main.add_module(output)
43 
44 # Print progress
45 progress = b2.register_module('Progress')
46 main.add_module(progress)
47 
48 # Process events
49 b2.process(main)
50 
51 # Print statistics
52 print(b2.statistics)