Belle II Software  release-08-00-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')
35 main.add_module(roinput)
36 
37 # conversion from RawCOPPER or RawDataBlock to RawTOP
38 converter = b2.register_module('Convert2RawDet')
39 main.add_module(converter)
40 
41 # Initialize TOP geometry parameters (creation of Geant geometry is not needed)
42 main.add_module('TOPGeometryParInitializer')
43 
44 # Unpacking (format auto detection works now)
45 unpack = b2.register_module('TOPUnpacker')
46 main.add_module(unpack)
47 
48 # TOP's data quality module
49 histomanager = b2.register_module("HistoManager")
50 main.add_module(histomanager)
51 wfqp = b2.register_module('TOPWaveformQualityPlotter')
52 main.add_module(wfqp)
53 
54 # Print progress
55 progress = b2.register_module('Progress')
56 main.add_module(progress)
57 
58 # Process events
59 b2.process(main)
60 
61 # Print statistics
62 print(b2.statistics)