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