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