Belle II Software development
unpack-dqm_cdc.py
1#!/usr/bin/env python3
2
3
10
11
16
17import basf2 as b2
18
19# Set the log level to show only error and fatal messages
20b2.set_log_level(b2.LogLevel.INFO)
21
22# Set your suitable DB
23b2.reset_database()
24b2.use_database_chain()
25b2.use_central_database('data_reprocessing_prompt')
26
27# input file must be a data taken by Suppress mode of FE (Belle2 normal mode for physics run)
28# Input (ROOT file).
29input = b2.register_module('RootInput')
30# Input (Seq. ROOT file).
31# input = register_module('SeqRootInput')
32
33# output
34unpacker = b2.register_module('CDCUnpacker')
35# FE channel <-> CDC cell ID map.
36# unpacker.param('xmlMapFileName', 'ch_map.dat')
37# Enable/Disable to store the RawCDC Object.
38unpacker.param('enableStoreCDCRawHit', True)
39# unpacker.param('enableStoreRawCDC', True)
40# Enable/Disable print out the ADC/TDC data to the terminal.
41# unpacker.param('enablePrintOut', True)
42# Set/Unset the relation between RawCDC and CDCHit.
43# unpacker.param('setRelationRaw2Hit', False)
44
45# dqm
46histo = b2.register_module("HistoManager") # Histogram Manager
47ex1 = b2.register_module("cdcDQM7")
48
49histo.param("histoFileName", "cdc_histo.root") # File to save accumulated histograms
50
51# Create main path
52main = b2.create_path()
53
54# Add modules to main path
55main.add_module(input)
56main.add_module(unpacker)
57main.add_module(histo) # Should be placed right after input module
58main.add_module(ex1)
59
60# Process all events
61b2.process(main)
62
63print(b2.statistics)