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