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