Belle II Software development
runTOPDQM.py
1#!/usr/bin/env python3
2
3
10
11# ---------------------------------------------------------------------------------------
12# Make DQM histograms for TOP (hit-level only) using raw data
13#
14# Usage: basf2 runTOPDQM.py -i <raw_data_file>
15# ---------------------------------------------------------------------------------------
16
17import basf2 as b2
18
19# Database
20b2.conditions.override_globaltags()
21b2.conditions.append_globaltag('online')
22# b2.conditions.append_testing_payloads('localDB-FEMaps/localDB.txt') # SCROD mapping from local database
23
24# Create path
25main = b2.create_path()
26
27# input: raw data
28roinput = b2.register_module('RootInput') # root files
29# roinput = b2.register_module('SeqRootInput') # sroot files
30main.add_module(roinput)
31
32# conversion from RawCOPPER or RawDataBlock to RawTOP (uncomment for pocketDAQ!)
33# converter = b2.register_module('Convert2RawDet')
34# main.add_module(converter)
35
36# Initialize TOP geometry parameters (creation of Geant geometry is not needed)
37main.add_module('TOPGeometryParInitializer')
38
39# Unpacking (format auto detection works now)
40unpack = b2.register_module('TOPUnpacker')
41main.add_module(unpack)
42
43# Convert to TOPDigits
44converter = b2.register_module('TOPRawDigitConverter')
45# converter.param('lookBackWindows', 28) # for laser or pulsar data
46main.add_module(converter)
47
48# DQM setup
49histo = b2.register_module("HistoManager")
50histo.param('histoFileName', 'topDQM.root')
51main.add_module(histo)
52
53dqm = b2.register_module('TOPDQM')
54main.add_module(dqm)
55
56# Print progress
57progress = b2.register_module('Progress')
58main.add_module(progress)
59
60# Process events
61b2.process(main)
62
63# Print statistics
64print(b2.statistics)