Belle II Software development
TrgCdcUnpacker.py
1#!/usr/bin/env python
2
3
10
11# -----------------------------------------------------------------------------------
12#
13# CDCTSF trigger Unpacker module
14#
15# usage : %> basf2 TrgCdcTsfUnpacker.py [input sroot file name]
16#
17# -----------------------------------------------------------------------------------
18
19import basf2 as b2
20
21import sys
22
23argvs = sys.argv # get arg
24argc = len(argvs) # of arg
25
26if argc != 3:
27 sys.exit("TrgCdcTsfUnpacker.py> # of arg is strange.\n 1.rootname\n Exit.")
28
29if argc == 3:
30 f_in_root = argvs[1]
31 f_out_root = argvs[2]
32
33b2.set_log_level(b2.LogLevel.ERROR)
34# set_log_level(LogLevel.INFO)
35
36# input
37input = b2.register_module('RootInput')
38# unpacker
39unpacker = b2.register_module('TRGCDCTSFUnpacker')
40# output
41output = b2.register_module('RootOutput')
42
43# Create main path
44main = b2.create_path()
45
46# Add modules to main path
47main.add_module(input)
48main.add_module(unpacker)
49
50input.param("inputFileName", f_in_root)
51output.param("outputFileName", f_out_root)
52
53# main.add_module(output);
54main.add_module(output, branchNames=["TRGCDCTSFUnpackerStores"])
55
56# Process all events
57b2.process(main)