Belle II Software  release-08-01-10
runTOPWaveformQuality.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------------------------
13 # Display of waveforms with feature extraction points superimposed
14 # ---------------------------------------------------------------------------------------
15 
16 # avoid race conditions beetween pyroot and GUI thread
17 from ROOT import PyConfig
18 PyConfig.StartGuiThread = False # noqa
19 from ROOT import gROOT
20 gROOT.SetBatch() # noqa
21 
22 import basf2 as b2
23 
24 b2.set_log_level(b2.LogLevel.INFO)
25 
26 # Database
27 b2.conditions.override_globaltags()
28 b2.conditions.append_globaltag('online')
29 
30 # Create path
31 main = b2.create_path()
32 
33 # input
34 # roinput = b2.register_module('SeqRootInput') # sroot files
35 roinput = b2.register_module('RootInput') # root files
36 main.add_module(roinput)
37 
38 # conversion from RawCOPPER or RawDataBlock to RawTOP
39 converter = b2.register_module('Convert2RawDet')
40 main.add_module(converter)
41 
42 # Initialize TOP geometry parameters (creation of Geant geometry is not needed)
43 main.add_module('TOPGeometryParInitializer')
44 
45 # Unpacking (format auto detection works now)
46 unpack = b2.register_module('TOPUnpacker')
47 main.add_module(unpack)
48 
49 # TOP's data quality module
50 histomanager = b2.register_module("HistoManager")
51 main.add_module(histomanager)
52 wfqp = b2.register_module('TOPWaveformQualityPlotter')
53 main.add_module(wfqp)
54 
55 # Print progress
56 progress = b2.register_module('Progress')
57 main.add_module(progress)
58 
59 # Process events
60 b2.process(main)
61 
62 # Print statistics
63 print(b2.statistics)