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