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