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