Belle II Software  release-08-01-10
runTOPTBCComparator.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Usage: basf2 runTOPTBCComparator.py calSetList.txt
13 
14 import basf2 as b2
15 import sys
16 
17 b2.set_log_level(b2.LogLevel.INFO)
18 
19 # Create path
20 main = b2.create_path()
21 
22 # Set number of events to generate
23 eventinfosetter = b2.register_module('EventInfoSetter')
24 eventinfosetter.param('evtNumList', [1])
25 main.add_module(eventinfosetter)
26 
27 # Gearbox: access to database (xml files)
28 gearbox = b2.register_module('Gearbox')
29 argvs = sys.argv
30 main.add_module(gearbox)
31 
32 # Geometry
33 geometry = b2.register_module('Geometry')
34 geometry.param('useDB', False)
35 geometry.param('components', ['TOP'])
36 main.add_module(geometry)
37 
38 # TOP's data quality module
39 histo = b2.register_module("HistoManager")
40 main.add_module(histo)
41 
42 # compare
43 comparator = b2.register_module('TOPTBCComparator')
44 comparator.param('inputDirectorList', sys.argv[1])
45 main.add_module(comparator)
46 
47 # Print progress
48 progress = b2.register_module('Progress')
49 main.add_module(progress)
50 
51 # Process events
52 b2.process(main)
53 
54 # Print statistics
55 print(b2.statistics)