Belle II Software  release-08-01-10
TrgEclUnpacker.py
1 #!/usr/bin/env python
2 
3 
10 
11 # -----------------------------------------------------------------------------------
12 #
13 # ECL trigger Unpacker module
14 #
15 # usage : %> basf2 TrgEclUnpacker.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  f_in_root = argvs[1]
28  f_out_root = argvs[2]
29 
30 if f_in_root[-6:] == ".sroot":
31  input = b2.register_module('SeqRootInput')
32 if f_in_root[-5:] == ".root":
33  input = b2.register_module('RootInput')
34 
35 b2.set_log_level(b2.LogLevel.ERROR)
36 # set_log_level(LogLevel.INFO)
37 
38 # input
39 # unpacker
40 unpacker = b2.register_module('TRGECLUnpacker')
41 # output
42 output = b2.register_module('RootOutput')
43 
44 # Create main path
45 main = b2.create_path()
46 
47 # Add modules to main path
48 main.add_module(input)
49 main.add_module(unpacker)
50 
51 input.param("inputFileName", f_in_root)
52 output.param("outputFileName", f_out_root)
53 
54 # main.add_module(output);
55 main.add_module(
56  output,
57  branchNames=[
58  "TRGECLUnpackerStores",
59  "TRGECLUnpackerEvtStores",
60  "TRGECLUnpackerSumStores"])
61 
62 # Process all events
63 b2.process(main)