Belle II Software  release-05-01-25
unpack_cdc.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
9 
10 from basf2 import *
11 from ROOT import Belle2
12 
13 # Set the log level to show only error and fatal messages
14 set_log_level(LogLevel.INFO)
15 
16 # Set Database
17 reset_database()
18 use_database_chain()
19 use_central_database("Calibration_Offline_Development", LogLevel.INFO)
20 
21 # Input file
22 # Get type of input file to decide, which input module we want to use
23 input_files = Belle2.Environment.Instance().getInputFilesOverride()
24 if not input_files.empty() and input_files.front().endswith(".sroot"):
25  root_input = register_module('SeqRootInput')
26 else:
27  root_input = register_module('RootInput')
28 
29 unpacker = register_module('CDCUnpacker')
30 output = register_module('RootOutput')
31 output.param('outputFileName', 'UnpackerOutput.root')
32 output.param('branchNames', ['CDCHits', 'CDCRawHits'])
33 
34 # Create main path
35 main = create_path()
36 
37 # Add modules to main path
38 main.add_module(root_input)
39 main.add_module(unpacker)
40 main.add_module(output)
41 
42 # Process all events
43 print_path(main)
44 process(main)
45 
46 print(statistics)
Belle2::Environment::Instance
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:31