Belle II Software  release-08-01-10
reduce_bg_file.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # copy a beam background simulatio file, keeping only data related to SVD.
13 
14 import basf2 as b2
15 
16 main = b2.create_path()
17 
18 input = b2.register_module('RootInput')
19 input.param('branchNames', ['SVDSimHits', 'SVDTrueHits',
20  'SVDTrueHitsToSVDSimHits', 'BeamBackHits'])
21 # enter the path to the input data file(s) on your system here
22 input.param('inputFileName', '/data/belle2/BG/Jun2014/bg_full/Touschek_LER_100us.root')
23 main.add_module(input)
24 
25 bbfilter = b2.register_module('SVDBeamBackHitFilter')
26 bbfilter.set_log_level(b2.LogLevel.INFO)
27 main.add_module(bbfilter)
28 
29 output = b2.register_module('RootOutput')
30 # enter the path to the output file on your filesystem here
31 output.param('outputFileName', 'Touschek_LER_100us_SVD.root')
32 main.add_module(output)
33 
34 
35 main.add_module(b2.register_module('ProgressBar'))
36 
37 
38 b2.process(main)
39 
40 print(b2.statistics)