Belle II Software  release-05-02-19
simGCRData.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 # ---------------------------------------------------------------------------------
5 # Simulation using MCParticles made of reconstructed cosmic tracks from GCR data
6 # Input file can be prepared with top/analysis/makeMCParticlesFromGCRData.py
7 # ---------------------------------------------------------------------------------
8 
9 from basf2 import *
10 from simulation import add_simulation
11 from reconstruction import add_cosmics_reconstruction
12 
13 # Suppress messages and warnings during processing:
14 set_log_level(LogLevel.ERROR)
15 
16 # Define a global tag (note: the one given bellow will become out-dated!)
17 use_central_database('data_reprocessing_proc8')
18 
19 # Create path
20 main = create_path()
21 
22 # input
23 roinput = register_module('RootInput')
24 main.add_module(roinput)
25 
26 # Geometry
27 geometry = register_module('Geometry')
28 main.add_module(geometry)
29 
30 # Detector simulation
31 add_simulation(main)
32 
33 # reconstruction
34 add_cosmics_reconstruction(main, components=['CDC'], merge_tracks=False)
35 
36 # output
37 output = register_module('RootOutput')
38 output.param('branchNames', ['TOPDigits', 'ExtHits', 'Tracks', 'TrackFitResults',
39  'MCParticles', 'TOPBarHits', 'EventT0'])
40 main.add_module(output)
41 
42 # Print progress
43 progress = register_module('Progress')
44 main.add_module(progress)
45 
46 # Process events
47 process(main)
48 
49 # Print statistics
50 print(statistics)