Belle II Software  release-08-01-10
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 
19 import basf2 as b2
20 
21 import sys
22 
23 argvs = sys.argv # get arg
24 argc = len(argvs) # of arg
25 
26 if argc != 3:
27  sys.exit("TrgCdcTsfUnpacker.py> # of arg is strange.\n 1.rootname\n Exit.")
28 
29 if argc == 3:
30  f_in_root = argvs[1]
31  f_out_root = argvs[2]
32 
33 b2.set_log_level(b2.LogLevel.ERROR)
34 # set_log_level(LogLevel.INFO)
35 
36 # input
37 input = b2.register_module('RootInput')
38 # unpacker
39 unpacker = b2.register_module('TRGCDCTSFUnpacker')
40 # output
41 output = b2.register_module('RootOutput')
42 
43 # Create main path
44 main = b2.create_path()
45 
46 # Add modules to main path
47 main.add_module(input)
48 main.add_module(unpacker)
49 
50 input.param("inputFileName", f_in_root)
51 output.param("outputFileName", f_out_root)
52 
53 # main.add_module(output);
54 main.add_module(output, branchNames=["TRGCDCTSFUnpackerStores"])
55 
56 # Process all events
57 b2.process(main)